7 stable releases

new 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

#573 in Magic Beans

Download history 341/week @ 2024-07-16 180/week @ 2024-07-23 46/week @ 2024-07-30 128/week @ 2024-08-06 303/week @ 2024-08-13 201/week @ 2024-08-20 10/week @ 2024-08-27 10/week @ 2024-09-03 18/week @ 2024-09-10 12/week @ 2024-09-17 41/week @ 2024-09-24 14/week @ 2024-10-01 4/week @ 2024-10-08 8/week @ 2024-10-15 1/week @ 2024-10-22 140/week @ 2024-10-29

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

BSD-3-Clause

42KB
726 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

~5–6.5MB
~144K SLoC