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
fn wrap(
env: soroban_sdk::Env,
vault_shares: i128,
receiver: soroban_sdk::Address,
caller: soroban_sdk::Address,
) -> i128
The current admin (role administrator). None if uninitialized.
fn admin(env: soroban_sdk::Env) -> Option
Pause. Requires PAUSER.
fn pause(env: soroban_sdk::Env, caller: soroban_sdk::Address)
fn oracle(env: soroban_sdk::Env) -> soroban_sdk::Address
Whether paused.
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
fn unwrap(
env: soroban_sdk::Env,
shares: i128,
receiver: soroban_sdk::Address,
owner: soroban_sdk::Address,
operator: soroban_sdk::Address,
) -> i128
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
Maximum accepted age of the oracle observation, in seconds.
fn max_age(env: soroban_sdk::Env) -> u64
Unpause. Requires PAUSER.
fn unpause(env: soroban_sdk::Env, caller: soroban_sdk::Address)
Upgrade the contract Wasm. Requires UPGRADE.
fn upgrade(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
new_wasm_hash: soroban_sdk::BytesN<32>,
)
Share decimals follow the wrapped token (18), not the 7-decimal asset; the PrincipalToken sizes its IBT unit from this value.
fn decimals(env: soroban_sdk::Env) -> u32
Whether account holds role.
fn has_role(
env: soroban_sdk::Env,
account: soroban_sdk::Address,
role: soroban_sdk::Symbol,
) -> bool
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
Grant role to account.
fn grant_role(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
account: soroban_sdk::Address,
role: soroban_sdk::Symbol,
)
fn max_redeem(env: soroban_sdk::Env, owner: soroban_sdk::Address) -> i128
Replace the rate source. This extends the RATE_SET role from tuning
the freshness and band controls to selecting the oracle itself. The
switch is atomic: new_oracle must quote in expected_base, keep the
conversion scale within i128, keep the current max_age within its
resolution cap, and serve a fresh observation inside the current band,
otherwise nothing changes. The scale seen on the new oracle is
recorded as calibrated_decimals.
fn set_oracle(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
new_oracle: soroban_sdk::Address,
)
fn max_deposit(env: soroban_sdk::Env, receiver: soroban_sdk::Address) -> i128
The underlying asset. Defaults to the wrapped token (vault_share).
fn query_asset(env: soroban_sdk::Env) -> soroban_sdk::Address
Revoke role from account.
fn revoke_role(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
account: soroban_sdk::Address,
role: soroban_sdk::Symbol,
)
max_age_secs is capped at MAX_AGE_RESOLUTION_MULTIPLE live oracle
resolutions. Invalidates the per-ledger observation cache: the next
quote re-reads the oracle and applies the new age.
fn set_max_age(env: soroban_sdk::Env, caller: soroban_sdk::Address, max_age_secs: u64)
The wrapped vault-share token
fn vault_share(env: soroban_sdk::Env) -> soroban_sdk::Address
fn max_withdraw(env: soroban_sdk::Env, owner: soroban_sdk::Address) -> i128
fn preview_mint(env: soroban_sdk::Env, shares: i128) -> i128
Strictly 1:1 with wrap: one wrapper share per deJTRSY unit, never
the custody ratio. Tokens transferred directly to the wrapper are
stranded, not redistributed.
fn preview_wrap(env: soroban_sdk::Env, vault_shares: i128) -> i128
Accepted (min_price, max_price) band, in BAND_DECIMALS.
fn price_bounds(env: soroban_sdk::Env) -> (i128, i128)
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
Wrap token (the NAV token, e.g. deJTRSY) with asset as the notional
underlying the oracle price is expressed in (e.g. USDC), reading the
price from the SEP-40 oracle, whose base() must equal
expected_base (the live RedStone feed reports Other("USD")).
Observations older than max_age_secs or, once normalised to
BAND_DECIMALS, outside [min_price, max_price] make every quote
fail closed. The oracle must already serve token with a valid
observation at construction, and its decimals plus the token decimals
must not exceed MAX_SCALE_DECIMALS.
fn __constructor(
env: soroban_sdk::Env,
token: soroban_sdk::Address,
asset: soroban_sdk::Address,
oracle: soroban_sdk::Address,
expected_base: Asset,
max_age_secs: u64,
min_price: i128,
max_price: i128,
admin: soroban_sdk::Address,
)
fn claim_rewards(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
function: soroban_sdk::Symbol,
args: soroban_sdk::Vec,
) -> soroban_sdk::Val
The validated observation used by quotes, including its own scale. Cached for this ledger; panics with the same structured error a quote would.
fn current_price(env: soroban_sdk::Env) -> Observation
The quote asset the oracle must report as base().
fn expected_base(env: soroban_sdk::Env) -> Asset
The rewards proxy, or None when unset. See {ISpectra4626Wrapper-rewardsProxy}.
fn rewards_proxy(env: soroban_sdk::Env) -> Option
fn transfer_from(
env: soroban_sdk::Env,
spender: soroban_sdk::Address,
from: soroban_sdk::Address,
to: soroban_sdk::Address,
amount: i128,
)
fn preview_redeem(env: soroban_sdk::Env, shares: i128) -> i128
Strictly 1:1 with unwrap; see preview_wrap.
fn preview_unwrap(env: soroban_sdk::Env, shares: i128) -> i128
fn preview_deposit(env: soroban_sdk::Env, assets: i128) -> i128
fn preview_withdraw(env: soroban_sdk::Env, assets: i128) -> i128
Recalibrate the band. The live observation must be fresh and inside
the new band, so quotes reopen only on a coherent price/scale pair;
the scale seen is recorded as calibrated_decimals.
fn set_price_bounds(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
min_price: i128,
max_price: i128,
)
fn convert_to_assets(env: soroban_sdk::Env, shares: i128) -> i128
fn convert_to_shares(env: soroban_sdk::Env, assets: i128) -> i128
fn set_rewards_proxy(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
new_rewards_proxy: Option,
)
fn total_vault_shares(env: soroban_sdk::Env) -> i128
Oracle decimals observed at the last calibration (construction or
set_price_bounds). Informational: quotes always normalise with the
observation's scale, so a divergence from live_oracle_decimals is a signal for the
operator, not a switch.
fn calibrated_decimals(env: soroban_sdk::Env) -> u32
Propose new_admin as the next admin. Two-step: the proposed admin
must then call accept_admin_transfer before live_until_ledger.
Requires the current admin's auth (enforced inside stellar-access).
fn transfer_admin_role(
env: soroban_sdk::Env,
new_admin: soroban_sdk::Address,
live_until_ledger: u32,
)
Live oracle price scale; never cached because RedStone documents it as
mutable across feed administration. Metadata only: interpret a cached
current_price using its own decimals, not this live value.
fn live_oracle_decimals(env: soroban_sdk::Env) -> u32
wrap with ERC-5143 slippage protection: reverts when the minted wrapper
shares are below min_shares.
fn wrap_with_min_shares(
env: soroban_sdk::Env,
vault_shares: i128,
receiver: soroban_sdk::Address,
caller: soroban_sdk::Address,
min_shares: i128,
) -> i128
Accept a pending admin role. Requires the proposed admin's auth
(enforced inside stellar-access).
fn accept_admin_transfer(env: soroban_sdk::Env)
unwrap with ERC-5143 slippage protection: reverts when the returned
vault shares are below min_vault_shares.
fn unwrap_with_min_vault_shares(
env: soroban_sdk::Env,
shares: i128,
receiver: soroban_sdk::Address,
owner: soroban_sdk::Address,
operator: soroban_sdk::Address,
min_vault_shares: i128,
) -> i128
shares * price * 10^asset_dec / 10^(price_dec + share_dec).
fn convert_to_assets_with_rounding(
env: soroban_sdk::Env,
shares: i128,
rounding: Rounding,
) -> i128
assets * 10^(price_dec + share_dec) / (price * 10^asset_dec).
fn convert_to_shares_with_rounding(
env: soroban_sdk::Env,
assets: i128,
rounding: Rounding,
) -> i128