pub struct Cw20Base<Chain>(/* private fields */);Implementations§
Trait Implementations§
Source§impl<Chain: ChainState> ContractInstance<Chain> for Cw20Base<Chain>
Available on non-WebAssembly only.
impl<Chain: ChainState> ContractInstance<Chain> for Cw20Base<Chain>
Available on non-WebAssembly only.
Source§fn as_instance(&self) -> &Contract<Chain>
fn as_instance(&self) -> &Contract<Chain>
Return a reference to the underlying contract instance.
Source§fn as_instance_mut(&mut self) -> &mut Contract<Chain>
fn as_instance_mut(&mut self) -> &mut Contract<Chain>
Return a mutable reference to the underlying contract instance.
Source§fn set_address(&self, address: &Addr)
fn set_address(&self, address: &Addr)
Sets the address for the contract. Useful when the contract is already initialized
and not registered in the configured state file.
Source§fn remove_address(&self)
fn remove_address(&self)
Removes the address for the contract
Source§fn set_default_address(&mut self, address: &Addr)
fn set_default_address(&mut self, address: &Addr)
Sets a default address for the contract. If the contract already has an address registered in the state, this won’t be used.
This is mostly used to ship address with a cw-orch package.
Source§fn set_code_id(&self, code_id: u64)
fn set_code_id(&self, code_id: u64)
Sets the code_id for the contract. Useful when the contract is already initialized
and not registered in the configured state file.
Source§fn remove_code_id(&self)
fn remove_code_id(&self)
Removes the code_id for the contract
Source§fn set_default_code_id(&mut self, code_id: u64)
fn set_default_code_id(&mut self, code_id: u64)
Sets a default address for the contract. If the contract already has an address registered in the state, this won’t be used.
This is mostly used to ship address with a cw-orch package.
Source§impl<Chain> ExecutableContract for Cw20Base<Chain>
Available on non-WebAssembly only.
impl<Chain> ExecutableContract for Cw20Base<Chain>
Available on non-WebAssembly only.
Source§type ExecuteMsg = Cw20ExecuteMsg
type ExecuteMsg = Cw20ExecuteMsg
Execute message for the contract.
Source§impl<Chain> InstantiableContract for Cw20Base<Chain>
Available on non-WebAssembly only.
impl<Chain> InstantiableContract for Cw20Base<Chain>
Available on non-WebAssembly only.
Source§type InstantiateMsg = InstantiateMsg
type InstantiateMsg = InstantiateMsg
Instantiate message for the contract.
Source§impl<Chain> MigratableContract for Cw20Base<Chain>
Available on non-WebAssembly only.
impl<Chain> MigratableContract for Cw20Base<Chain>
Available on non-WebAssembly only.
Source§type MigrateMsg = MigrateMsg
type MigrateMsg = MigrateMsg
Migrate message for the contract.
Source§impl<Chain> QueryableContract for Cw20Base<Chain>
Available on non-WebAssembly only.
impl<Chain> QueryableContract for Cw20Base<Chain>
Available on non-WebAssembly only.
Source§impl<Chain: CwEnv> Uploadable for Cw20Base<Chain>
Available on non-WebAssembly only.
impl<Chain: CwEnv> Uploadable for Cw20Base<Chain>
Available on non-WebAssembly only.
Auto Trait Implementations§
impl<Chain> Freeze for Cw20Base<Chain>where
Chain: Freeze,
impl<Chain> RefUnwindSafe for Cw20Base<Chain>where
Chain: RefUnwindSafe,
impl<Chain> Send for Cw20Base<Chain>where
Chain: Send,
impl<Chain> Sync for Cw20Base<Chain>where
Chain: Sync,
impl<Chain> Unpin for Cw20Base<Chain>where
Chain: Unpin,
impl<Chain> UnwindSafe for Cw20Base<Chain>where
Chain: UnwindSafe,
Blanket Implementations§
Source§impl<Chain, CwOrchQueryMsgType, SupportedContract> AsyncQueryMsgFns<Chain, CwOrchQueryMsgType> for SupportedContractwhere
Chain: AsyncWasmQuerier + ChainState,
CwOrchQueryMsgType: Sync,
QueryMsg: Into<CwOrchQueryMsgType>,
SupportedContract: AsyncCwOrchQuery<Chain, QueryMsg = CwOrchQueryMsgType>,
impl<Chain, CwOrchQueryMsgType, SupportedContract> AsyncQueryMsgFns<Chain, CwOrchQueryMsgType> for SupportedContractwhere
Chain: AsyncWasmQuerier + ChainState,
CwOrchQueryMsgType: Sync,
QueryMsg: Into<CwOrchQueryMsgType>,
SupportedContract: AsyncCwOrchQuery<Chain, QueryMsg = CwOrchQueryMsgType>,
Source§async fn balance_async(
&self,
address: impl Into<String>,
) -> Result<BalanceResponse, CwEnvError>
async fn balance_async( &self, address: impl Into<String>, ) -> Result<BalanceResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::Balance variant
Source§async fn token_info_async(&self) -> Result<TokenInfoResponse, CwEnvError>
async fn token_info_async(&self) -> Result<TokenInfoResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::TokenInfo variant
Source§async fn minter_async(&self) -> Result<MinterResponse, CwEnvError>
async fn minter_async(&self) -> Result<MinterResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::Minter variant
Source§async fn allowance_async(
&self,
owner: impl Into<String>,
spender: impl Into<String>,
) -> Result<AllowanceResponse, CwEnvError>
async fn allowance_async( &self, owner: impl Into<String>, spender: impl Into<String>, ) -> Result<AllowanceResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::Allowance variant
Source§async fn all_allowances_async(
&self,
owner: impl Into<String>,
limit: Option<u32>,
start_after: Option<String>,
) -> Result<AllAllowancesResponse, CwEnvError>
async fn all_allowances_async( &self, owner: impl Into<String>, limit: Option<u32>, start_after: Option<String>, ) -> Result<AllAllowancesResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::AllAllowances variant
Source§async fn all_spender_allowances_async(
&self,
spender: impl Into<String>,
limit: Option<u32>,
start_after: Option<String>,
) -> Result<AllSpenderAllowancesResponse, CwEnvError>
async fn all_spender_allowances_async( &self, spender: impl Into<String>, limit: Option<u32>, start_after: Option<String>, ) -> Result<AllSpenderAllowancesResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::AllSpenderAllowances variant
Source§async fn all_accounts_async(
&self,
limit: Option<u32>,
start_after: Option<String>,
) -> Result<AllAccountsResponse, CwEnvError>
async fn all_accounts_async( &self, limit: Option<u32>, start_after: Option<String>, ) -> Result<AllAccountsResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::AllAccounts variant
Source§async fn marketing_info_async(
&self,
) -> Result<MarketingInfoResponse, CwEnvError>
async fn marketing_info_async( &self, ) -> Result<MarketingInfoResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::MarketingInfo variant
Source§async fn download_logo_async(&self) -> Result<DownloadLogoResponse, CwEnvError>
async fn download_logo_async(&self) -> Result<DownloadLogoResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::DownloadLogo variant
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, Chain> ConditionalMigrate<Chain> for T
impl<T, Chain> ConditionalMigrate<Chain> for T
Source§fn migrate_if_needed(
&self,
migrate_msg: &Self::MigrateMsg,
) -> Result<Option<<Chain as TxHandler>::Response>, CwEnvError>
fn migrate_if_needed( &self, migrate_msg: &Self::MigrateMsg, ) -> Result<Option<<Chain as TxHandler>::Response>, CwEnvError>
Only migrate the contract if it is not on the latest code-id yet
Source§fn upload_and_migrate_if_needed(
&self,
migrate_msg: &Self::MigrateMsg,
) -> Result<Option<Vec<<Chain as TxHandler>::Response>>, CwEnvError>
fn upload_and_migrate_if_needed( &self, migrate_msg: &Self::MigrateMsg, ) -> Result<Option<Vec<<Chain as TxHandler>::Response>>, CwEnvError>
Uploads the contract if the local contract hash is different from the latest on-chain code hash.
Proceeds to migrates the contract if the contract is not running the latest code.
Source§impl<T, Chain> ConditionalUpload<Chain> for Twhere
Chain: CwEnv,
T: CwOrchUpload<Chain>,
impl<T, Chain> ConditionalUpload<Chain> for Twhere
Chain: CwEnv,
T: CwOrchUpload<Chain>,
Source§fn upload_if_needed(
&self,
) -> Result<Option<<Chain as TxHandler>::Response>, CwEnvError>
fn upload_if_needed( &self, ) -> Result<Option<<Chain as TxHandler>::Response>, CwEnvError>
Only upload the contract if it is not uploaded yet (checksum does not match)
Source§fn latest_is_uploaded(&self) -> Result<bool, CwEnvError>
fn latest_is_uploaded(&self) -> Result<bool, CwEnvError>
Returns whether the checksum of the WASM file matches the checksum of the latest uploaded code for this contract.
Source§fn is_running_latest(&self) -> Result<bool, CwEnvError>
fn is_running_latest(&self) -> Result<bool, CwEnvError>
Returns whether the contract is running the latest uploaded code for it
Source§impl<Chain, CwOrchExecuteMsgType, SupportedContract> Cw20ExecuteMsgFns<Chain, CwOrchExecuteMsgType> for SupportedContractwhere
Chain: TxHandler,
Cw20ExecuteMsg: Into<CwOrchExecuteMsgType>,
SupportedContract: CwOrchExecute<Chain, ExecuteMsg = CwOrchExecuteMsgType>,
impl<Chain, CwOrchExecuteMsgType, SupportedContract> Cw20ExecuteMsgFns<Chain, CwOrchExecuteMsgType> for SupportedContractwhere
Chain: TxHandler,
Cw20ExecuteMsg: Into<CwOrchExecuteMsgType>,
SupportedContract: CwOrchExecute<Chain, ExecuteMsg = CwOrchExecuteMsgType>,
Source§fn transfer(
&self,
amount: impl Into<Uint128>,
recipient: impl Into<String>,
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn transfer( &self, amount: impl Into<Uint128>, recipient: impl Into<String>, ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around Cw20ExecuteMsg::Transfer variant
Source§fn burn(
&self,
amount: impl Into<Uint128>,
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn burn( &self, amount: impl Into<Uint128>, ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around Cw20ExecuteMsg::Burn variant
Source§fn send(
&self,
amount: impl Into<Uint128>,
contract: impl Into<String>,
msg: Binary,
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn send( &self, amount: impl Into<Uint128>, contract: impl Into<String>, msg: Binary, ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around Cw20ExecuteMsg::Send variant
Source§fn increase_allowance(
&self,
amount: impl Into<Uint128>,
spender: impl Into<String>,
expires: Option<Expiration>,
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn increase_allowance( &self, amount: impl Into<Uint128>, spender: impl Into<String>, expires: Option<Expiration>, ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around Cw20ExecuteMsg::IncreaseAllowance variant
Source§fn decrease_allowance(
&self,
amount: impl Into<Uint128>,
spender: impl Into<String>,
expires: Option<Expiration>,
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn decrease_allowance( &self, amount: impl Into<Uint128>, spender: impl Into<String>, expires: Option<Expiration>, ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around Cw20ExecuteMsg::DecreaseAllowance variant
Source§fn transfer_from(
&self,
amount: impl Into<Uint128>,
owner: impl Into<String>,
recipient: impl Into<String>,
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn transfer_from( &self, amount: impl Into<Uint128>, owner: impl Into<String>, recipient: impl Into<String>, ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around Cw20ExecuteMsg::TransferFrom variant
Source§fn send_from(
&self,
amount: impl Into<Uint128>,
contract: impl Into<String>,
msg: Binary,
owner: impl Into<String>,
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn send_from( &self, amount: impl Into<Uint128>, contract: impl Into<String>, msg: Binary, owner: impl Into<String>, ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around Cw20ExecuteMsg::SendFrom variant
Source§fn burn_from(
&self,
amount: impl Into<Uint128>,
owner: impl Into<String>,
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn burn_from( &self, amount: impl Into<Uint128>, owner: impl Into<String>, ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around Cw20ExecuteMsg::BurnFrom variant
Source§fn mint(
&self,
amount: impl Into<Uint128>,
recipient: impl Into<String>,
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn mint( &self, amount: impl Into<Uint128>, recipient: impl Into<String>, ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around Cw20ExecuteMsg::Mint variant
Source§fn update_minter(
&self,
new_minter: Option<String>,
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn update_minter( &self, new_minter: Option<String>, ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around Cw20ExecuteMsg::UpdateMinter variant
Source§fn update_marketing(
&self,
description: Option<String>,
marketing: Option<String>,
project: Option<String>,
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn update_marketing( &self, description: Option<String>, marketing: Option<String>, project: Option<String>, ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around Cw20ExecuteMsg::UpdateMarketing variant
Source§fn upload_logo(
&self,
arg0: Logo,
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn upload_logo( &self, arg0: Logo, ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around Cw20ExecuteMsg::UploadLogo variant
Source§impl<T, Chain> CwOrchExecute<Chain> for T
impl<T, Chain> CwOrchExecute<Chain> for T
Source§fn execute(
&self,
execute_msg: &Self::ExecuteMsg,
coins: Option<&[Coin]>,
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn execute( &self, execute_msg: &Self::ExecuteMsg, coins: Option<&[Coin]>, ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Send a ExecuteMsg to the contract.
Source§impl<T, Chain> CwOrchInstantiate<Chain> for T
impl<T, Chain> CwOrchInstantiate<Chain> for T
Source§fn instantiate(
&self,
instantiate_msg: &Self::InstantiateMsg,
admin: Option<&Addr>,
coins: Option<&[Coin]>,
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn instantiate( &self, instantiate_msg: &Self::InstantiateMsg, admin: Option<&Addr>, coins: Option<&[Coin]>, ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Instantiates the contract.
Source§fn instantiate2(
&self,
instantiate_msg: &Self::InstantiateMsg,
admin: Option<&Addr>,
coins: Option<&[Coin]>,
salt: Binary,
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn instantiate2( &self, instantiate_msg: &Self::InstantiateMsg, admin: Option<&Addr>, coins: Option<&[Coin]>, salt: Binary, ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Instantiates the contract using instantiate2
Source§impl<T, Chain> CwOrchMigrate<Chain> for T
impl<T, Chain> CwOrchMigrate<Chain> for T
Source§fn migrate(
&self,
migrate_msg: &Self::MigrateMsg,
new_code_id: u64,
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn migrate( &self, migrate_msg: &Self::MigrateMsg, new_code_id: u64, ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Migrate the contract.
Source§impl<T, Chain> CwOrchQuery<Chain> for T
impl<T, Chain> CwOrchQuery<Chain> for T
Source§fn raw_query(&self, query_keys: Vec<u8>) -> Result<Vec<u8>, CwEnvError>
fn raw_query(&self, query_keys: Vec<u8>) -> Result<Vec<u8>, CwEnvError>
Query the contract raw state from an raw binary key
Source§fn item_query<T>(&self, query_item: Item<'_, T>) -> Result<T, CwEnvError>where
T: Serialize + DeserializeOwned,
fn item_query<T>(&self, query_item: Item<'_, T>) -> Result<T, CwEnvError>where
T: Serialize + DeserializeOwned,
Query the contract raw state from an cw-storage-plus::Item
Source§impl<T, Chain> CwOrchUpload<Chain> for T
impl<T, Chain> CwOrchUpload<Chain> for T
Source§impl<Chain, T> Environment<Chain> for T
impl<Chain, T> Environment<Chain> for T
Source§fn environment(&self) -> &Chain
fn environment(&self) -> &Chain
Returns the chain that this structure executes on
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<Chain, CwOrchQueryMsgType, SupportedContract> QueryMsgFns<Chain, CwOrchQueryMsgType> for SupportedContractwhere
Chain: QueryHandler + ChainState,
QueryMsg: Into<CwOrchQueryMsgType>,
SupportedContract: CwOrchQuery<Chain, QueryMsg = CwOrchQueryMsgType>,
impl<Chain, CwOrchQueryMsgType, SupportedContract> QueryMsgFns<Chain, CwOrchQueryMsgType> for SupportedContractwhere
Chain: QueryHandler + ChainState,
QueryMsg: Into<CwOrchQueryMsgType>,
SupportedContract: CwOrchQuery<Chain, QueryMsg = CwOrchQueryMsgType>,
Source§fn balance(
&self,
address: impl Into<String>,
) -> Result<BalanceResponse, CwEnvError>
fn balance( &self, address: impl Into<String>, ) -> Result<BalanceResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::Balance variant
Source§fn token_info(&self) -> Result<TokenInfoResponse, CwEnvError>
fn token_info(&self) -> Result<TokenInfoResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::TokenInfo variant
Source§fn minter(&self) -> Result<MinterResponse, CwEnvError>
fn minter(&self) -> Result<MinterResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::Minter variant
Source§fn allowance(
&self,
owner: impl Into<String>,
spender: impl Into<String>,
) -> Result<AllowanceResponse, CwEnvError>
fn allowance( &self, owner: impl Into<String>, spender: impl Into<String>, ) -> Result<AllowanceResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::Allowance variant
Source§fn all_allowances(
&self,
owner: impl Into<String>,
limit: Option<u32>,
start_after: Option<String>,
) -> Result<AllAllowancesResponse, CwEnvError>
fn all_allowances( &self, owner: impl Into<String>, limit: Option<u32>, start_after: Option<String>, ) -> Result<AllAllowancesResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::AllAllowances variant
Source§fn all_spender_allowances(
&self,
spender: impl Into<String>,
limit: Option<u32>,
start_after: Option<String>,
) -> Result<AllSpenderAllowancesResponse, CwEnvError>
fn all_spender_allowances( &self, spender: impl Into<String>, limit: Option<u32>, start_after: Option<String>, ) -> Result<AllSpenderAllowancesResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::AllSpenderAllowances variant
Source§fn all_accounts(
&self,
limit: Option<u32>,
start_after: Option<String>,
) -> Result<AllAccountsResponse, CwEnvError>
fn all_accounts( &self, limit: Option<u32>, start_after: Option<String>, ) -> Result<AllAccountsResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::AllAccounts variant
Source§fn marketing_info(&self) -> Result<MarketingInfoResponse, CwEnvError>
fn marketing_info(&self) -> Result<MarketingInfoResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::MarketingInfo variant
Source§fn download_logo(&self) -> Result<DownloadLogoResponse, CwEnvError>
fn download_logo(&self) -> Result<DownloadLogoResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::DownloadLogo variant