Contract 818030973b57ed5500fc17b46e0ff326f9353f2ce41cbcbf6aab85e7f914dc03

← Back to Index 📥 Download WASM

Meta

binver 4.0.0
cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdkver 26.1.1#8ac18efb681a1c0b4b85a38c5a380300344e3f39
rsver 1.93.0

Instances

  • CBMUXOGMG724UVTP54JGR447IDGA47NSRASBXQIWSEFEYB45YC4BIRIT

Interface

fn burn(env: soroban_sdk::Env, from: soroban_sdk::Address, amount: i128)
fn name(env: soroban_sdk::Env) -> soroban_sdk::String

EIP-4626: Returns the address of the underlying token used for the Vault (USTRY).

fn asset(env: soroban_sdk::Env) -> Result
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. When RegistryContract is configured on-chain, non-registry callers are routed through the 3-tier fee schedule (0.1% company bot, 0.5% CLI/agent/bot, 1.0% public).

fn deposit(
    env: soroban_sdk::Env,
    depositor: soroban_sdk::Address,
    ustry_amount: i128,
) -> Result
fn upgrade(
    env: soroban_sdk::Env,
    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: DOWN on withdrawal (user gets slightly less = vault absorbs rounding cost).

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>

EIP-4626: Maximum amount of XLD shares that can be redeemed by owner without reverting. Accounts for both PauseWithdrawals and the V3 emergency per-ledger withdrawal cap when PauseDeposits is active.

fn max_redeem(env: soroban_sdk::Env, owner: soroban_sdk::Address) -> i128

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

fn vault_rate(env: soroban_sdk::Env) -> i128

Deposit USTRY on behalf of a domain registrant/renewer. The from address (Registry) provides USTRY, and recipient receives XLD shares after their tier fee (default 1.0% public, 0.5% CLI/bot/agent, 0.1% company; split 50/50 between operator wallet and vault). Compatible with existing Registry auth trees because Vault pulls exact ustry_amount from from.

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

EIP-4626: Maximum amount of underlying USTRY assets that can be deposited for receiver. Bounded by Stellar SAC / classic asset protocol ceiling (i64::MAX stroops) when active.

fn max_deposit(env: soroban_sdk::Env, receiver: soroban_sdk::Address) -> i128
fn sync_assets(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>
fn is_agent_bot(env: soroban_sdk::Env, user: soroban_sdk::Address) -> bool

Public / human mint fee in bps (default 100 = 1.0%)

fn mint_fee_bps(env: soroban_sdk::Env) -> u32
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

Constructor (Protocol 22+): Called atomically during CreateContractV2.

fn __constructor(
    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,
)

Returns all 3 configurable fee tiers as (human_fee_bps, agent_fee_bps, company_fee_bps)

fn get_fee_tiers(env: soroban_sdk::Env) -> (u32, u32, u32)

Whitelist or remove an external CLI/Bot/Agent address (receives AgentMintFeeBps, default 0.5%). Stored in persistent() storage to prevent instance() storage bloat.

fn set_agent_bot(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    bot: soroban_sdk::Address,
    enabled: bool,
) -> Result<(), soroban_sdk::Error>

Configure all 3 fee tiers in a single transaction: (human_fee_bps: e.g. 100 = 1.0%, agent_fee_bps: e.g. 50 = 0.5%, company_fee_bps: e.g. 10 = 0.1%)

fn set_fee_tiers(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    human_fee_bps: u32,
    agent_fee_bps: u32,
    company_fee_bps: u32,
) -> Result<(), soroban_sdk::Error>
fn transfer_from(
    env: soroban_sdk::Env,
    spender: soroban_sdk::Address,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
)
fn is_company_bot(env: soroban_sdk::Env, user: soroban_sdk::Address) -> bool

EIP-4626: Simulates the amount of USTRY assets returned when redeeming shares XLD.

fn preview_redeem(env: soroban_sdk::Env, shares: i128) -> i128

Deposit USTRY into vault with automatic 3-tier fee resolution:

  • Company Bot: CompanyMintFeeBps (default 10 bps = 0.1%)
  • CLI / Bot / AI Agent: AgentMintFeeBps (default 50 bps = 0.5%)
  • Public / Human User: MintFeeBps (default 100 bps = 1.0%) Fee split: 50% to vault (all holders), 50% to operator wallet.
fn public_deposit(
    env: soroban_sdk::Env,
    depositor: soroban_sdk::Address,
    ustry_amount: i128,
) -> Result

EIP-4626: Simulates the net XLD shares minted for a deposit of assets USTRY at the highest configured fee tier (default public MintFeeBps = 1.0%). Using max(human, agent, company) guarantees the EIP-4626 lower-bound invariant actual_shares >= preview_deposit(assets) for all callers even if custom tier rates are non-monotonic.

fn preview_deposit(env: soroban_sdk::Env, assets: i128) -> i128

Whitelist or remove a Company Bot address (receives CompanyMintFeeBps, default 0.1%). Stored in persistent() storage to prevent instance() storage bloat.

fn set_company_bot(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    bot: soroban_sdk::Address,
    enabled: bool,
) -> Result<(), soroban_sdk::Error>

Set USTRY token address (admin only)

fn set_ustry_token(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    ustry_token: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Read current pause status. Public, no auth required.

fn get_pause_status(env: soroban_sdk::Env) -> (bool, bool)

Returns the effective mint fee in bps that will be charged for a given address (pure read-only view)

fn get_user_fee_bps(env: soroban_sdk::Env, user: soroban_sdk::Address) -> u32

EIP-4626: Returns the ideal amount of USTRY assets the Vault would exchange for the amount of XLD shares provided, exclusive of fees and independent of the caller (rounds DOWN).

fn convert_to_assets(env: soroban_sdk::Env, shares: i128) -> i128

EIP-4626: Returns the ideal amount of XLD shares the Vault would exchange for the amount of USTRY assets provided, exclusive of fees and independent of the caller (rounds DOWN).

fn convert_to_shares(env: soroban_sdk::Env, assets: i128) -> i128

Set AgentFactory contract address so deployed C-address agents automatically receive the Agent fee tier (0.5%)

fn set_agent_factory(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    agent_factory: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

CLI / Bot / AI Agent mint fee in bps (default 50 = 0.5%)

fn agent_mint_fee_bps(env: soroban_sdk::Env) -> u32

Public deposit USTRY into vault on behalf of a user/agent with automatic 3-tier fee resolution. Fee split: 50% to vault (all holders), 50% to operator wallet. Mints XLD shares for net amount after fee.

fn public_deposit_for(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    recipient: soroban_sdk::Address,
    ustry_amount: i128,
) -> Result

Set mint fee for CLI, bots & AI agents (default 50 bps = 0.5%)

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

Toggle deposit pause. Admin-only. When paused: deposit(), deposit_for(), public_deposit() all reject. SDF Audit Fix C-01: snapshots TotalAssets at pause time for rate limiter. M-01 fix: Enforces cooldown between toggle operations.

fn set_pause_deposits(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    paused: bool,
) -> Result<(), soroban_sdk::Error>

Caller-aware EIP-4626 preview: Simulates the exact net XLD shares minted for receiver using their resolved tier fee (1.0% public, 0.5% CLI/bot/agent, 0.1% company).

fn preview_deposit_for(
    env: soroban_sdk::Env,
    receiver: soroban_sdk::Address,
    assets: i128,
) -> i128

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>

Set XLD SAC address (admin only)

fn set_xld_sac_address(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    xld_sac: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Company Bot mint fee in bps (default 10 = 0.1%)

fn company_mint_fee_bps(env: soroban_sdk::Env) -> u32

View: returns the maximum XLD amount a user can actually withdraw, accounting for vesting locks. Free (non-vested) XLD is always available.

fn get_max_withdrawable(env: soroban_sdk::Env, user: soroban_sdk::Address) -> i128

Set mint fee for the company bot (default 10 bps = 0.1%)

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

Toggle withdrawal pause. Admin-only. When paused: withdraw(), withdraw_to() all reject. WARNING: Only use during contract upgrades or if withdraw logic itself is compromised. Trapping user funds destroys trust. H-03 fix: Cannot pause withdrawals while deposits are already paused (prevents trapping all user funds simultaneously). M-01 fix: Enforces cooldown between toggle operations.

fn set_pause_withdrawals(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    paused: bool,
) -> Result<(), soroban_sdk::Error>

Imports

WebAssembly Text (WAT) ▶