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.
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.
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.
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.
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.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.["approve", from: Address, spender: Address][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.
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).
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.
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.
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).
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).
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.
e - Access to the Soroban environment.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.
e - Access to the Soroban environment.owner - The address that owns the vault shares.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).
e - Access to the Soroban environment.shares - The amount of vault shares to simulate minting.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.
e - Access to the Soroban environment.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.
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).
e - Access to the Soroban environment.shares - The amount of vault shares to simulate redeeming.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).
e - Access to the Soroban environment.assets - The amount of underlying assets to simulate depositing.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.
e - Access to the Soroban environment.crate::role_transfer::RoleTransferError::NoPendingTransfer] - If
there is no pending transfer to accept.["ownership_transfer_completed"][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).
e - Access to the Soroban environment.assets - The amount of underlying assets to simulate withdrawing.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).
e - Access to the Soroban environment.shares - The amount of vault shares to convert.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).
e - Access to the Soroban environment.assets - The amount of underlying assets to convert.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].
e - Access to the Soroban environment.OwnableError::TransferInProgress] - If there is a pending ownership
transfer.OwnableError::OwnerNotSet] - If the owner is not set.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.
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.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.fn transfer_ownership(
env: soroban_sdk::Env,
new_owner: soroban_sdk::Address,
live_until_ledger: u32,
)