Contract bae64212e66d36a12f0b398ea2a75830c7324d64f2f0b615dc49ccbd869432c0

← Back to Index 📥 Download WASM

Meta

rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.93.0

Interface

fn burn(env: soroban_sdk::Env, from: soroban_sdk::Address, amount: i128)
fn name(env: soroban_sdk::Env) -> soroban_sdk::String
fn symbol(env: soroban_sdk::Env) -> soroban_sdk::String
fn approve(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    spender: soroban_sdk::Address,
    amount: i128,
    expiration_ledger: u32,
)
fn balance(env: soroban_sdk::Env, id: soroban_sdk::Address) -> i128

Deposit USTRY into vault, mint XLD shares via SAC. Protected against donation attacks via virtual offset. Rounding: DOWN on deposit (fewer shares = vault keeps dust).

fn deposit(
    env: soroban_sdk::Env,
    depositor: soroban_sdk::Address,
    ustry_amount: i128,
    domain_node: soroban_sdk::BytesN<32>,
) -> Result
fn upgrade(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    new_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), soroban_sdk::Error>
fn decimals(env: soroban_sdk::Env) -> u32
fn transfer(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    muxed_to: soroban_sdk::MuxedAddress,
    amount: i128,
)

Withdraw USTRY by burning XLD shares. Rounding: UP on withdrawal (user gets slightly more = vault absorbs rounding cost). SDF audit: rounding UP on withdraw prevents dust accumulation exploits.

fn withdraw(
    env: soroban_sdk::Env,
    withdrawer: soroban_sdk::Address,
    xld_amount: i128,
) -> Result
fn allowance(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    spender: soroban_sdk::Address,
) -> i128
fn burn_from(
    env: soroban_sdk::Env,
    spender: soroban_sdk::Address,
    from: soroban_sdk::Address,
    amount: i128,
)
fn set_admin(
    env: soroban_sdk::Env,
    current_admin: soroban_sdk::Address,
    new_admin: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
fn extend_ttl(env: soroban_sdk::Env)

Initialize vault with admin, USTRY token, XLD SAC, operator wallet, and mint fee. The vault holds USTRY and mints/burns XLD via its SAC.

fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    ustry_token: soroban_sdk::Address,
    xld_sac: soroban_sdk::Address,
    operator_wallet: soroban_sdk::Address,
    mint_fee_bps: u32,
) -> Result<(), soroban_sdk::Error>
fn vault_rate(env: soroban_sdk::Env) -> i128

Add USTRY to an existing domain's vault position. No fee. Anyone can top up.

fn add_deposit(
    env: soroban_sdk::Env,
    depositor: soroban_sdk::Address,
    domain_node: soroban_sdk::BytesN<32>,
    ustry_amount: i128,
) -> Result

Deposit USTRY on behalf of a user. The from address provides USTRY, the recipient receives XLD shares. Only callable by the authorized registry.

fn deposit_for(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    recipient: soroban_sdk::Address,
    ustry_amount: i128,
    domain_node: soroban_sdk::BytesN<32>,
) -> Result

Split a domain's vault position into separate PT and YT tokens

fn split_yield(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    domain_node: soroban_sdk::BytesN<32>,
) -> Result<(), soroban_sdk::Error>

Withdraw vault funds to a specified address (registry-authorized, for grace refunds). Burns corresponding XLD shares from recipient via SAC.

fn withdraw_to(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    recipient: soroban_sdk::Address,
    ustry_amount: i128,
    shares_to_burn: i128,
) -> Result<(), soroban_sdk::Error>
fn mint_fee_bps(env: soroban_sdk::Env) -> u32

Set mint fee in basis points (admin only, max 5000 = 50%)

fn set_mint_fee(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    fee_bps: u32,
) -> Result<(), soroban_sdk::Error>

Set authorized registry contract (admin only)

fn set_registry(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    registry: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
fn total_assets(env: soroban_sdk::Env) -> i128
fn total_shares(env: soroban_sdk::Env) -> i128
fn transfer_from(
    env: soroban_sdk::Env,
    spender: soroban_sdk::Address,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
)

Public deposit USTRY into vault with fee. Fee split: 50% to vault (all holders), 50% to operator wallet. Mints XLD shares for net amount after fee.

fn public_deposit(
    env: soroban_sdk::Env,
    depositor: soroban_sdk::Address,
    ustry_amount: i128,
) -> Result

Get yield split info for a domain

fn get_yield_split(
    env: soroban_sdk::Env,
    domain_node: soroban_sdk::BytesN<32>,
) -> Result

Set operator wallet for fee revenue (admin only)

fn set_operator_wallet(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    operator_wallet: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Imports

WebAssembly Text (WAT) ▶