Claim vested tokens based on current TWAP
Only the beneficiary can call this function. Must be called after the cliff period has ended. Unlocks tokens for each milestone where TWAP >= milestone_price.
fn claim(env: soroban_sdk::Env)
Get full vesting configuration
fn get_config(env: soroban_sdk::Env) -> VestingConfig
Get current vesting status
fn get_status(env: soroban_sdk::Env) -> VestingStatus
Initialize the vesting contract
admin - Contract administrator (must authorize this call)token - Project token SAC addressoracle - Reflector Oracle contract addressoracle_asset - Asset identifier for oracle queriesbeneficiary - Team address that receives vested tokenstotal_tokens - Total tokens in vesting poolcliff_ledger - Ledger number when 18-month cliff endsico_price - ICO price in USDC (7 decimals)fn initialize(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
token: soroban_sdk::Address,
oracle: soroban_sdk::Address,
oracle_asset: soroban_sdk::Address,
beneficiary: soroban_sdk::Address,
total_tokens: i128,
cliff_ledger: u32,
ico_price: i128,
)
Compute time-weighted average price (TWAP) over the last ~3 months
Uses snapshots from the TWAP_WINDOW_LEDGERS window. Returns 0 if fewer than 2 snapshots are available in the window.
fn compute_twap(env: soroban_sdk::Env) -> i128
Record a price snapshot from the Reflector Oracle
Permissionless function that can be called by anyone. Fetches the current token price from the oracle and stores it. Enforces minimum 720-ledger interval between snapshots (~1 hour).
fn record_price_snapshot(env: soroban_sdk::Env)