Contract f54485d59dae89a670700f597109aaadcb21f1004b6a4dae3c2251ac64459faf

← Back to Index 📥 Download WASM

Meta

binver 0.1.0
rssdkver 25.1.1#94c2a3b3a5ded6b9cf9cef0c207bf8804f3eb294
rsver 1.93.1

Instances

  • CAI2TYZGVKLQ4CHSMHPHWXZVQFX5SHKJA2Q3WUQVUBI73NGL6SHVAK4L

Interface

fn mint(
    env: soroban_sdk::Env,
    shares: i128,
    receiver: soroban_sdk::Address,
    from: soroban_sdk::Address,
    operator: soroban_sdk::Address,
) -> i128

Returns the name for this token.

Arguments

  • e - Access to Soroban environment.
fn name(env: soroban_sdk::Env) -> soroban_sdk::String
fn pause(env: soroban_sdk::Env, admin: soroban_sdk::Address)
fn redeem(
    env: soroban_sdk::Env,
    shares: i128,
    receiver: soroban_sdk::Address,
    owner: soroban_sdk::Address,
    operator: soroban_sdk::Address,
) -> i128

Returns the symbol for this token.

Arguments

  • e - Access to Soroban environment.
fn symbol(env: soroban_sdk::Env) -> soroban_sdk::String
fn approve(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    spender: soroban_sdk::Address,
    amount: i128,
    live_until_ledger: u32,
)

Returns the amount of tokens held by account.

Arguments

  • e - Access to the Soroban environment.
  • account - The address for which the balance is being queried.
fn balance(env: soroban_sdk::Env, account: soroban_sdk::Address) -> i128
fn deposit(
    env: soroban_sdk::Env,
    assets: i128,
    receiver: soroban_sdk::Address,
    from: soroban_sdk::Address,
    operator: soroban_sdk::Address,
) -> i128
fn unpause(env: soroban_sdk::Env, admin: soroban_sdk::Address)
fn upgrade(
    env: soroban_sdk::Env,
    new_wasm_hash: soroban_sdk::BytesN<32>,
    operator: soroban_sdk::Address,
)
fn decimals(env: soroban_sdk::Env) -> u32
fn max_mint(env: soroban_sdk::Env, receiver: soroban_sdk::Address) -> i128
fn transfer(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    to: soroban_sdk::MuxedAddress,
    amount: i128,
)
fn withdraw(
    env: soroban_sdk::Env,
    assets: i128,
    receiver: soroban_sdk::Address,
    owner: soroban_sdk::Address,
    operator: soroban_sdk::Address,
) -> i128

Returns the amount of tokens a spender is allowed to spend on behalf of an owner.

Arguments

  • e - Access to Soroban environment.
  • owner - The address holding the tokens.
  • spender - The address authorized to spend the tokens.
fn allowance(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    spender: soroban_sdk::Address,
) -> i128
fn get_admin(env: soroban_sdk::Env) -> soroban_sdk::Address
fn is_paused(env: soroban_sdk::Env) -> bool
fn extend_ttl(env: soroban_sdk::Env)
fn max_redeem(env: soroban_sdk::Env, owner: soroban_sdk::Address) -> i128
fn max_deposit(env: soroban_sdk::Env, receiver: soroban_sdk::Address) -> i128

Returns the address of the underlying asset that the vault manages.

Arguments

  • e - Access to the Soroban environment.

Errors

  • [crate::vault::VaultTokenError::VaultAssetAddressNotSet] - When the vault's underlying asset address has not been initialized.
fn query_asset(env: soroban_sdk::Env) -> soroban_sdk::Address
fn get_operator(env: soroban_sdk::Env) -> Option
fn max_withdraw(env: soroban_sdk::Env, owner: soroban_sdk::Address) -> i128
fn preview_mint(env: soroban_sdk::Env, shares: i128) -> i128

Note: setting admin == operator concentrates governance and AUM reporting under a single key. Prefer separate keys in production.

fn set_operator(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    new_operator: soroban_sdk::Address,
)
fn total_assets(env: soroban_sdk::Env) -> i128

Returns the total amount of tokens in circulation.

Arguments

  • e - Access to the Soroban environment.
fn total_supply(env: soroban_sdk::Env) -> i128
fn __constructor(
    env: soroban_sdk::Env,
    name: soroban_sdk::String,
    symbol: soroban_sdk::String,
    asset: soroban_sdk::Address,
    decimals_offset: u32,
    admin: soroban_sdk::Address,
)
fn transfer_from(
    env: soroban_sdk::Env,
    spender: soroban_sdk::Address,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
)

Register a new strategy subaccount with the vault.

Requires admin authorization and a non-paused vault. Performs a zero-amount smoke-test (deposit(vault, 0) and withdraw(vault, 0)) to verify the address implements a compatible IStrategy interface. The whitelist is capped at MAX_SUBACCOUNTS entries.

fn add_subaccount(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    subaccount: soroban_sdk::Address,
)
fn preview_redeem(env: soroban_sdk::Env, shares: i128) -> i128
fn set_aum_limits(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    increase_bps: u32,
    decrease_bps: u32,
)

Returns the list of currently whitelisted strategy subaccount addresses.

fn get_subaccounts(env: soroban_sdk::Env) -> soroban_sdk::Vec
fn preview_deposit(env: soroban_sdk::Env, assets: i128) -> i128
fn preview_withdraw(env: soroban_sdk::Env, assets: i128) -> i128
fn convert_to_assets(env: soroban_sdk::Env, shares: i128) -> i128
fn convert_to_shares(env: soroban_sdk::Env, assets: i128) -> i128

Intentionally skips pause check: removal may be needed for decommissioning strategies during emergencies.

The admin is responsible for ensuring all value has been recovered from the strategy before removal. On-chain balance checks are not performed because they are unreliable for complex strategies that swap, stake, or lend the underlying token.

Does NOT reconcile deployed_assets. If the removed strategy had deployed capital, the operator should call update_total_assets with the new total that excludes the removed strategy's funds.

fn remove_subaccount(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    subaccount: soroban_sdk::Address,
)
fn get_deployed_assets(env: soroban_sdk::Env) -> i128

Reconcile deployed_assets with an operator-provided total deployed value. The operator computes total deployed assets off-chain and passes the result in as amount. No on-chain strategy queries are performed — the vault trusts the operator's reported value.

fn update_total_assets(
    env: soroban_sdk::Env,
    operator: soroban_sdk::Address,
    amount: i128,
)

Transfer amount of the underlying token from the vault to subaccount and notify the strategy via IStrategy::deposit. Updates deployed_assets using the actual balance change (balance-differencing).

Requires operator authorization, a non-paused vault, and a whitelisted subaccount.

fn deposit_to_subaccount(
    env: soroban_sdk::Env,
    operator: soroban_sdk::Address,
    subaccount: soroban_sdk::Address,
    amount: i128,
)
fn get_aum_decrease_limit(env: soroban_sdk::Env) -> u32
fn get_aum_increase_limit(env: soroban_sdk::Env) -> u32

Request amount of the underlying token back from subaccount via IStrategy::withdraw. Measures actual tokens received via balance- differencing and updates deployed_assets accordingly.

Requires operator authorization, a non-paused vault, and a whitelisted subaccount.

fn withdraw_from_subaccount(
    env: soroban_sdk::Env,
    operator: soroban_sdk::Address,
    subaccount: soroban_sdk::Address,
    amount: i128,
)

Imports

WebAssembly Text (WAT) ▶