Contract 1f11c292d09b1879e6a3d37fc1f5b885d87eaf11ad00a3abff95a5bef58a1f49

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.10#9a1b75b509a5053b676b09fdbd224fe8c5f2fcd5
rsver 1.94.0

Interface

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

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 18-month 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

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) ▶