Contract b0b352c582c7c0267a8abf6bb39ba64738f09535b29d4ce24a1c998ca06f3be0

← Back to Index 📥 Download WASM

Meta

cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdkver 26.1.0#175aa41306f383057a8cdfc84b68d931664fc34e
rsver 1.97.1

Instances

  • CB4TYB2XDY4RM2PUBGAOCNGFC7NZYXJLVTIF6FWNSZSZZCDSMUT44ZYY
  • CBCVP4NQZIKMMJJ5AORGG4AM22GXQFMAUGR3A3EQXONTSV44OATKKYZH
  • CBFU74OOWIL2STHJGZJTCDUHPPDOGQ5QB3EDWTCKXFSGSG5J7YLXXGKP
  • CBOGO4QXXZSYTO2YXATP4CHMOZWLVDPC2DFMGXXA4J4MAMJTDFF5QKAB
  • CBV7XHTTXINHJ7GE72RD5GJ6OC6HJLKLM77MLGZ7MN3ZACAYVF5UO5A2
  • CC3F57FFHFOCKVZPXRAEFJHA3XKMWQFUZ4PKTFFB6HG7QJ37IECRA5XT
  • CC6QOPJ6CSSKJ3B5X6TOHDCD5JU6IVKWJMO5UOXPUFX3K2K4UFADAFEG
  • CCISGS77DTSKCBTKAVZ3ZDUNQYQVGSCVGUYD6UNB3KNQBEQ4BXUX3FTP
  • CCND3OPXG3KIX35KG7GAIYOBEAKX7JTN4MAHR23IV2B6EW3XK4P7K42J
  • CCNVU5VYKP3HBZE7P2SS7F77NLK4YEJKPC3BINLPZLMAA2JJYD5BSFQG
  • CCQU5J2AYVLGLNFW7QK6CWC3HA2LZ7WZMKPFLIZPXGKZFHA3MK4YZ6OV
  • CCZYL2SJ2GWGKS4B3EUEDI22ZPA54F52BEIN5MJKSFY37XEVLTE6AJJT
  • CD5WWDIPHXXU3PLS2ZV4UF7SQYVJJK35VHXL5WVDRP5CLRVUA4WRM2JS
  • CDDCOOYJ4EOXEOYZHQKG4WIJ6DGP5UBHGTTLSTKWG7W3WES2I4ERMXZN
  • CDIU2LA22VQCB5WIWE5WHKNIRCI6VYUBAFQP7DP3Q5HARO3UJHVETPFC
  • CDMM6P2AKKWL44353UCZCV56QMM5TJBT7CWVNEJ5WNZV3PFULYPR6XXW

Interface

Pull asset, convert ALL of it into target in at most ONE swap, and record the measured proceeds as a pending per-vault deposit plan. Deposits nothing. Auth: owner.

The overflow path for deposits too large to fit one transaction: the user's cost is a single signature regardless of how many vaults they picked.

fn fund(
    env: soroban_sdk::Env,
    asset: soroban_sdk::Address,
    total: i128,
    swap: MaybeSwap,
    target: soroban_sdk::Address,
    plan: soroban_sdk::Vec,
    deadline: u64,
) -> Result<(), soroban_sdk::Error>
fn admin(env: soroban_sdk::Env) -> soroban_sdk::Address

The NEXT step-wise rebalance op nonce.

Read by anything that assembles a rebalance op — the relay's manual flow and the keeper's executor both need the LIVE value, not a mirrored one. Without this view they would have to trust the indexer's strategies.nonce, and a mirror that lags by one op makes every subsequent op fail BadNonce.

fn nonce(env: soroban_sdk::Env) -> u64
fn owner(env: soroban_sdk::Env) -> soroban_sdk::Address

Pause invest/rebalance (withdraw stays open). Auth: admin.

fn pause(env: soroban_sdk::Env)

The pending deposit intent, or None.

fn intent(env: soroban_sdk::Env) -> Option

Pull asset, deposit across allocations by weight, record positions — atomically. Auth: owner.

swaps maps each vault UNDERLYING that differs from asset to the single swap leg used to reach it: one router call per distinct underlying, not per allocation. That is a hard budget constraint, not a preference — the fourth router call in a transaction exceeds the memory limit regardless of leg count (see invest.rs).

fn invest(
    env: soroban_sdk::Env,
    asset: soroban_sdk::Address,
    total: i128,
    allocations: soroban_sdk::Vec,
    swaps: soroban_sdk::Map,
) -> Result<(), soroban_sdk::Error>

Emergency: pull a vault's funds to the Owner if its protocol bricks redeem. Auth: admin. No fee; callable even when Paused.

fn rescue(
    env: soroban_sdk::Env,
    vault: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Lift the pause. Auth: admin.

fn unpause(env: soroban_sdk::Env)

Replace the contract Wasm. Auth: admin (checked BEFORE the swap).

fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)

Withdraw amount (underlying; i128::MAX = whole position) from one vault back to the owner. Auth: owner. Allowed even when Paused. Both WithdrawOut variants are handled live (see withdraw.rs::deliver); a cross-asset Normalize reverts AdapterError while the Router is unset (dormant), not by shape.

fn withdraw(
    env: soroban_sdk::Env,
    vault: soroban_sdk::Address,
    amount: i128,
    out: WithdrawOut,
) -> Result<(), soroban_sdk::Error>
fn is_paused(env: soroban_sdk::Env) -> bool

Ledger state + raw shares_held per open vault. Display value is computed off-chain (no on-chain value read).

fn positions(env: soroban_sdk::Env) -> soroban_sdk::Vec

Deposit the pending intent's leg for vault and remove that leg.

Auth: permissionless before Intent.deadline (the caller pays their own fee and chooses nothing); owner-only afterwards. Idempotent — a filled leg is gone, so a replay answers IntentLegNotFound.

fn fill_intent(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    intent_id: u64,
    vault: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Accept a proposed admin rotation (step 2 of 2). Auth: the nominee.

fn accept_admin(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>

Withdraw every position in full + drain caller-named idle assets. Skips a vault whose redeem reverts (exit-liveness). Auth: owner.

fn withdraw_all(
    env: soroban_sdk::Env,
    out: WithdrawOut,
    extra_idle: soroban_sdk::Vec,
) -> Result<(), soroban_sdk::Error>

Deploy-time init (Protocol-22 __constructor, atomic with deploy). Writes Owner/Admin/Registry/Paused + the IMMUTABLE auto_rebalance choice; Nonce/IntentSeq follow the read-default rule.

auto_rebalance is set here and never again. It does two jobs: it gates the keeper (keeper.rs::authorize) and it selects the fee rate (fee_bps for a manual strategy, fee_bps + delta for an auto one). Making it immutable is what removes the rate-change settle and banked_fee entirely (doc 13).

fn __constructor(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    admin: soroban_sdk::Address,
    registry: soroban_sdk::Address,
    auto_rebalance: bool,
)

Drop the pending intent; the funds stay as idle balance. Auth: owner.

fn cancel_intent(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>

The IMMUTABLE create-time auto-rebalance choice. Never changes.

fn auto_rebalance(env: soroban_sdk::Env) -> bool

Drop the bookkeeping row for a vault holding ZERO shares. Auth: owner. Refuses (PositionNotEmpty) while any share remains, and propagates a trapping balance read rather than treating it as empty.

fn close_position(
    env: soroban_sdk::Env,
    vault: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Convert idle asset_in → asset_out via the whitelisted router (measured output ≥ amount_out_min). Auth: owner or keeper. Nonce-guarded.

fn rebalance_swap(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    nonce: u64,
    asset_in: soroban_sdk::Address,
    asset_out: soroban_sdk::Address,
    amount_in: i128,
    swap: SwapLeg,
) -> Result<(), soroban_sdk::Error>

Propose an admin rotation (step 1 of 2). Auth: current admin. Takes effect only once the nominee calls accept_admin.

fn transfer_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)

Emit a RebalanceNoOp receipt (target breached, no feasible move). Auth: owner or keeper. No state change; consumes no nonce.

fn note_no_rebalance(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    reason: soroban_sdk::Symbol,
    observed_bps: u32,
    target_bps: u32,
) -> Result<(), soroban_sdk::Error>

Deposit idle asset into a whitelisted active vault (debt-free). Auth: owner or keeper. Nonce-guarded.

fn rebalance_deposit(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    nonce: u64,
    vault: soroban_sdk::Address,
    asset: soroban_sdk::Address,
    amount: i128,
) -> Result<(), soroban_sdk::Error>

Redeem from a vault → fee → keep proceeds idle. Auth: owner or Registry keeper (gated by the immutable AutoRebalance + keeper_enabled). Nonce-guarded.

fn rebalance_withdraw(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    nonce: u64,
    vault: soroban_sdk::Address,
    amount: i128,
) -> Result<(), soroban_sdk::Error>

Imports

WebAssembly Text (WAT) ▶