47 releases (29 major breaking)

31.0.0 Mar 18, 2024
30.0.0 Feb 26, 2024
29.0.0 Feb 13, 2024
28.0.0 Jan 23, 2024
2.0.0-alpha.5 Mar 24, 2020

#1314 in Magic Beans

Download history 906/week @ 2023-12-07 565/week @ 2023-12-14 184/week @ 2023-12-21 330/week @ 2023-12-28 1275/week @ 2024-01-04 741/week @ 2024-01-11 666/week @ 2024-01-18 697/week @ 2024-01-25 686/week @ 2024-02-01 1249/week @ 2024-02-08 1915/week @ 2024-02-15 2174/week @ 2024-02-22 1187/week @ 2024-02-29 920/week @ 2024-03-07 1844/week @ 2024-03-14 1593/week @ 2024-03-21

5,850 downloads per month
Used in 69 crates (6 directly)

Apache-2.0

2MB
37K SLoC

Vesting Module

Overview

A simple module providing a means of placing a linear curve on an account's locked balance. This module ensures that there is a lock in place preventing the balance to drop below the unvested amount for reason other than the ones specified in UnvestedFundsAllowedWithdrawReasons configuration value.

As the amount vested increases over time, the amount unvested reduces. However, locks remain in place and explicit action is needed on behalf of the user to ensure that the amount locked is equivalent to the amount remaining to be vested. This is done through a dispatchable function, either vest (in typical case where the sender is calling on their own behalf) or vest_other in case the sender is calling on another account's behalf.

Interface

This module implements the VestingSchedule trait.

Dispatchable Functions

  • vest - Update the lock, reducing it in line with the amount "vested" so far.
  • vest_other - Update the lock of another account, reducing it in line with the amount "vested" so far.

License: Apache-2.0

Dependencies

~17–36MB
~605K SLoC