cosmwasm-zero-to-hero
cosmwasm-zero-to-hero copied to clipboard
Why do we always pass env around?
env
is always passed from execute
and query
to the specific execute / query functions, but barely used. Can we just skip passing env
?
We can not skip passing it. Because you have to comply with the interface. env
includes:
pub struct Env {
pub block: BlockInfo,
pub transaction: Option<TransactionInfo>,
pub contract: ContractInfo,
}
If you wish, you can use them in your smart contract.