Skip to content

Latest commit

Β 

History

History
63 lines (44 loc) Β· 2.3 KB

File metadata and controls

63 lines (44 loc) Β· 2.3 KB

Pull Request: Vesting Cliffs on Top-Ups - Issue #19

🎯 Summary

Implements vesting "cliffs" on top-ups functionality, allowing new cliff periods to be defined specifically for tokens added to existing vaults.

πŸ“‹ Changes Made

Database Models

  • βœ… Vault Model (backend/src/models/vault.js) - Main vault storage
  • βœ… SubSchedule Model (backend/src/models/subSchedule.js) - Multiple vesting schedules per vault
  • βœ… Migration (backend/migrations/001_create_vaults_and_sub_schedules.sql) - Complete schema

Services

  • βœ… VestingService (backend/src/services/vestingService.js) - Core business logic
  • βœ… AdminService Updates - Integration with new vesting functionality
  • βœ… IndexingService Updates - Blockchain event processing

API Endpoints

  • βœ… POST /api/vault/top-up - Top-up with cliff configuration
  • βœ… GET /api/vault/:vaultAddress/details - Vault details with sub-schedules
  • βœ… GET /api/vault/:vaultAddress/releasable - Calculate releasable amounts
  • βœ… POST /api/vault/release - Release tokens respecting cliffs
  • βœ… POST /api/indexing/top-up - Process blockchain top-up events
  • βœ… POST /api/indexing/release - Process blockchain release events

Testing

  • βœ… Comprehensive Test Suite (backend/test/vesting-topup.test.js) - Full coverage

πŸ”§ Key Features

  1. Independent Cliffs: Each top-up can have its own cliff period
  2. Multiple Sub-Schedules: Support for unlimited vesting schedules per vault
  3. Pro-rata Releases: Tokens distributed proportionally across sub-schedules
  4. Audit Trail: Complete logging for compliance
  5. Blockchain Integration: Full event processing support

πŸ“Š Acceptance Criteria

  • βœ… SubSchedule List: Implemented within Vault system
  • βœ… Complex Logic: Successfully handles multiple vesting schedules with independent cliffs
  • βœ… Stretch Goal: Delivered as robust, production-ready feature

πŸ§ͺ Testing

# Run the test suite
npm test backend/test/vesting-topup.test.js

# Start the application
npm start

πŸ“š Documentation

See VESTING_CLIFFS_IMPLEMENTATION.md for detailed documentation and usage examples.

πŸ”— Related Issue

Closes #19: [Feature] Vesting "Cliffs" on Top-Ups


Ready for Review πŸš€