pub struct ADOContract<'a> { /* private fields */ }
Implementations§
Source§impl<'a> ADOContract<'a>
impl<'a> ADOContract<'a>
pub fn get_app_contract( &self, storage: &dyn Storage, ) -> Result<Option<Addr>, ContractError>
pub fn execute_update_app_contract( &self, deps: DepsMut<'_>, info: MessageInfo, address: String, addresses: Option<Vec<AndrAddr>>, ) -> Result<Response, ContractError>
Source§impl<'a> ADOContract<'a>
impl<'a> ADOContract<'a>
pub fn instantiate( &self, storage: &mut dyn Storage, env: Env, api: &dyn Api, querier: &QuerierWrapper<'_>, info: MessageInfo, msg: InstantiateMsg, ) -> Result<Response, ContractError>
Sourcepub fn execute(
&self,
ctx: ExecuteContext<'_>,
msg: impl Serialize,
) -> Result<Response, ContractError>
pub fn execute( &self, ctx: ExecuteContext<'_>, msg: impl Serialize, ) -> Result<Response, ContractError>
Handles execution of ADO specific messages.
pub fn migrate( &self, deps: DepsMut<'_>, contract_name: &str, contract_version: &str, ) -> Result<Response, ContractError>
Sourcepub fn validate_andr_addresses(
&self,
deps: &Deps<'_>,
addresses: Vec<AndrAddr>,
) -> Result<(), ContractError>
pub fn validate_andr_addresses( &self, deps: &Deps<'_>, addresses: Vec<AndrAddr>, ) -> Result<(), ContractError>
Validates all provided AndrAddr
addresses.
Requires the VFS address to be set if any address is a VFS path. Automatically validates all stored modules.
Sourcepub fn get_kernel_address(
&self,
storage: &dyn Storage,
) -> Result<Addr, ContractError>
pub fn get_kernel_address( &self, storage: &dyn Storage, ) -> Result<Addr, ContractError>
Gets the stored address for the Kernel contract
Sourcepub fn get_vfs_address(
&self,
storage: &dyn Storage,
querier: &QuerierWrapper<'_>,
) -> Result<Addr, ContractError>
pub fn get_vfs_address( &self, storage: &dyn Storage, querier: &QuerierWrapper<'_>, ) -> Result<Addr, ContractError>
Gets the current address for the VFS contract.
Sourcepub fn get_adodb_address(
&self,
storage: &dyn Storage,
querier: &QuerierWrapper<'_>,
) -> Result<Addr, ContractError>
pub fn get_adodb_address( &self, storage: &dyn Storage, querier: &QuerierWrapper<'_>, ) -> Result<Addr, ContractError>
Gets the current address for the VFS contract.
Sourcepub fn execute_amp_receive<M: DeserializeOwned>(
&self,
ctx: ExecuteContext<'_>,
packet: AMPPkt,
handler: fn(ExecuteContext<'_>, M) -> Result<Response, ContractError>,
) -> Result<Response, ContractError>
pub fn execute_amp_receive<M: DeserializeOwned>( &self, ctx: ExecuteContext<'_>, packet: AMPPkt, handler: fn(ExecuteContext<'_>, M) -> Result<Response, ContractError>, ) -> Result<Response, ContractError>
Handles receiving and verifies an AMPPkt from the Kernel before executing the appropriate messages.
Calls the provided handler with the AMP packet attached within the context.
Sourcepub fn pay_fee(
&self,
storage: &dyn Storage,
querier: &QuerierWrapper<'_>,
action: String,
payee: Addr,
) -> Result<SubMsg, ContractError>
pub fn pay_fee( &self, storage: &dyn Storage, querier: &QuerierWrapper<'_>, action: String, payee: Addr, ) -> Result<SubMsg, ContractError>
Generates a message to pay a fee for a given action by the given payee
Fees are paid in the following fallthrough priority:
- ADO Contract
- App Contract for sending ADO
- Provided Payee
If any of the above cannot pay the fee the remainder is paid by the next in the list until no remainder remains. If there is still a remainder after all 3 payments then the fee cannot be paid and the message will error.
Sourcepub fn update_kernel_address(
&self,
deps: DepsMut<'_>,
info: MessageInfo,
address: Addr,
) -> Result<Response, ContractError>
pub fn update_kernel_address( &self, deps: DepsMut<'_>, info: MessageInfo, address: Addr, ) -> Result<Response, ContractError>
Updates the current kernel address used by the ADO Requires the sender to be the owner of the ADO
Source§impl<'a> ADOContract<'a>
impl<'a> ADOContract<'a>
pub fn execute_ownership( &self, deps: DepsMut<'_>, env: Env, info: MessageInfo, msg: OwnershipMessage, ) -> Result<Response, ContractError>
Sourcepub fn update_owner(
&self,
deps: DepsMut<'_>,
info: MessageInfo,
new_owner: Addr,
expiration: Option<MillisecondsExpiration>,
) -> Result<Response, ContractError>
pub fn update_owner( &self, deps: DepsMut<'_>, info: MessageInfo, new_owner: Addr, expiration: Option<MillisecondsExpiration>, ) -> Result<Response, ContractError>
Updates the current contract owner. Only executable by the current contract owner.
Sourcepub fn revoke_ownership_offer(
&self,
deps: DepsMut<'_>,
info: MessageInfo,
) -> Result<Response, ContractError>
pub fn revoke_ownership_offer( &self, deps: DepsMut<'_>, info: MessageInfo, ) -> Result<Response, ContractError>
Revokes the ownership offer. Only executable by the current contract owner.
Sourcepub fn accept_ownership(
&self,
deps: DepsMut<'_>,
env: Env,
info: MessageInfo,
) -> Result<Response, ContractError>
pub fn accept_ownership( &self, deps: DepsMut<'_>, env: Env, info: MessageInfo, ) -> Result<Response, ContractError>
Accepts the ownership of the contract. Only executable by the new contract owner.
Sourcepub fn disown(
&self,
deps: DepsMut<'_>,
info: MessageInfo,
) -> Result<Response, ContractError>
pub fn disown( &self, deps: DepsMut<'_>, info: MessageInfo, ) -> Result<Response, ContractError>
Disowns the contract. Only executable by the current contract owner.
Sourcepub fn owner(&self, storage: &dyn Storage) -> Result<Addr, ContractError>
pub fn owner(&self, storage: &dyn Storage) -> Result<Addr, ContractError>
Helper function to query if a given address is the current contract owner.
Returns a boolean value indicating if the given address is the contract owner.
Sourcepub fn is_contract_owner(
&self,
storage: &dyn Storage,
addr: &str,
) -> Result<bool, ContractError>
pub fn is_contract_owner( &self, storage: &dyn Storage, addr: &str, ) -> Result<bool, ContractError>
Helper function to query if a given address is the current contract owner.
Returns a boolean value indicating if the given address is the contract owner.
Sourcepub fn is_owner_or_operator(
&self,
storage: &dyn Storage,
addr: &str,
) -> Result<bool, ContractError>
pub fn is_owner_or_operator( &self, storage: &dyn Storage, addr: &str, ) -> Result<bool, ContractError>
Helper function to query if a given address is the current contract owner or operator.
Returns a boolean value indicating if the given address is the contract owner or operator.
pub fn ownership_request( &self, storage: &dyn Storage, ) -> Result<ContractPotentialOwnerResponse, ContractError>
Source§impl<'a> ADOContract<'a>
impl<'a> ADOContract<'a>
pub fn execute_permissioning( &self, ctx: ExecuteContext<'_>, msg: PermissioningMessage, ) -> Result<Response, ContractError>
Sourcepub fn is_permissioned(
&self,
store: &mut dyn Storage,
env: Env,
action: impl Into<String>,
actor: impl Into<String>,
) -> Result<(), ContractError>
pub fn is_permissioned( &self, store: &mut dyn Storage, env: Env, action: impl Into<String>, actor: impl Into<String>, ) -> Result<(), ContractError>
Determines if the provided actor is authorised to perform the given action
Returns an error if the given action is not permissioned for the given actor
Sourcepub fn is_permissioned_strict(
&self,
store: &mut dyn Storage,
env: Env,
action: impl Into<String>,
actor: impl Into<String>,
) -> Result<(), ContractError>
pub fn is_permissioned_strict( &self, store: &mut dyn Storage, env: Env, action: impl Into<String>, actor: impl Into<String>, ) -> Result<(), ContractError>
Determines if the provided actor is authorised to perform the given action
Ignores the PERMISSIONED_ACTIONS
map
Returns an error if the permission has expired or if no permission exists for a restricted ADO
Sourcepub fn get_permission(
store: &dyn Storage,
action: impl Into<String>,
actor: impl Into<String>,
) -> Result<Option<Permission>, ContractError>
pub fn get_permission( store: &dyn Storage, action: impl Into<String>, actor: impl Into<String>, ) -> Result<Option<Permission>, ContractError>
Gets the permission for the given action and actor
Sourcepub fn set_permission(
store: &mut dyn Storage,
action: impl Into<String>,
actor: impl Into<String>,
permission: Permission,
) -> Result<(), ContractError>
pub fn set_permission( store: &mut dyn Storage, action: impl Into<String>, actor: impl Into<String>, permission: Permission, ) -> Result<(), ContractError>
Sets the permission for the given action and actor
Sourcepub fn remove_permission(
store: &mut dyn Storage,
action: impl Into<String>,
actor: impl Into<String>,
) -> Result<(), ContractError>
pub fn remove_permission( store: &mut dyn Storage, action: impl Into<String>, actor: impl Into<String>, ) -> Result<(), ContractError>
Removes the permission for the given action and actor
Sourcepub fn execute_set_permission(
&self,
ctx: ExecuteContext<'_>,
actor: AndrAddr,
action: impl Into<String>,
permission: Permission,
) -> Result<Response, ContractError>
pub fn execute_set_permission( &self, ctx: ExecuteContext<'_>, actor: AndrAddr, action: impl Into<String>, permission: Permission, ) -> Result<Response, ContractError>
Execute handler for setting permission
Whitelisted/Limited permissions will only work for permissioned actions
Sourcepub fn execute_remove_permission(
&self,
ctx: ExecuteContext<'_>,
actor: AndrAddr,
action: impl Into<String>,
) -> Result<Response, ContractError>
pub fn execute_remove_permission( &self, ctx: ExecuteContext<'_>, actor: AndrAddr, action: impl Into<String>, ) -> Result<Response, ContractError>
Execute handler for setting permission
Sourcepub fn permission_action(
&self,
action: impl Into<String>,
store: &mut dyn Storage,
) -> Result<(), ContractError>
pub fn permission_action( &self, action: impl Into<String>, store: &mut dyn Storage, ) -> Result<(), ContractError>
Enables permissioning for a given action
Sourcepub fn disable_action_permission(
&self,
action: impl Into<String>,
store: &mut dyn Storage,
)
pub fn disable_action_permission( &self, action: impl Into<String>, store: &mut dyn Storage, )
Disables permissioning for a given action
pub fn execute_permission_action( &self, ctx: ExecuteContext<'_>, action: impl Into<String>, ) -> Result<Response, ContractError>
pub fn execute_disable_action_permission( &self, ctx: ExecuteContext<'_>, action: impl Into<String>, ) -> Result<Response, ContractError>
Sourcepub fn query_permissions(
&self,
deps: Deps<'_>,
actor: impl Into<String>,
limit: Option<u32>,
start_after: Option<String>,
) -> Result<Vec<PermissionInfo>, ContractError>
pub fn query_permissions( &self, deps: Deps<'_>, actor: impl Into<String>, limit: Option<u32>, start_after: Option<String>, ) -> Result<Vec<PermissionInfo>, ContractError>
Queries all permissions for a given actor