| Crates.io | cw-stake-tracker |
| lib.rs | cw-stake-tracker |
| version | 2.6.0 |
| created_at | 2023-07-03 12:05:50.012621+00 |
| updated_at | 2024-11-07 23:38:24.985365+00 |
| description | A package for tracking staked and unbonding tokens in x/staking. |
| homepage | |
| repository | https://github.com/DA0-DA0/dao-contracts |
| max_upload_size | |
| id | 906942 |
| size | 25,809 |
This is a CosmWasm package for tracking the staked balance of a smart contract.
The StakeTracker type here exposes a couple methods with the on_
prefix. These should be called whenever the contract performs an
action with x/staking. For example, when the contract delegates
tokens, it should call the on_delegate method to register that. Not
calling the method will cause the package to incorrectly track staked
values.
See
cw-vesting
for an example of integrating this package into a smart contract and a
discussion of how to handle slash events.