Contract 1ee885769eeb210e9a9aa18fbb9f4b17ace5e247a8aaf8b57f76b81ae8e2d143

← Back to Index 📥 Download WASM

Meta

cliver 26.0.0#60f7458e7ecffddf2f2d91dc6d0d2db4fab03ecc
rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.95.0

Instances

  • CC6K3ODF7BKC6C2HZODTMLDWIJGXH3ACIX7YYJ2IQEV64GMDCEKGXUGV

Interface

Execute one Soroswap swap along path on behalf of user.

Flow:

  1. user authorizes this invocation
  2. pull amount_in of token_in from user into this contract
  3. pre-authorize the router to pull token_in from this contract into the Soroswap pool, then call the router
  4. enforce amount_out_min on the output
  5. forward the proceeds to user

pool is the Soroswap pair contract for (token_in, token_out). It is an explicit argument only for the S1 single-hop case; the S4 multi-stage executor derives the auth subtree from the plan.

Returns the amount of token_out delivered.

fn swap_soroswap(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    soroswap_router: soroban_sdk::Address,
    pool: soroban_sdk::Address,
    token_in: soroban_sdk::Address,
    token_out: soroban_sdk::Address,
    amount_in: i128,
    amount_out_min: i128,
    path: soroban_sdk::Vec,
    deadline: u64,
) -> i128

Imports

WebAssembly Text (WAT) ▶