Contract 939eda257cd15aa6d674ba4e484285ab8d12f48400a6ea56ba860c91e5c1ffcc

← Back to Index šŸ“„ Download WASM

Meta

rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.95.0

Instances

  • CC6QAV7JEG5MYRSPO5Z65E5G2M4ZB64BEG2ZXIZXL55TQT35JDI2LC6K

Interface

Execute a single-path multi-hop swap atomically.

Delegates to split_swap internally — wraps the steps as a single sub-route.

fn swap(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    token_in: soroban_sdk::Address,
    amount_in: i128,
    steps: soroban_sdk::Vec,
    min_amount_out: i128,
) -> i128

Get the admin address.

fn admin(env: soroban_sdk::Env) -> soroban_sdk::Address

Upgrade the contract WASM code. Only admin can call.

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

Initialize the contract with an admin address. Must be called once after deployment.

fn initialize(env: soroban_sdk::Env, admin: soroban_sdk::Address)

Execute a split-order swap atomically.

Splits the input across multiple paths for better execution: e.g., 30% via Soroswap (A→B), 70% via Aquarius (A→C→B)

Flow:

  1. Pull total amount_in of token_in from user
  2. For each sub-route: execute its path with its allocated amount
  3. Sum all outputs (must all produce the same token_out)
  4. Verify total output >= min_amount_out
  5. Transfer total output to user

All sub-routes MUST produce the same output token.

fn split_swap(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    token_in: soroban_sdk::Address,
    token_out: soroban_sdk::Address,
    sub_routes: soroban_sdk::Vec,
    min_amount_out: i128,
) -> i128

Imports

WebAssembly Text (WAT) ā–¶