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

no-std orml-vesting

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

15 releases (9 breaking)

new 0.10.0 Apr 17, 2024
0.8.0 Mar 18, 2024
0.6.7 Nov 21, 2023
0.4.0 Feb 14, 2021
0.1.1 Jun 5, 2020

#185 in Magic Beans

Download history 6/week @ 2024-01-29 33/week @ 2024-02-19 86/week @ 2024-02-26 13/week @ 2024-03-11 151/week @ 2024-03-18 99/week @ 2024-04-01 173/week @ 2024-04-08 165/week @ 2024-04-15

438 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

~19–33MB
~545K SLoC