Attribute Macro cosmwasm_std::entry_point

source ·
#[entry_point]
Expand description

This attribute macro generates the boilerplate required to call into the contract-specific logic from the entry-points to the Wasm module.

It should be added to the contract’s init, handle, migrate and query implementations like this:


#[entry_point]
pub fn instantiate(
    deps: DepsMut,
    env: Env,
    info: MessageInfo,
    msg: InstantiateMsg,
) -> Result<Response, StdError> {
}

#[entry_point]
pub fn execute(
    deps: DepsMut,
    env: Env,
    info: MessageInfo,
    msg: ExecuteMsg,
) -> Result<Response, StdError> {
}

#[entry_point]
pub fn query(
    deps: Deps,
    env: Env,
    msg: QueryMsg,
) -> Result<QueryResponse, StdError> {
}

where InstantiateMsg, ExecuteMsg, and QueryMsg are contract defined types that implement DeserializeOwned + JsonSchema.