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

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

#6 in #queried

Download history 62/week @ 2024-07-26 250/week @ 2024-08-02 343/week @ 2024-08-09 56/week @ 2024-08-16 16/week @ 2024-08-23 15/week @ 2024-08-30 154/week @ 2024-09-06 76/week @ 2024-09-13 87/week @ 2024-09-20 42/week @ 2024-09-27 44/week @ 2024-10-04 226/week @ 2024-10-11 86/week @ 2024-10-18 191/week @ 2024-10-25 112/week @ 2024-11-01 78/week @ 2024-11-08

554 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
~130K SLoC