OpenZeppelin / OpenZeppelin/openzeppelin-contracts

Extending VestingWallet to have revocability

Open
#6,493 0 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 existing implementation for VestingWallet provides a trustless base contract which is correct as a default. However, vesting agreements in real world applications may require the ability to cancel vesting in cases where agreements between the owner and beneficiary falls apart. An example use case can be when employees leave or get removed from an organization.

There have been a prior implementation of this feature in issue #1416 however it appears to be deprecated.

📝 Details
The extension I would like to implement is VestingWalletRevocable, it provides owner of VestingWallet to make cancellations with the following constraints:

  • Revocation only returns unvested tokens to the owner, while vested tokens remain claimable.
  • Once a contract has been revoked, it cannot be reinstated.

Steps

  • Tracking revocation states (prevent double revoking)
  • Implement revoke() which transfers unvested tokens back to owner
  • Override existing vestedAmount() to the use original token allocation amount to account for the revoked token affecting the balance and the vesting schedule.

Let me know your thoughts and if this aligns with the project.

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 with the existing VestingWallet implementation and review the prior approach in issue #1416. Define the revocation state and behavior around unvested-token returns, claimability of vested tokens, and irreversible cancellation; done means the proposed VestingWalletRevocable extension satisfies all listed constraints.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.