cw721_basic/
lib.rs

1mod contract_tests;
2mod error;
3mod execute;
4pub mod msg;
5mod query;
6pub mod state;
7
8pub use crate::error::ContractError;
9pub use crate::msg::{ExecuteMsg, InstantiateMsg, MintMsg, MinterResponse, QueryMsg};
10pub use crate::state::Cw721Contract;
11use cosmwasm_std::Empty;
12
13// This is a simple type to let us handle empty extensions
14pub type Extension = Option<Empty>;
15
16#[cfg(not(feature = "library"))]
17pub mod entry {
18    use super::*;
19
20    use cosmwasm_std::entry_point;
21    use cosmwasm_std::{Binary, Deps, DepsMut, Env, MessageInfo, Response, StdResult};
22
23    // This makes a conscious choice on the various generics used by the contract
24    #[entry_point]
25    pub fn instantiate(
26        deps: DepsMut,
27        env: Env,
28        info: MessageInfo,
29        msg: InstantiateMsg,
30    ) -> StdResult<Response> {
31        let tract = Cw721Contract::<Extension, Empty>::default();
32        tract.instantiate(deps, env, info, msg)
33    }
34
35    #[entry_point]
36    pub fn execute(
37        deps: DepsMut,
38        env: Env,
39        info: MessageInfo,
40        msg: ExecuteMsg<Extension>,
41    ) -> Result<Response, ContractError> {
42        let tract = Cw721Contract::<Extension, Empty>::default();
43        tract.execute(deps, env, info, msg)
44    }
45
46    #[entry_point]
47    pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult<Binary> {
48        let tract = Cw721Contract::<Extension, Empty>::default();
49        tract.query(deps, env, msg)
50    }
51}