31 releases (18 major breaking)

new 20.0.0 Mar 26, 2023
19.0.0 Mar 5, 2023
18.0.0 Feb 26, 2023
17.0.0 Feb 19, 2023
2.0.0-alpha.5 Mar 24, 2020

#1111 in Magic Beans

Download history 27/week @ 2022-12-06 157/week @ 2022-12-13 60/week @ 2022-12-20 11/week @ 2022-12-27 24/week @ 2023-01-03 76/week @ 2023-01-10 72/week @ 2023-01-17 41/week @ 2023-01-24 78/week @ 2023-01-31 49/week @ 2023-02-07 89/week @ 2023-02-14 52/week @ 2023-02-21 35/week @ 2023-02-28 25/week @ 2023-03-07 71/week @ 2023-03-14 31/week @ 2023-03-21

169 downloads per month

Apache-2.0

2MB
36K 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

~8–43MB
~743K SLoC