Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Adds vested_transfer to Vesting pallet #5029

Merged
merged 18 commits into from Mar 5, 2020

Conversation

lsaether
Copy link
Contributor

closes #4780

This PR implements a way to make a vested_transfer that will transfer currency and create a new vesting schedule for the target account. This means that the the target account must not already have a VestingSchedule attached to it. The vested_transfer function is permissionless, allowing for anyone in the system to create a new VestingSchedule for a target account but requires a minimum transfer amount (VestingDeposit) to do so.

A further enhancement may be to add a maximum MaxVestingLength to prevent users from accidentally locking tokens indefinitely, however it's not critical to the logic in this PR.

I opened this PR to get initial review and can follow up with the necessary changes to the Polkadot codebases if approved.

@parity-cla-bot
Copy link

It looks like @lsaether signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

Copy link
Contributor

@shawntabrizi shawntabrizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good to me. Should check with Gav that he likes the feature :)

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>
Copy link
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks okay for me as well.

frame/vesting/src/lib.rs Outdated Show resolved Hide resolved
frame/vesting/src/lib.rs Outdated Show resolved Hide resolved
frame/vesting/src/lib.rs Outdated Show resolved Hide resolved
frame/vesting/src/lib.rs Outdated Show resolved Hide resolved
lsaether and others added 4 commits February 25, 2020 12:30
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
@shawntabrizi
Copy link
Contributor

@gnunicorn this be gucci

@gavofyork gavofyork merged commit dc124bb into paritytech:master Mar 5, 2020
General-Beck pushed a commit to General-Beck/substrate that referenced this pull request Mar 6, 2020
* Add the vested_transfer function with tests

* Add VestingDeposit for minimum amount to create a new schedule

* Remove irrelevant file commit

* Bump spec

* Add weight comment

* Fix CI build

* Make the check before the transfer

* Update frame/vesting/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update frame/vesting/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update frame/vesting/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Update frame/vesting/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Update frame/vesting/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Add tab to line 249

* Rename to `MinVestedTransfer` for clarity

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
General-Beck pushed a commit to General-Beck/substrate that referenced this pull request Mar 17, 2020
* Add the vested_transfer function with tests

* Add VestingDeposit for minimum amount to create a new schedule

* Remove irrelevant file commit

* Bump spec

* Add weight comment

* Fix CI build

* Make the check before the transfer

* Update frame/vesting/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update frame/vesting/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update frame/vesting/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Update frame/vesting/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Update frame/vesting/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Add tab to line 249

* Rename to `MinVestedTransfer` for clarity

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a "VestingOrigin" to allow for the creation of vesting schedules indefinitely
7 participants