Contract aa7d998cd78d3ac9042abf74fc270e70f2d7c7131582885194a3f709cddbefb6

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.10#9a1b75b509a5053b676b09fdbd224fe8c5f2fcd5
rsver 1.94.0

Interface

Claim vested tokens using both linear time-based and milestone-based unlocking

Only the beneficiary can call this function. Must be called after the cliff period has ended. Combines:

  • Track 1: Linear vesting (50% over 3 years)
  • Track 2: Milestone-based vesting (50% via TWAP milestones)
  • Track 3: Governance-unlocked tokens
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

Arguments

  • admin - Contract administrator (must authorize this call)
  • token - Project token SAC address
  • oracle - Reflector Oracle contract address
  • oracle_asset - Asset identifier for oracle queries
  • beneficiary - Team address that receives vested tokens
  • total_tokens - Total tokens in vesting pool
  • cliff_ledger - Ledger number when cliff ends
  • ico_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

Unlock milestone-locked tokens via governance override

Only callable by the contract admin. Allows unlocking some or all of the milestone-locked tokens. The governance-unlocked amount gets added to claimable balance on next claim.

fn governance_unlock(env: soroban_sdk::Env, admin: soroban_sdk::Address, amount: 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)

Imports

WebAssembly Text (WAT) ▶