Expand description
CosmWasm is a smart contract platform for the Cosmos ecosystem. This crate provides VM bindings to run CosmWasm contracts.
For more information, see: https://cosmwasm.cosmos.network
Modules§
Structs§
- Analysis
Report - Backend
- Holds all external dependencies of the contract. Designed to allow easy dependency injection at runtime. This cannot be copied or cloned since it would behave differently for mock storages and a bridge storage in the VM.
- Cache
- Cache
Options - Config
- Various configurations for the VM.
- Debug
Info - Additional environmental information in a debug call.
- GasInfo
- A structure that represents gas cost to be deducted from the remaining gas. This is always needed when computations are performed outside of Wasm execution, such as calling crypto APIs or calls into the blockchain.
- GasReport
- Instance
- Instance
Options - Metrics
- PerModule
Metrics - Pinned
Metrics - Size
- Stats
- Statistics about the usage of a cache instance. Those values are node specific and must not be used in a consensus critical context. When a node is hit by a client for simulations or other queries, hits and misses increase. Also a node restart will reset the values.
- Wasm
Limits - Limits for static validation of Wasm files. These are checked before storing the Wasm file. All limits are optional because they are coming from the Go-side and have default values.
Enums§
- Backend
Error - Communication
Error - An error in the communication between contract and host. Those happen around imports and exports.
- Region
Validation Error - An error validating a Region
- VmError
Traits§
- Backend
Api - Callbacks to system functions defined outside of the wasm modules. This is a trait to allow Mocks in the test code.
- Querier
- Storage
- Access to the VM’s backend storage, i.e. the chain
Functions§
- call_
execute - call_
execute_ raw - Calls Wasm export “execute” and returns raw data from the contract. The result is length limited to prevent abuse but otherwise unchecked.
- call_
ibc_ destination_ callback - call_
ibc_ destination_ callback_ raw - call_
ibc_ source_ callback - call_
ibc_ source_ callback_ raw - call_
instantiate - call_
instantiate_ raw - Calls Wasm export “instantiate” and returns raw data from the contract. The result is length limited to prevent abuse but otherwise unchecked.
- call_
migrate - call_
migrate_ raw - Calls Wasm export “migrate” and returns raw data from the contract. The result is length limited to prevent abuse but otherwise unchecked.
- call_
migrate_ with_ info - call_
migrate_ with_ info_ raw - Calls Wasm export “migrate” and returns raw data from the contract.
The result is length limited to prevent abuse but otherwise unchecked.
The difference between this function and call_migrate_raw is the
additional argument -
migrate_info
. It contains additional data related to the contract’s migration procedure. - call_
query - call_
query_ raw - Calls Wasm export “query” and returns raw data from the contract. The result is length limited to prevent abuse but otherwise unchecked.
- call_
reply - call_
reply_ raw - Calls Wasm export “reply” and returns raw data from the contract. The result is length limited to prevent abuse but otherwise unchecked.
- call_
sudo - call_
sudo_ raw - Calls Wasm export “sudo” and returns raw data from the contract. The result is length limited to prevent abuse but otherwise unchecked.
- capabilities_
from_ csv - Takes a comma-separated string, splits it by commas, removes empty elements and returns a set of capabilities. This can be used e.g. to initialize the cache.
- from_
slice - Deserializes JSON data into a document of type
T
. - to_vec
Type Aliases§
- Backend
Result - A result type for calling into the backend. Such a call can cause non-negligible computational cost in both success and failure case and must always have gas information attached.
- Communication
Result - Region
Validation Result - VmResult