Attribute Macro cosmwasm_std::entry_point [−][src]
#[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 handle(
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
.
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.