2 releases

0.2.6 Feb 6, 2022
0.2.5 Feb 3, 2022

#4 in #queried

Download history 115/week @ 2023-12-15 32/week @ 2023-12-22 54/week @ 2023-12-29 57/week @ 2024-01-05 11/week @ 2024-01-12 3/week @ 2024-01-19 31/week @ 2024-01-26 69/week @ 2024-02-02 31/week @ 2024-02-09 24/week @ 2024-02-16 37/week @ 2024-02-23 28/week @ 2024-03-01 29/week @ 2024-03-08 48/week @ 2024-03-15 141/week @ 2024-03-22 62/week @ 2024-03-29

283 downloads per month
Used in 2 crates (via dao-testing)

Apache-2.0

49KB
1K SLoC

Stake CW20

This is a basic implementation of a cw20 staking contract. Staked tokens can be unbonded with a configurable unbonding period. Staked balances can be queried at any arbitrary height by external contracts.

Running this contract

You will need Rust 1.58.1+ with wasm32-unknown-unknown target installed.

You can run unit tests on this via:

cargo test

Once you are happy with the content, you can compile it to wasm via:

RUSTFLAGS='-C link-arg=-s' cargo wasm
cp ../../target/wasm32-unknown-unknown/release/stake_cw20.wasm .
ls -l stake_cw20.wasm
sha256sum stake_cw20.wasm

Or for a production-ready (optimized) build, run a build command in the the repository root: https://github.com/CosmWasm/cw-plus#compiling.

Dependencies

~4–5.5MB
~123K SLoC