fn name(env: soroban_sdk::Env) -> soroban_sdk::String
Pause both PT and the paired YT. Requires the PAUSER role.
fn pause(env: soroban_sdk::Env, caller: soroban_sdk::Address)
Return the paired YT address.
fn get_yt(env: soroban_sdk::Env) -> soroban_sdk::Address
Return pause state.
fn paused(env: soroban_sdk::Env) -> bool
Redeem PT shares for underlying. Burns PT from owner, burns YT pre-expiry,
unwraps IBT, and transfers underlying to receiver.
fn redeem(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
shares: i128,
receiver: soroban_sdk::Address,
owner: soroban_sdk::Address,
) -> i128
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,
)
fn balance(env: soroban_sdk::Env, account: soroban_sdk::Address) -> i128
Deposit underlying assets. PT pulls from caller, wraps to IBT, mints PT
to pt_receiver and YT to yt_receiver after the tokenization fee.
fn deposit(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
assets: i128,
pt_receiver: soroban_sdk::Address,
yt_receiver: soroban_sdk::Address,
) -> i128
Return the IBT vault address.
fn get_ibt(env: soroban_sdk::Env) -> soroban_sdk::Address
Unpause both PT and the paired YT. Requires the PAUSER role.
fn unpause(env: soroban_sdk::Env, caller: soroban_sdk::Address)
Upgrade the contract code to new_wasm_hash. Requires the UPGRADE role.
fn upgrade(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
new_wasm_hash: soroban_sdk::BytesN<32>,
)
fn decimals(env: soroban_sdk::Env) -> u32
View: whether account currently holds role.
fn has_role(
env: soroban_sdk::Env,
account: soroban_sdk::Address,
role: soroban_sdk::Symbol,
) -> bool
Return the maturity timestamp.
fn maturity(env: soroban_sdk::Env) -> u64
fn transfer(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
to: soroban_sdk::MuxedAddress,
amount: i128,
)
Withdraw a fixed amount of underlying. Redeems IBT for assets, burns the
corresponding PT (and YT pre-expiry), and transfers underlying to receiver.
fn withdraw(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
assets: i128,
receiver: soroban_sdk::Address,
owner: soroban_sdk::Address,
) -> i128
fn allowance(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
spender: soroban_sdk::Address,
) -> i128
Transfer accumulated fees to the registry fee collector as IBT shares.
Panics with UnauthorizedFeeCollector when caller is not the collector and
NoFeesToClaim when the accumulated fee balance is zero.
fn claim_fees(env: soroban_sdk::Env, caller: soroban_sdk::Address) -> i128
Grant role to account. caller must be the contract admin or hold
the admin-role of role. Auth + admin checks are enforced by
access_control::grant_role.
fn grant_role(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
account: soroban_sdk::Address,
role: soroban_sdk::Symbol,
)
Initialize the Principal Token and its paired Yield Token.
Requires admin authorization and must be called only once. Reads IBT and
underlying metadata, validates decimals, computes initial rates, sets PT
metadata, grants roles, deploys the paired YT, and persists instance state.
Panics with AlreadyInitialized, RateError, or InvalidDecimals when
preconditions fail.
fn initialize(
env: soroban_sdk::Env,
ibt: soroban_sdk::Address,
duration: u64,
admin: soroban_sdk::Address,
registry: soroban_sdk::Address,
)
Max redeemable shares for owner. Returns 0 when paused.
fn max_redeem(env: soroban_sdk::Env, owner: soroban_sdk::Address) -> i128
Return the underlying asset address.
fn underlying(env: soroban_sdk::Env) -> soroban_sdk::Address
Upgrade the paired YT's WASM to new_wasm_hash. Requires the
UPGRADE role on PT. The PT is YT's policy authority — YT's own
upgrade entry point requires pt.require_auth(), so this is the
only legitimate path to roll YT forward.
fn upgrade_yt(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
new_wasm_hash: soroban_sdk::BytesN<32>,
)
Claim accumulated yield as underlying. Settles yield, applies the yield fee,
redeems IBT, and transfers underlying to receiver.
fn claim_yield(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
receiver: soroban_sdk::Address,
min_assets: i128,
) -> i128
Deposit using IBT shares directly. PT pulls IBT from caller and settles
minting through the same internal IBT deposit flow.
fn deposit_ibt(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
ibts: i128,
pt_receiver: soroban_sdk::Address,
yt_receiver: soroban_sdk::Address,
) -> i128
Return the current PT rate (Ray).
fn get_pt_rate(env: soroban_sdk::Env) -> i128
Max depositable assets for receiver. Returns 0 when paused or expired.
fn max_deposit(env: soroban_sdk::Env, receiver: soroban_sdk::Address) -> i128
Revoke role from account. Same auth model as grant_role.
fn revoke_role(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
account: soroban_sdk::Address,
role: soroban_sdk::Symbol,
)
Return the PT duration in seconds.
fn get_duration(env: soroban_sdk::Env) -> u64
Return the current IBT rate (Ray).
fn get_ibt_rate(env: soroban_sdk::Env) -> i128
Return the IBT unit (10^decimals).
fn get_ibt_unit(env: soroban_sdk::Env) -> i128
Max withdrawable underlying for owner. Returns 0 when paused.
fn max_withdraw(env: soroban_sdk::Env, owner: soroban_sdk::Address) -> i128
Bundled pricing snapshot for the limit-order engine:
(ibt_rate, future_pt_value, maturity) in a single cross-contract call.
The engine otherwise reads these via ~7 separate calls (PT get_ibt,
IBT decimals, vault query_asset, underlying decimals, PT
get_ibt_rate, PT preview_redeem, PT maturity) — each re-instantiating
the target contract, which on a heavy IBT (Blend pool / Upshift vault)
dominates per-fill memory. Folding them into one PT invocation (with one
internal vault read) removes those redundant instantiations.
fn pricing_data(env: soroban_sdk::Env) -> (i128, i128, u64)
Underlying value of PT's IBT holdings (preview redeem on PT's IBT balance).
fn total_assets(env: soroban_sdk::Env) -> i128
fn total_supply(env: soroban_sdk::Env) -> i128
Settle yield for a user based on their pre-op YT balance. Callable only by the paired YT.
fn update_yield(
env: soroban_sdk::Env,
user: soroban_sdk::Address,
user_yt_balance: i128,
) -> i128
Withdraw IBT shares directly. Burns the matching PT (and YT pre-expiry) and
transfers IBT to receiver.
fn withdraw_ibt(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
ibts: i128,
receiver: soroban_sdk::Address,
owner: soroban_sdk::Address,
) -> i128
Claim rewards through the installed proxy. Requires RWD_HARV.
Soroban has no delegatecall, so like the wrapper this is a dynamic
cross-contract call: the caller names the proxy entry point
(function) and passes its args.
fn claim_rewards(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
function: soroban_sdk::Symbol,
args: soroban_sdk::Vec,
) -> soroban_sdk::Val
The installed rewards proxy, or None when unset.
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,
)
Preview redeem of PT shares into underlying assets.
fn preview_redeem(env: soroban_sdk::Env, shares: i128) -> i128
Redeem PT shares for IBT shares instead of underlying.
fn redeem_for_ibt(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
shares: i128,
receiver: soroban_sdk::Address,
owner: soroban_sdk::Address,
) -> i128
Preview deposit with the headline tokenization fee (no user discount).
fn preview_deposit(env: soroban_sdk::Env, assets: i128) -> i128
Max withdrawable IBT shares for owner. Returns 0 when paused.
fn max_withdraw_ibt(env: soroban_sdk::Env, owner: soroban_sdk::Address) -> i128
Preview withdraw of underlying assets into required PT shares.
fn preview_withdraw(env: soroban_sdk::Env, assets: i128) -> i128
Install, replace, or clear the rewards proxy. Requires RWD_PROX.
fn set_rewards_proxy(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
proxy: Option,
)
Settle yield for both sides of a YT transfer using pre-transfer balances. Callable only by the paired YT.
fn before_yt_transfer(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
to: soroban_sdk::Address,
from_balance: i128,
to_balance: i128,
)
Claim accumulated yield as IBT shares. Settles yield, applies the yield fee,
and transfers IBT to receiver.
fn claim_yield_in_ibt(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
receiver: soroban_sdk::Address,
min_ibts: i128,
) -> i128
Preview deposit for a specific user with their fee reduction applied.
fn preview_deposit_for(
env: soroban_sdk::Env,
assets: i128,
user: soroban_sdk::Address,
) -> i128
Preview IBT deposit with the headline tokenization fee (no user discount).
fn preview_deposit_ibt(env: soroban_sdk::Env, ibts: i128) -> i128
fn transfer_admin_role(
env: soroban_sdk::Env,
new_admin: soroban_sdk::Address,
live_until_ledger: u32,
)
Convert underlying assets to PT shares using current rates.
fn convert_to_principal(env: soroban_sdk::Env, underlying: i128) -> i128
Return the current tokenization fee rate from the registry.
fn get_tokenization_fee(env: soroban_sdk::Env) -> i128
Preview withdraw of IBT shares into required PT shares.
fn preview_withdraw_ibt(env: soroban_sdk::Env, ibts: i128) -> i128
fn accept_admin_transfer(env: soroban_sdk::Env)
Convert PT shares to underlying assets using current rates.
fn convert_to_underlying(env: soroban_sdk::Env, principal: i128) -> i128
Return total accumulated fees in IBT shares.
fn get_total_fees_in_ibt(env: soroban_sdk::Env) -> i128
Freeze PT and IBT rates after expiry so all vault flows use fixed values.
Panics with NotExpired before maturity or RatesAtExpiryAlreadyStored
on a repeat call.
fn store_rates_at_expiry(env: soroban_sdk::Env)
Preview redeem of PT shares into IBT shares.
fn preview_redeem_for_ibt(env: soroban_sdk::Env, shares: i128) -> i128
Redeem with a minimum-asset guard.
Panics with SlippageProtectionFailed if delivered assets are below min_assets.
fn redeem_with_min_assets(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
shares: i128,
receiver: soroban_sdk::Address,
owner: soroban_sdk::Address,
min_assets: i128,
) -> i128
Deposit underlying with a minimum-share guard.
Panics with SlippageProtectionFailed if minted shares are below min_shares.
fn deposit_with_min_shares(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
assets: i128,
pt_receiver: soroban_sdk::Address,
yt_receiver: soroban_sdk::Address,
min_shares: i128,
) -> i128
Preview IBT deposit for a specific user with their fee reduction applied.
fn preview_deposit_ibt_for(
env: soroban_sdk::Env,
ibts: i128,
user: soroban_sdk::Address,
) -> i128
Withdraw with a maximum-share guard.
fn withdraw_with_max_shares(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
assets: i128,
receiver: soroban_sdk::Address,
owner: soroban_sdk::Address,
max_shares: i128,
) -> i128
Return unclaimed fees in IBT shares.
fn get_unclaimed_fees_in_ibt(env: soroban_sdk::Env) -> i128
Deposit IBT with a minimum-share guard.
fn deposit_ibt_with_min_shares(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
ibts: i128,
pt_receiver: soroban_sdk::Address,
yt_receiver: soroban_sdk::Address,
min_shares: i128,
) -> i128
Redeem for IBT with a minimum-IBT guard.
fn redeem_for_ibt_with_min_ibts(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
shares: i128,
receiver: soroban_sdk::Address,
owner: soroban_sdk::Address,
min_ibts: i128,
) -> i128
Withdraw IBT with a maximum-share guard.
fn withdraw_ibt_with_max_shares(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
ibts: i128,
receiver: soroban_sdk::Address,
owner: soroban_sdk::Address,
max_shares: i128,
) -> i128
Return current accumulated yield in IBT for user, net of the yield fee.
fn get_current_yield_of_user_in_ibt(
env: soroban_sdk::Env,
user: soroban_sdk::Address,
) -> i128