#balance #vesting #period #scheduled #account #locking #schedule

no-std orml-vesting

Provides scheduled balance locking mechanism, in a *graded vesting* way

19 releases (2 stable)

1.1.0 Dec 10, 2024
1.0.0 Aug 1, 2024
0.13.0 Jun 26, 2024
0.8.0 Mar 18, 2024
0.1.1 Jun 5, 2020

#3 in #vesting

Download history 9/week @ 2024-08-31 12/week @ 2024-09-07 51/week @ 2024-09-14 46/week @ 2024-09-21 72/week @ 2024-09-28 37/week @ 2024-10-05 26/week @ 2024-10-12 116/week @ 2024-10-19 33/week @ 2024-10-26 69/week @ 2024-11-02 8/week @ 2024-11-09 15/week @ 2024-11-16 23/week @ 2024-11-23 18/week @ 2024-11-30 216/week @ 2024-12-07 57/week @ 2024-12-14

315 downloads per month

Apache-2.0

37KB
931 lines

Vesting Module

Overview

Vesting module provides a means of scheduled balance lock on an account. It uses the graded vesting way, which unlocks a specific amount of balance every period of time, until all balance unlocked.

Vesting Schedule

The schedule of a vesting is described by data structure VestingSchedule: from the block number of start, for every period amount of blocks, per_period amount of balance would unlocked, until number of periods period_count reached. Note in vesting schedules, time is measured by block number. All VestingSchedules under an account could be queried in chain state.

Locks

The implementation uses locks which allow tokens to be locked by other pallets that's also using locks, for example, the conviction-voting pallet.


lib.rs:

Vesting Module

Overview

Vesting module provides a means of scheduled balance lock on an account. It uses the graded vesting way, which unlocks a specific amount of balance every period of time, until all balance unlocked.

Vesting Schedule

The schedule of a vesting is described by data structure VestingSchedule: from the block number of start, for every period amount of blocks, per_period amount of balance would unlocked, until number of periods period_count reached. Note in vesting schedules, time is measured by block number. All VestingSchedules under an account could be queried in chain state.

Interface

Dispatchable Functions

  • vested_transfer - Add a new vesting schedule for an account.
  • claim - Claim unlocked balances.
  • update_vesting_schedules - Update all vesting schedules under an account, root origin required.

Dependencies

~20–36MB
~554K SLoC