Configure the adapter.
The custodian may be either an account or contract address. It is the
operational address that receives allocated funds and is expected to
return assets to this adapter before vault withdrawals are progressed.
fn __constructor(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
vault: soroban_sdk::Address,
custodian: soroban_sdk::Address,
asset: soroban_sdk::Address,
) -> Result<(), AdapterError>
Pause or unpause new vault allocation and reported-NAV update operations.
While paused, vault and custodian report updates are blocked. The admin
may still call set_reported_assets to correct NAV during recovery.
fn set_paused(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
paused: bool,
) -> Result<(), AdapterError>
fn paused(env: soroban_sdk::Env) -> bool
Forward allocated funds to the configured custodian and increase the
adapter's reported route NAV by amount.
Reported route NAV is the amount attributed to this adapter that has not yet been released back to the vault. It includes both offchain position value and any returned idle liquidity still held by this adapter.
fn supply(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
asset: soroban_sdk::Address,
amount: i128,
) -> Result<(), AdapterError>
Withdraw exactly amount of returned idle liquidity to the vault.
This compatibility method is exact-only because it does not return the
realized amount. Use progress_withdrawal when partial settlement is
acceptable and the caller can account for the amount actually released.
Settlement remains available while paused so already returned liquidity
can be recovered during an incident.
fn withdraw(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
asset: soroban_sdk::Address,
amount: i128,
) -> Result<(), AdapterError>
Progress a vault withdrawal using only assets already returned to this adapter. This method does not initiate any offchain market exit, and remains available while paused so returned liquidity can be recovered.
fn progress_withdrawal(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
asset: soroban_sdk::Address,
amount: i128,
) -> Result
Return the adapter's reported route NAV for asset.
Returned idle balance is intentionally not auto-added here because
reported route NAV already includes liquidity that has returned to this
adapter but has not yet been released to the vault. Operators should use
set_reported_assets for explicit NAV updates when offchain route value
changes, and should avoid reporting only the offchain remainder while
returned liquidity is still pending on this adapter.
fn total_assets(env: soroban_sdk::Env, asset: soroban_sdk::Address) -> i128
Explicitly set reported route NAV for asset.
The configured custodian is allowed to report NAV because custody of the
offchain position is already part of this adapter's trust boundary. This
keeps reporting usable when the admin is a governance contract. The
amount must represent total route NAV not yet released to the vault, not
only the offchain remainder when returned idle liquidity is pending.
report_nonce must be exactly one greater than the current report
nonce; every successful NAV mutation advances this same revision.
Pause blocks vault and custodian reporting, but intentionally leaves an admin recovery path for emergency NAV correction.
fn set_reported_assets(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
asset: soroban_sdk::Address,
expected_current: i128,
amount: i128,
report_nonce: u64,
) -> Result<(), AdapterError>
fn admin(env: soroban_sdk::Env) -> Result
fn pending_admin(env: soroban_sdk::Env) -> Result
fn vault(env: soroban_sdk::Env) -> Result
fn custodian(env: soroban_sdk::Env) -> Result
fn asset(env: soroban_sdk::Env) -> Result
fn report_nonce(
env: soroban_sdk::Env,
asset: soroban_sdk::Address,
) -> Result
Propose a new admin. The pending admin must accept in a separate call.
fn set_admin(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
admin: soroban_sdk::Address,
) -> Result<(), AdapterError>
Accept admin role previously proposed with set_admin.
fn accept_admin(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
) -> Result<(), AdapterError>
Extend instance storage TTL.
This is intentionally open: extending TTL is a liveness operation, and the transaction caller pays the Soroban resource cost.
fn extend_ttl(env: soroban_sdk::Env) -> Result<(), AdapterError>
fn upgrade(
env: soroban_sdk::Env,
new_wasm_hash: soroban_sdk::BytesN<32>,
operator: soroban_sdk::Address,
)