Called once at deploy time by the Soroban runtime.
admin — address that can upgrade, pause, rescue, and transfer admin rolevault — vault runtime contract; the only address allowed to call supply/withdrawpool — recipient EOA that receives supplied funds and must return them before withdrawalfn __constructor(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
vault: soroban_sdk::Address,
pool: soroban_sdk::Address,
) -> Result<(), ContractError>
fn set_paused(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
paused: bool,
) -> Result<(), ContractError>
fn paused(env: soroban_sdk::Env) -> bool
Called by the vault runtime when the curator allocates to this market.
The vault transfers amount of asset to this adapter's address, then
calls this function. The adapter forwards the balance to the pool EOA.
Returns the actual amount forwarded (capped at available balance).
fn supply(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
asset: soroban_sdk::Address,
amount: i128,
) -> Result
Called by the vault runtime when the curator withdraws from this market.
The pool EOA must have already returned funds to this adapter's address before this is called (off-chain step). Returns the actual amount sent back.
fn withdraw(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
asset: soroban_sdk::Address,
amount: i128,
) -> Result
Identical to withdraw for this custodial adapter.
In Blend-style adapters this triggers a queued redemption from a lending pool. Here, all withdrawal sequencing happens off-chain: the operator returns funds to this adapter address before the vault runtime calls this function.
fn progress_withdrawal(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
asset: soroban_sdk::Address,
amount: i128,
) -> Result
Emergency admin function to recover any asset held by this adapter.
fn rescue(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
asset: soroban_sdk::Address,
amount: i128,
receiver: soroban_sdk::Address,
) -> Result
Returns the current asset balance held by this adapter.
Called by the vault runtime during market accounting refreshes.
fn total_assets(
env: soroban_sdk::Env,
asset: soroban_sdk::Address,
) -> Result
Step 1 of two-step admin transfer: nominate a new admin (current admin only).
fn set_admin(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
admin: soroban_sdk::Address,
) -> Result<(), ContractError>
Step 2 of two-step admin transfer: accept the nomination (pending admin only).
fn accept_admin(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
) -> Result<(), ContractError>
fn pending_admin(env: soroban_sdk::Env) -> Result
Extend this contract's instance storage TTL. Anyone may call this.
fn extend_ttl(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
) -> Result<(), ContractError>
Upgrade the contract WASM (admin only).
fn upgrade(
env: soroban_sdk::Env,
new_wasm_hash: soroban_sdk::BytesN<32>,
operator: soroban_sdk::Address,
)
fn admin(env: soroban_sdk::Env) -> Result
fn vault(env: soroban_sdk::Env) -> Result
fn pool(env: soroban_sdk::Env) -> Result