[][src]Attribute Macro cosmwasm_std::entry_point

#[entry_point]

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 init(
    deps: DepsMut,
    env: Env,
    info: MessageInfo,
    msg: InitMsg,
) -> Result<InitResponse, StdError> {
}

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

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

where InitMsg, HandleMsg, and QueryMsg are contract defined types that implement DeserializeOwned + JsonSchema.

This is an alternative implementation of cosmwasm_std::create_entry_points!(contract) and cosmwasm_std::create_entry_points_with_migration!(contract) and should not be used together.