Trait Contract

Source
pub trait Contract<C, Q = Empty>
where C: CustomMsg, Q: CustomQuery,
{ // Required methods fn instantiate( &self, deps: DepsMut<'_, Q>, env: Env, info: MessageInfo, msg: Vec<u8>, ) -> StdResult<Response<C>>; fn execute( &self, deps: DepsMut<'_, Q>, env: Env, info: MessageInfo, msg: Vec<u8>, ) -> StdResult<Response<C>>; fn query( &self, deps: Deps<'_, Q>, env: Env, msg: Vec<u8>, ) -> StdResult<Binary>; fn reply( &self, deps: DepsMut<'_, Q>, env: Env, msg: Reply, ) -> StdResult<Response<C>>; fn sudo( &self, deps: DepsMut<'_, Q>, env: Env, msg: Vec<u8>, ) -> StdResult<Response<C>>; fn migrate( &self, deps: DepsMut<'_, Q>, env: Env, msg: Vec<u8>, info: MigrateInfo, ) -> StdResult<Response<C>>; // Provided method fn checksum(&self) -> Option<Checksum> { ... } }
Expand description

This trait serves as a primary interface for interacting with smart contracts.

Required Methods§

Source

fn instantiate( &self, deps: DepsMut<'_, Q>, env: Env, info: MessageInfo, msg: Vec<u8>, ) -> StdResult<Response<C>>

Evaluates contract’s instantiate entry-point.

Source

fn execute( &self, deps: DepsMut<'_, Q>, env: Env, info: MessageInfo, msg: Vec<u8>, ) -> StdResult<Response<C>>

Evaluates contract’s execute entry-point.

Source

fn query(&self, deps: Deps<'_, Q>, env: Env, msg: Vec<u8>) -> StdResult<Binary>

Evaluates contract’s query entry-point.

Source

fn reply( &self, deps: DepsMut<'_, Q>, env: Env, msg: Reply, ) -> StdResult<Response<C>>

Evaluates contract’s reply entry-point.

Source

fn sudo( &self, deps: DepsMut<'_, Q>, env: Env, msg: Vec<u8>, ) -> StdResult<Response<C>>

Evaluates contract’s sudo entry-point.

Source

fn migrate( &self, deps: DepsMut<'_, Q>, env: Env, msg: Vec<u8>, info: MigrateInfo, ) -> StdResult<Response<C>>

Evaluates contract’s migrate entry-point.

Provided Methods§

Source

fn checksum(&self) -> Option<Checksum>

Returns the provided checksum of the contract’s Wasm blob.

Implementors§

Source§

impl<T1, T2, T3, E1, E2, E3, C, T4, E4, E5, T6, E6, Q> Contract<C, Q> for ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, T4, E4, E5, T6, E6>
where T1: DeserializeOwned, T2: DeserializeOwned, T3: DeserializeOwned, T4: DeserializeOwned, T6: DeserializeOwned, E1: Display + Debug + Send + Sync + 'static, E2: Display + Debug + Send + Sync + 'static, E3: Display + Debug + Send + Sync + 'static, E4: Display + Debug + Send + Sync + 'static, E5: Display + Debug + Send + Sync + 'static, E6: Display + Debug + Send + Sync + 'static, C: CustomMsg, Q: CustomQuery + DeserializeOwned,