OpenZeppelin / OpenZeppelin/openzeppelin-contracts
Implement Twisted and Milestone Vesting
Nobody has claimed this yet.
- Dominant language
- Solidity
- Stars
- 27.2k
- Forks
- 12.4k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 33
Description
🧐 Motivation
The most basic type of vesting is linear when after the cliff period the fixed portions of token are released to the beneficiary on every time interval. It is already implemented in VestingWallet contract. Nonetheless, there are more types of vesting that are more helpful for tier 1 projects, advisors, VCs, and capitals: Twisted and Milestone vesting. More details below.
📝 Details
To convey the ideas in a very basic form, the twisted vesting consists of a combination of linear vesting schedules following one after another. Milestone vesting is the corner case of twisted vesting that only uses cliffs with zero length linear part (immediate vesting after a cliff). With twisted and milestone vesting it is possible to create complex non-linear vesting schedules in a gas optimized way. Hence, the benefits of the suggested vesting models are: (1) creating arbitrary non-linear schedules, (2) gas optimization, (3) having a single vesting account that shows the full balance in vesting for all schedules (especially helpful for complex non-linear cases).
There are two articles that describe Twisted and Milestone vesting and their use cases in detail:
- Token Vesting: The Complete Guide to Creating Vesting in Tokenomics
- TOKEN VESTING – EVERYTHING YOU NEED TO KNOW
I am open to contributing to this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading contracts/finance/VestingWallet.sol and the two linked vesting articles to understand the existing linear schedule and proposed twisted and milestone models. Define the contract API and acceptance cases for sequential linear segments and zero-length cliffs before implementation; done would require documented behavior and tests for both models, but the issue names no test files or agreed interface.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- solidity
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100