Skip to content

Implement time-locked token vesting schedules with cliff and linear r…#202

Open
codefather2026 wants to merge 1 commit into
BCPathway:mainfrom
codefather2026:main
Open

Implement time-locked token vesting schedules with cliff and linear r…#202
codefather2026 wants to merge 1 commit into
BCPathway:mainfrom
codefather2026:main

Conversation

@codefather2026
Copy link
Copy Markdown

Summary

Implemented a new vesting module that supports multiple schedules per beneficiary, cliff-gated linear vesting, revocable grants, beneficiary token release, admin revocation, and vesting state inspection with claimable amount calculations.

The implementation includes integration with the existing token and admin contracts to support secure vesting lifecycle management and token distribution.

Related Issue

Closes #158

Type of Change

  • Feature
  • Bug fix
  • Refactor
  • Documentation

Changes Made

Vesting Contract

  • Added contracts/vesting contract
  • Implemented VestingSchedule data structure
  • Added support for multiple vesting schedules per beneficiary
  • Implemented cliff-gated linear vesting calculations
  • Added admin-only vesting creation
  • Added beneficiary release flow
  • Added admin-only vesting revocation for revocable schedules
  • Added vesting information queries with claimable amount calculations
  • Prevented double-release and over-release edge cases
  • Added event emission for vesting lifecycle actions

Token & Access Control Integration

  • Updated shared admin/access-control functionality
  • Integrated vesting contract with the token contract
  • Added token ownership transfer support for vesting administration
  • Enabled vesting-controlled token minting and distribution

Events

  • Emit vesting_created
  • Emit tokens_released
  • Emit vesting_revoked

Requirements

  • Create contracts/vesting/ crate
  • Define VestingSchedule struct
  • Implement create_vesting(...) (admin only)
  • Implement release(beneficiary) flow
  • Implement revoke(schedule_id) (admin only)
  • Implement get_vesting_info(beneficiary)
  • Implement linear vesting calculation
  • Implement cliff enforcement
  • Support multiple schedules per beneficiary
  • Emit vesting lifecycle events
  • Add token contract integration tests
  • Prevent double-release and over-release edge cases

Validation

  • cargo test

  • Integration tests covering:

    • Pre-cliff release behavior
    • Linear vesting progression
    • Double-release prevention
    • Revocation of unvested allocations
    • Multiple schedules releasing together

Screenshots (if UI changes)

N/A

Checklist

  • Scope is focused and avoids unrelated changes
  • Commit messages are clear
  • Documentation updated when needed
  • ETA was provided when requesting assignment for the linked issue

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

@codefather2026 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement time-locked token vesting schedules with cliff and linear release

2 participants