Those contracts are made for development purpose only. For more realistic example contracts, see cosmwasm-examples.
Introducing the development contracts in the order they were created.
- hackatom is the very first development contract that was created at a Cosmos Hackatom in Berlin in 2019, the event where CosmWasm was born. It is a very basic escrow contract. During the years of CosmWasm development, many more test cases were hacked into it.
- queue shows and tests the newly added iterator support (#181).
- reflect is an evolution of the mask contract, which allows the user to send messages to the contract which are then emitted with the contract as the sender. It later got support to handle sub messages and replys (#796).
- staking is a staking derivates example showing how the contract itself can be a delegator.
- burner shows how contract migrations work, which were added in CosmWasm 0.9 (#413). It shuts down the contract my clearing all state and sending all tokens to a given address.
- ibc-reflect/ibc-reflect-send are inspired by the idea of Interchain Accounts and demonstrate the power of contract to contract IBC. ibc-reflect-send receives a message on chain A and sends it to an ibc-reflect instance on chain B where the message is executed.
- crypto-verify shows how to use the CosmWasm crypto APIs for signature verification (#783).
- floaty emits float operations when compiled to Wasm and allows us to test how tooling and the runtime deal with those operations (#970).
- cyberpunk is an attempt to cleanup hackatom and make writing runtime tests (cosmwasm-vm/wamsmvm) easier by avoid the need for the escrow setup that hackatom has.
Those development contracts are used for testing in other repos, e.g. in wasmvm or cosmjs.
They are built and deployed by the CI for every release tag. In case you need to build them manually for some reason, use the following commands:
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="devcontract_cache_burner",target=/code/contracts/burner/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.12.9 ./contracts/burner
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="devcontract_cache_crypto_verify",target=/code/contracts/crypto-verify/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.12.9 ./contracts/crypto-verify
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="devcontract_cache_floaty",target=/code/contracts/floaty/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.12.9 ./contracts/floaty
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="devcontract_cache_hackatom",target=/code/contracts/hackatom/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.12.9 ./contracts/hackatom
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="devcontract_cache_ibc_reflect",target=/code/contracts/ibc-reflect/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.12.9 ./contracts/ibc-reflect
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="devcontract_cache_ibc_reflect_send",target=/code/contracts/ibc-reflect-send/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.12.9 ./contracts/ibc-reflect-send
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="devcontract_cache_queue",target=/code/contracts/queue/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.12.9 ./contracts/queue
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="devcontract_cache_reflect",target=/code/contracts/reflect/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.12.9 ./contracts/reflect
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="devcontract_cache_staking",target=/code/contracts/staking/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.12.9 ./contracts/staking
The development contracts in this folder contain a variety of different entry points in order to demonstrate and test the flexibility we have.
Contract | Has query |
Has migrate |
---|---|---|
burner | no | yes |
hackatom | yes | yes |
ibc-reflect | yes | no |
queue | yes | yes |
reflect | yes | no |
staking | yes | no |