Skip to content

Extending VestingWallet to have revocability #6493

@tuann72

Description

@tuann72

🧐 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions