To start using the DAO contracts you need to have:
-
Rust
toolchain installed (see rustup.rs), -
wasmstrip
tool installed (see wabt). -
cargo odra
installedcargo install cargo-odra
-
just
tool installed (see just). -
The
wasmstrip
tool is used to reduce the size of the compiled contracts. It is not required, but it is recommended if you want to deploy the contracts to the Casper network.
As the contracts are compiled to WASM
files,
you need to have wasm32-unknown-unknown
target installed. To install it execute:
rustup target add wasm32-unknown-unknown
or use the recipe in the Justfile
:
just prepare
To build the contracts located in the dao-contracts
folder, execute cargo odra build
:
cargo odra build -b casper
or use the recipe in the Makefile
:
just build-dao-contracts
It will also run wasm-strip on the compiled wasm files.
We can run the tests for the contracts:
cargo odra test -b casper
Or use the MockVM for faster tests:
cargo odra test
Of course, all of the above can be done with the Jusfile
:
just test
You can also pass additional information, to filter the tests:
cargo odra test -- --test test_bid_escrow