#balance #token #height #queried #cw20 #staked #external

stake-cw20-external-rewards

CW20 token that can be staked and staked balance can be queried at any height

1 unstable release

0.2.6 Jul 3, 2023

#5 in #queried

Download history 60/week @ 2024-04-07 59/week @ 2024-04-14 58/week @ 2024-04-21 32/week @ 2024-04-28 41/week @ 2024-05-05 61/week @ 2024-05-12 241/week @ 2024-05-19 48/week @ 2024-05-26 157/week @ 2024-06-02 47/week @ 2024-06-09 244/week @ 2024-06-16 113/week @ 2024-06-23 90/week @ 2024-06-30 92/week @ 2024-07-07 330/week @ 2024-07-14 434/week @ 2024-07-21

948 downloads per month
Used in cw20-stake-external-rewar…

Apache-2.0

82KB
2K 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