Problem
The RWA token supports mint() and mint_to_investor() for immediate token issuance. Real-world asset deals often require vesting schedules (cliff + linear release) for regulatory compliance or investor lock-ups.
Expected Behavior
A VestingContract that holds tokens and releases them to beneficiaries according to a schedule.
Proposed Solution
Create a new contracts/vesting/ contract:
pub fn create_vesting(
beneficiary: Address,
total_amount: i128,
cliff_duration_ledgers: u32,
vest_duration_ledgers: u32,
start_ledger: u32,
) -> u64 /* vesting_id */
pub fn claim_vested(vesting_id: u64) -> i128
pub fn get_vesting_schedule(vesting_id: u64) -> VestingSchedule
pub fn revoke(vesting_id: u64) /* admin only */
The calculation: vested = total * min(1, (current - start) / vest_duration), with nothing before cliff.
Dependencies
- New contract that holds RWA tokens and transfers on vesting
Problem
The RWA token supports
mint()andmint_to_investor()for immediate token issuance. Real-world asset deals often require vesting schedules (cliff + linear release) for regulatory compliance or investor lock-ups.Expected Behavior
A
VestingContractthat holds tokens and releases them to beneficiaries according to a schedule.Proposed Solution
Create a new
contracts/vesting/contract:The calculation:
vested = total * min(1, (current - start) / vest_duration), with nothing before cliff.Dependencies