-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Support Multiple Vesting Schedules in Vesting Pallet #7101
Description
Right now we have a pretty strict limitation that only one vesting schedule is allowed per user.
This means if you already have a vesting schedule (say from participating early in Polkadot), that you cannot receive any more manifests with a vesting schedule.
You might imagine that the treasury would want to support vesting payouts at some point, and a single user would want to be the target of multiple vesting payouts.
The solution here should be pretty simple. We should allow a user to have a vector in storage with max length MaxVestingSchedules (configurable) to represent the vesting schedules for the user.
A lock is placed on the account with the maximum balance across all vesting schedules. When a user updates their vesting, we go through the schedules and correctly update the lock, removing any completed schedules.
Since there is still some limit to number of vesting schedules, we should add an additional extrinsic which allows a user to "combine" vesting schedules.
This would combine the balance of two vesting schedules, and create one vesting schedule whose lock time is the greatest of the two.
This means that a user can always extend their vesting schedule to consolidate vesting balances, but also free up space to collect more vesting schedules.