|Jun 25, 2022
#13 in #eosio
cargo-eosiocontractis a CLI tool which helps you develop EOS smart contracts.
rustup component add rust-src.
Step 2: Install
binaryenin a version >= 99:
apt-get install binaryen
brew install binaryen
- Arch Linux:
pacman -S binaryen
- Windows: binary releases are available
There's only an old version in your distributions package manager? Just use a binary release.
cargo install --force cargo-eosiocontract.
You can always use
cargo eosiocontract help to print information on available
commands and their usage.
For each command there is also a
--help flag with info on additional parameters,
cargo eosiocontract new --help.
cargo eosiocontract new my_contract
Creates an initial smart contract with some scaffolding code into a new
The contract contains the source code for the
contract, which is about the simplest "smart" contract you can build ‒ a
bool which gets flipped
false through the
cargo +nightly contract build
Compiles the contract into optimized WebAssembly bytecode, generates metadata for it,
and bundles both together in a
<name>.contract file, which you can use for
deploying the contract on-chain.
cargo eosiocontract build must be run using the
nightly toolchain. If you have
rustup installed, the simplest way to
do so is
cargo +nightly contract build.
To avoid having to always add
+nightly you can also set
nightly as the default
toolchain of a directory by executing
rustup override set nightly in it.
cargo eosiocontract check
Checks that the code builds as WebAssembly. This command does not output any
artifact to the
The entire code within this repository is licensed under the GPLv3.