cw4_stake/
lib.rs

1/*!
2This is a second implementation of the [cw4 spec](https://github.com/CosmWasm/cw-plus/blob/main/packages/cw4/README.md).
3It fulfills all elements of the spec, including the raw query lookups,
4and is designed to be used as a backing storage for
5[cw3 compliant contracts](https://github.com/CosmWasm/cw-plus/blob/main/packages/cw3/README.md).
6
7It provides a similar API to [`cw4-group`](https://github.com/CosmWasm/cw-plus/blob/main/contracts/cw4-group/README.md)
8(which handles elected membership),
9but rather than appointing members (by admin or multisig), their
10membership and weight are based on the number of tokens they have staked.
11This is similar to many DAOs.
12
13Only one denom can be bonded with both `min_bond` as the minimum amount
14that must be sent by one address to enter, as well as `tokens_per_weight`,
15which can be used to normalize the weight (eg. if the token is uatom
16and you want 1 weight per ATOM, you can set `tokens_per_weight = 1_000_000`).
17
18There is also an unbonding period (`Duration`) which sets how long the
19tokens are frozen before being released. These frozen tokens can neither
20be used for voting, nor claimed by the original owner. Only after the period
21can you get your tokens back. This liquidity loss is the "skin in the game"
22provided by staking to this contract.
23
24For more information on this contract, please check out the
25[README](https://github.com/CosmWasm/cw-plus/blob/main/contracts/cw4-stake/README.md).
26*/
27
28pub mod contract;
29mod error;
30pub mod msg;
31pub mod state;
32
33pub use crate::error::ContractError;