This repository consists of libraries for writing and testing smart contracts for the Concordium blockchain in the Rust programming language. It also contains some sample smart contracts. The core library is concordium-std, and the testing library is concordium-smart-contract-testing.
The core library provides procedural macros to reduce the amount of boilerplate the user needs to write,
while the concordium-std library exposes a high-level API that smart contract
writers can use when writing contracts, alleviating them from the need to deal
with low-level details of how the interaction with the chain works.
concordium-stdprior to version 3 supported version 0 contractsconcordium-stdversion 3 only supports building version 1 contracts
concordium-stdversion 4 only works withcargo-concordiumversion 2.1+.concordium-stdversion 5 only works withcargo-concordiumversion 2.4+.
The examples directory contains some smart contracts that are used to test the standard library.
These contracts are not meant for production, they are used to illustrate how to use the standard library and the tooling Concordium provides. There is no claim that the logic of the contract is reasonable, or safe.
Do not use these contracts as-is for anything other then experimenting.
The repository has
concordium-rust-sdk
as a submodule, and testing and builds are set-up to use the submodule version.
When changes are made in concordium-rust-sdk they should be propagated
to this repository.
This repository's CI automatically checks formatting and common problems in rust. Changes to any of the packages must be such that
cargo clippy --allproduces no warningsrustfmtmakes no changes.
Everything in this repository should build with rust version 1.67 however the fmt tool must be from a nightly release since some of the configuration options are not stable. One way to run the fmt tool is
cargo fmt
In order to contribute you should make a pull request and ask at least two people familiar with the code to do a review.