2 releases

0.2.6 Feb 6, 2022
0.2.5 Feb 3, 2022

#5 in #queried

Download history 193/week @ 2024-07-29 59/week @ 2024-08-05 273/week @ 2024-08-12 4/week @ 2024-08-26 24/week @ 2024-09-02 83/week @ 2024-09-09 57/week @ 2024-09-16 74/week @ 2024-09-23 43/week @ 2024-09-30 44/week @ 2024-10-07 140/week @ 2024-10-14 25/week @ 2024-10-21 157/week @ 2024-10-28 45/week @ 2024-11-04 21/week @ 2024-11-11

250 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–6MB
~129K SLoC