Contract 98edca8d788ed0038e845ec69a55b31d353b4dec4418fd98200afd6a3d8562f3

← Back to Index 📥 Download WASM

Meta

cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdk_spec_shaking 2
rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.95.0

Instances

  • CDT3UUNLKM4QKBFXNMXRFBPXU7WRCJNR6OHJYRMZ2GOWW3W6ANCZPHAW

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, caller: soroban_sdk::Address)

Returns true if the contract is paused, and false otherwise.

Arguments

  • e - Access to Soroban environment.
fn paused(env: soroban_sdk::Env) -> bool
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

Sets the amount of tokens a spender is allowed to spend on behalf of an owner. Overrides any existing allowance set between spender and owner.

Arguments

  • e - Access to Soroban environment.
  • owner - The address holding the tokens.
  • spender - The address authorized to spend the tokens.
  • amount - The amount of tokens made available to spender.
  • live_until_ledger - The ledger number at which the allowance expires.

Errors

  • [FungibleTokenError::InvalidLiveUntilLedger] - Occurs when attempting to set live_until_ledger that is less than the current ledger number and greater than 0.
  • [FungibleTokenError::LessThanZero] - Occurs when amount < 0.

Events

  • topics - ["approve", from: Address, spender: Address]
  • data - [amount: i128, live_until_ledger: u32]
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, caller: 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

Returns the maximum amount of vault shares that can be minted for the given receiver address (currently i128::MAX).

Arguments

  • e - Access to the Soroban environment.
  • receiver - The address that would receive the vault shares.
fn max_mint(env: soroban_sdk::Env, receiver: soroban_sdk::Address) -> i128

Transfers amount of tokens from from to to.

Arguments

  • e - Access to Soroban environment.
  • from - The address holding the tokens.
  • to - The address receiving the transferred tokens.
  • amount - The amount of tokens to be transferred.

Errors

  • [FungibleTokenError::InsufficientBalance] - When attempting to transfer more tokens than from current balance.
  • [FungibleTokenError::LessThanZero] - When amount < 0.

Events

  • topics - ["transfer", from: Address, to: Address]
  • data - [to_muxed_id: Option<u64>, amount: 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

Returns Some(Address) if ownership is set, or None if ownership has been renounced.

Arguments

  • e - Access to the Soroban environment.
fn get_owner(env: soroban_sdk::Env) -> Option

Returns the maximum amount of vault shares that can be redeemed by the given owner (equal to their vault share balance).

Arguments

  • e - Access to the Soroban environment.
  • owner - The address that owns the vault shares.
fn max_redeem(env: soroban_sdk::Env, owner: soroban_sdk::Address) -> i128

Returns the maximum amount of underlying assets that can be deposited for the given receiver address (currently i128::MAX).

Arguments

  • e - Access to the Soroban environment.
  • receiver - The address that would receive the vault shares.
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

Returns the maximum amount of underlying assets that can be withdrawn by the given owner, limited by their vault share balance.

Arguments

  • e - Access to the Soroban environment.
  • owner - The address that owns the vault shares.

Errors

  • [crate::vault::VaultTokenError::VaultInvalidSharesAmount] - When shares < 0.
  • [crate::vault::VaultTokenError::MathOverflow] - When mathematical operations result in overflow.
fn max_withdraw(env: soroban_sdk::Env, owner: soroban_sdk::Address) -> i128

Simulates and returns the amount of underlying assets required to mint a given amount of vault shares (rounded up).

Arguments

  • e - Access to the Soroban environment.
  • shares - The amount of vault shares to simulate minting.

Errors

  • [crate::vault::VaultTokenError::VaultInvalidSharesAmount] - When shares < 0.
  • [crate::vault::VaultTokenError::MathOverflow] - When mathematical operations result in overflow.
fn preview_mint(env: soroban_sdk::Env, shares: i128) -> i128

Returns the total amount of underlying assets held by the vault.

This represents the vault's balance of the underlying asset, which determines the conversion rate between shares and assets.

Arguments

  • e - Access to the Soroban environment.

Errors

  • [crate::vault::VaultTokenError::VaultAssetAddressNotSet] - When the vault's underlying asset address has not been initialized.
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,
    access_manager: soroban_sdk::Address,
    name: soroban_sdk::String,
    symbol: soroban_sdk::String,
    asset: soroban_sdk::Address,
    decimals_offset: u32,
)

Transfers amount of tokens from from to to using the allowance mechanism. amount is then deducted from spender allowance.

Arguments

  • e - Access to Soroban environment.
  • spender - The address authorizing the transfer, and having its allowance consumed during the transfer.
  • from - The address holding the tokens which will be transferred.
  • to - The address receiving the transferred tokens.
  • amount - The amount of tokens to be transferred.

Errors

  • [FungibleTokenError::InsufficientBalance] - When attempting to transfer more tokens than from current balance.
  • [FungibleTokenError::LessThanZero] - When amount < 0.
  • [FungibleTokenError::InsufficientAllowance] - When attempting to transfer more tokens than spender current allowance.

Events

  • topics - ["transfer", from: Address, to: Address]
  • data - [amount: i128]
fn transfer_from(
    env: soroban_sdk::Env,
    spender: soroban_sdk::Address,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
)

Simulates and returns the amount of underlying assets that would be received for redeeming a given amount of vault shares (rounded down).

Arguments

  • e - Access to the Soroban environment.
  • shares - The amount of vault shares to simulate redeeming.

Errors

  • [crate::vault::VaultTokenError::VaultInvalidSharesAmount] - When shares < 0.
  • [crate::vault::VaultTokenError::MathOverflow] - When mathematical operations result in overflow.
fn preview_redeem(env: soroban_sdk::Env, shares: i128) -> i128

Simulates and returns the amount of vault shares that would be minted for a given deposit of underlying assets (rounded down).

Arguments

  • e - Access to the Soroban environment.
  • assets - The amount of underlying assets to simulate depositing.

Errors

  • [crate::vault::VaultTokenError::VaultInvalidAssetsAmount] - When assets < 0.
  • [crate::vault::VaultTokenError::MathOverflow] - When mathematical operations result in overflow.
fn preview_deposit(env: soroban_sdk::Env, assets: i128) -> i128

Accepts a pending ownership transfer.

Arguments

  • e - Access to the Soroban environment.

Errors

  • [crate::role_transfer::RoleTransferError::NoPendingTransfer] - If there is no pending transfer to accept.

Events

  • topics - ["ownership_transfer_completed"]
  • data - [new_owner: Address]
fn accept_ownership(env: soroban_sdk::Env)

Simulates and returns the amount of vault shares that would be burned to withdraw a given amount of underlying assets (rounded up).

Arguments

  • e - Access to the Soroban environment.
  • assets - The amount of underlying assets to simulate withdrawing.

Errors

  • [crate::vault::VaultTokenError::VaultInvalidAssetsAmount] - When assets < 0.
  • [crate::vault::VaultTokenError::MathOverflow] - When mathematical operations result in overflow.
fn preview_withdraw(env: soroban_sdk::Env, assets: i128) -> i128

Converts an amount of vault shares to the equivalent amount of underlying assets (rounded down).

Arguments

  • e - Access to the Soroban environment.
  • shares - The amount of vault shares to convert.

Errors

  • [crate::vault::VaultTokenError::VaultInvalidSharesAmount] - When shares < 0.
  • [crate::vault::VaultTokenError::MathOverflow] - When mathematical operations result in overflow.
fn convert_to_assets(env: soroban_sdk::Env, shares: i128) -> i128

Converts an amount of underlying assets to the equivalent amount of vault shares (rounded down).

Arguments

  • e - Access to the Soroban environment.
  • assets - The amount of underlying assets to convert.

Errors

  • [crate::vault::VaultTokenError::VaultInvalidAssetsAmount] - When assets < 0.
  • [crate::vault::VaultTokenError::MathOverflow] - When mathematical operations result in overflow.
fn convert_to_shares(env: soroban_sdk::Env, assets: i128) -> i128

Renounces ownership of the contract.

Permanently removes the owner, disabling all functions gated by #[only_owner].

Arguments

  • e - Access to the Soroban environment.

Errors

  • [OwnableError::TransferInProgress] - If there is a pending ownership transfer.
  • [OwnableError::OwnerNotSet] - If the owner is not set.

Notes

  • Authorization for the current owner is required.
fn renounce_ownership(env: soroban_sdk::Env)

Initiates a 2-step ownership transfer to a new address.

Requires authorization from the current owner. The new owner must later call accept_ownership() to complete the transfer.

Arguments

  • e - Access to the Soroban environment.
  • new_owner - The proposed new owner.
  • live_until_ledger - Ledger number until which the new owner can accept. A value of 0 cancels any pending transfer.

Errors

  • [OwnableError::OwnerNotSet] - If the owner is not set.
  • [crate::role_transfer::RoleTransferError::NoPendingTransfer] - If trying to cancel a transfer that doesn't exist.
  • [crate::role_transfer::RoleTransferError::InvalidLiveUntilLedger] - If the specified ledger is in the past.
  • [crate::role_transfer::RoleTransferError::InvalidPendingAccount] - If the specified pending account is not the same as the provided new address.

Notes

  • Authorization for the current owner is required.
fn transfer_ownership(
    env: soroban_sdk::Env,
    new_owner: soroban_sdk::Address,
    live_until_ledger: u32,
)

Imports

WebAssembly Text (WAT) ▶