Contract f2a2a40416ecbbc53cb0dc70e3f00f234cf1b44f9c6ac969e55ce70ed7c87a01

← Back to Index 📥 Download WASM

Meta

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

Instances

  • CAT6IVT3UPJJ3X54XAJIOJCT3H5NZIKVVRNGBRE3VYSZMGDYWGCN4DWJ

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

Moves up to amount of the vault's PLUSD to the minter, which burns it (a loss absorbed by every share holder). Works while paused. Returns what was moved.

fn pull(env: soroban_sdk::Env, caller: soroban_sdk::Address, amount: i128) -> i128
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
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

Moves up to amount of the vault's PLUSD to the pocket for a defaulted loan and opens it, owned by the share holders at the end of this ledger. Share balances are frozen for the rest of the ledger, so they are exactly the holders at the moment of the carve-out: whoever exited earlier in the ledger took pre-carve NAV and is out of the snapshot. The snapshot supply is passed to the pocket rather than read back by it (Soroban forbids re-entry). Works while paused. Returns what was moved.

fn carve_out(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    loan_id: u32,
    amount: i128,
) -> 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
fn reporters(env: soroban_sdk::Env) -> Reporters

holder's share balance at the end of ledger: the last checkpoint at or before it; 0 if none.

fn balance_at(env: soroban_sdk::Env, holder: soroban_sdk::Address, ledger: u32) -> i128

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

Burns owner's shares without their signature and moves the PLUSD they were worth to the minter, which burns it (reversing fee shares minted for a repayment that is being undone). Works while paused. Returns the PLUSD moved.

fn burn_shares(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    owner: soroban_sdk::Address,
    shares: i128,
) -> 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,
)
fn set_reporters(
    env: soroban_sdk::Env,
    loan_registry: soroban_sdk::Address,
    minter: soroban_sdk::Address,
    pocket: soroban_sdk::Address,
)
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

Total share supply at the end of ledger.

fn total_supply_at(env: soroban_sdk::Env, ledger: u32) -> 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) ▶