7 stable releases

2.6.0 Nov 7, 2024
2.5.0 Oct 31, 2024
2.4.2 Jul 22, 2024
2.3.0 Oct 18, 2023
2.2.0 Jul 9, 2023

#801 in Magic Beans

Download history 133/week @ 2024-08-02 212/week @ 2024-08-09 294/week @ 2024-08-16 15/week @ 2024-08-23 11/week @ 2024-08-30 15/week @ 2024-09-06 11/week @ 2024-09-13 26/week @ 2024-09-20 31/week @ 2024-09-27 6/week @ 2024-10-04 9/week @ 2024-10-11 3/week @ 2024-10-18 109/week @ 2024-10-25 71/week @ 2024-11-01 120/week @ 2024-11-08 85/week @ 2024-11-15

385 downloads per month
Used in 4 crates (via cw-vesting)

BSD-3-Clause

42KB
725 lines

Stake Tracker

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.

Dependencies

~4–6MB
~122K SLoC