8 stable releases (3 major)
|Jan 22, 2024
|Oct 18, 2023
|Aug 21, 2023
|Jun 16, 2023
|Feb 3, 2023
#2421 in Magic Beans
944 downloads per month
Used in 3 crates (2 directly)
A library that provides an implementation of execution of smart contracts on top
concordium-wasm library that implements the underlying Wasm execution.
In particular this library is used by the Concordium node to execute both V0 and V1 smart contracts. It is also used by other Concordium tools, such as cargo-concordium, to provide build and test functionality.
This crate follows semantic versioning guidelines. Change in minimum supported rust version will be accompanied by a minor version increase.
This library provides functionality that builds on top of the Wasm engine and adds high-level functions for executing smart contracts on the Concordium chain.
Concordium supports two versions of smart contracts, the legacy [
version and the [
v1] version. The latter is essentially better in
every way. They differ in two main ways
v0] uses message passing for inter-contract communication, and has a flat state. The state is limited to 16kB and the entire state is written every time a contract update is done.
v1] uses synchronous calls for inter-contract communication, and its state is a trie-based structure, which supports efficient partial state updates. The trie is implemented in the
v0] and [
v1] modules are structured similarly. The main
entrypoints used by users of this library are
v1::invoke_receive) functions, and their variants.
The respective modules provide more details on the data types involved, and any specifics of the different versions.
This crate has the following features. None are enabled by default.
This feature exposes the function
display_tree for displaying the
V1 contract state in a reasonably readable format. This is useful for deep
inspection of smart contract state, and debugging.
Exposes construction of smart contract state from streams of key-value pairs, such as those received from the node's API. See
This enables foreign function exports. This is an internal feature and there are no guarantees about the stability of foreign exports.
These features are also internal and exist to support fuzzing. They are used to derive Arbitrary instances and to disable inlining, the latter is necessary since the fuzzer used has bugs which prevent the coverage report being generated when functions are inlined.