pub trait Contract: Send + Sync + Debug + Display + FromStr<Err = ParseError> + IntoEnumIterator + 'static {
    // Required methods
    fn name(&self) -> String;
    fn admin(&self) -> String;
    fn instantiate_msg(&self) -> Option<Box<dyn Msg>>;

    // Provided methods
    fn bin_name(&self) -> String { ... }
    fn execute(&self) -> Result<Box<dyn Msg>> { ... }
    fn query(&self) -> Result<Box<dyn Msg>> { ... }
    fn cw20_send(&self) -> Result<Box<dyn Msg>> { ... }
    fn external_instantiate_msgs(
        &self
    ) -> Vec<ExternalInstantiate<Box<dyn Msg>>> { ... }
    fn migrate_msg(&self) -> Option<Box<dyn Msg>> { ... }
    fn set_config_msg(&self) -> Option<Box<dyn Msg>> { ... }
    fn set_up_msgs(&self) -> Vec<Box<dyn Msg>> { ... }
    fn path(&self) -> PathBuf { ... }
}
Expand description

This trait represents a contract that can be deployed.

Required Methods§

source

fn name(&self) -> String

This is the name of the contract and represents how it will appear in the cli.

source

fn admin(&self) -> String

This is the address of the contract admin. It is required when instantiating.

source

fn instantiate_msg(&self) -> Option<Box<dyn Msg>>

This method gets the preprogrammed instantiate msg for the contract.

Provided Methods§

source

fn bin_name(&self) -> String

This is the name of the generated binary. It defaults to the contract name. If you have multiple contracts that share the same code then you can use this, in conjunction with the path method.

source

fn execute(&self) -> Result<Box<dyn Msg>>

This method allows executing a contract. interactive-parse should be used to generate the msg.

source

fn query(&self) -> Result<Box<dyn Msg>>

This method allows querying a contract. interactive-parse should be used to generate the msg.

source

fn cw20_send(&self) -> Result<Box<dyn Msg>>

This method allows sending a cw20 token with an attached message to a contract. interactive-parse should be used to generate the msg.

source

fn external_instantiate_msgs(&self) -> Vec<ExternalInstantiate<Box<dyn Msg>>>

This method will instantiate an external contract via code_id alongside a local contract.

source

fn migrate_msg(&self) -> Option<Box<dyn Msg>>

This method gets the preprogrammed migrate msg for the contract.

source

fn set_config_msg(&self) -> Option<Box<dyn Msg>>

This method gets the preprogrammed set config msg for the contract.

source

fn set_up_msgs(&self) -> Vec<Box<dyn Msg>>

This method gets the preprogrammed set up for the contract.

source

fn path(&self) -> PathBuf

This method allows for customizing the path to the contract. This should be the path relative to the project root.

Implementors§