Contract 65b9c52b4ef5aa0fa5ae5c50f95e548ec9c24e495f52c9a854fe1bf1faab2c53

← Back to Index 📥 Download WASM

Meta

cliver 26.0.0#60f7458e7ecffddf2f2d91dc6d0d2db4fab03ecc
rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.95.0

Instances

  • CBNNUKFESGSVPWQHPUFB5MWBWU7LOWV4HU4EXWQ4J4JBRYCVNIVSFJEN

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. swap via the Soroswap router (proceeds land on this contract)
  4. enforce amount_out_min on the output
  5. forward the proceeds to user

Returns the amount of token_out delivered.

fn swap_soroswap(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    soroswap_router: 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) ▶