concordium-std 0.1.0

A standard library for writing smart contracts for the Concordium blockchain in Rust.
Documentation

This library provides the core API that can be used to write smart contracts for the Concordium blockchain. It aims to provide safe wrappers around the core primitives exposed by the chain and accessible to smart contracts.

By default the library will be linked with the std crate, the rust standard library, however to minimize code size this library supports toggling compilation with the #![no_std] attribute via the feature std which is enabled by default. Compilation without the std feature requires a nightly version of rust.

To use this library without the std feature you have to disable it, which can be done, for example, as follows.

[dependencies.concordium-sc-base]
default-features = false

In your project's Cargo.toml file.

The library is meant to be used as a standard library for developing smart contracts. For this reason it re-exports a number of definitions from other libraries.

Global allocator.

Importing this library has a side-effect of setting the allocator to wee_alloc which is a memory allocator aimed at small code footprint. This allocator is designed to be used in contexts where there are a few large allocations up-front, and the memory later used during the lifetime of the program. Frequent small allocations will have bad performance, and should be avoided.

Panic handler

When compiled without the std feature this crate sets the panic handler to a no-op.