53 releases (35 major breaking)

37.0.0 Jul 18, 2024
36.0.0 Jul 12, 2024
35.0.0 Jun 24, 2024
34.0.0 May 23, 2024
2.0.0-alpha.5 Mar 24, 2020

#6 in #locked

Download history 1549/week @ 2024-05-16 1785/week @ 2024-05-23 1743/week @ 2024-05-30 1530/week @ 2024-06-06 1308/week @ 2024-06-13 2124/week @ 2024-06-20 1489/week @ 2024-06-27 876/week @ 2024-07-04 2479/week @ 2024-07-11 1578/week @ 2024-07-18 1452/week @ 2024-07-25 1483/week @ 2024-08-01 1823/week @ 2024-08-08 1843/week @ 2024-08-15 2065/week @ 2024-08-22 963/week @ 2024-08-29

6,933 downloads per month
Used in 75 crates (7 directly)

Apache-2.0

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

~18–33MB
~559K SLoC