Context
Sylvia exposes context types to wrap the Deps/DepsMut
,
Env
, and MessageInfo
types received in the contract entrypoints.
Those types are:
💡
Use the above context types in contract message methods.
Usage
Example instantiate method:
use sylvia::types::InstantiateCtx;
#[sv::msg(instantiate)]
fn instantiate(&self, ctx: InstantiateCtx, mutable: bool) -> StdResult<Response> {
let InstantiateCtx { deps, env, info } = ctx;
// ...
}