OpenZeppelin / OpenZeppelin/openzeppelin-contracts

Implement Twisted and Milestone Vesting

Open
#4,485 2 comments 0 reactions 0 assignees View on GitHub

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:

  1. Token Vesting: The Complete Guide to Creating Vesting in Tokenomics
  2. TOKEN VESTING – EVERYTHING YOU NEED TO KNOW

I am open to contributing to this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.