Modules

Structs

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.

A SHA-256 checksum of a Wasm blob, used to identify a Wasm code. This must remain stable since this checksum is stored in the blockchain state.

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.

Enums

An error in the communcation between contract and host. Those happen around imports and exports.

An error validating a Region

Traits

Callbacks to system functions defined outside of the wasm modules. This is a trait to allow Mocks in the test code.

Access to the VM’s backend storage, i.e. the chain

Functions

Calls Wasm export “execute” and returns raw data from the contract. The result is length limited to prevent abuse but otherwise unchecked.

Calls Wasm export “instantiate” and returns raw data from the contract. The result is length limited to prevent abuse but otherwise unchecked.

Calls Wasm export “migrate” and returns raw data from the contract. The result is length limited to prevent abuse but otherwise unchecked.

Calls Wasm export “query” and returns raw data from the contract. The result is length limited to prevent abuse but otherwise unchecked.

Calls Wasm export “reply” and returns raw data from the contract. The result is length limited to prevent abuse but otherwise unchecked.

Calls Wasm export “sudo” and returns raw data from the contract. The result is length limited to prevent abuse but otherwise unchecked.

Takes a comma-separated string, splits it by commas, removes empty elements and returns a set of features. This can be used e.g. to initialize the cache.

Deserializes JSON data into a document of type T.

Type Definitions

A result type for calling into the backend. Such a call can cause non-negligible computational cost in both success and faiure case and must always have gas information attached.