Contract d7161bac4b09c709d1b2d05b4f6883c7d6c186200aa418e66ccbc559cfd4f5d0

← Back to Index šŸ“„ Download WASM

Meta

cliver 26.0.0#60f7458e7ecffddf2f2d91dc6d0d2db4fab03ecc
rssdkver 26.0.0#e1bf74ba6c3ddb591593f5eb5dfb85458ff714c1
rsver 1.96.0

Instances

  • CAVDUEGLKNHTKDOBNOKRH3C4T75OBYGOBJO2GGG3MSLTOS4SO7SQ5ETT

Interface

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

Drain stranded balances (incl. accumulated, not-yet-converted fees). amount = 0 sweeps the full balance.

fn sweep(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    asset: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
) -> Result
fn fee_to(env: soroban_sdk::Env) -> Option
fn fee_ppm(env: soroban_sdk::Env) -> u32
fn set_fee(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    fee_ppm: u32,
) -> Result<(), SwapError>
fn upgrade(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    new_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), SwapError>
fn version(env: soroban_sdk::Env) -> u32

Allow/deny a swap target and a set of function names in one call (the discovery job uses this to register newly-qualified pools).

fn allow_pool(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    target: soroban_sdk::Address,
    fns: soroban_sdk::Vec,
    allowed: bool,
) -> Result<(), SwapError>

Aggregated, atomic swap with a platform-fee skim.

  • user: the trader and transaction source (single signature).
  • asset_in / total_amount_in: pulled from user into the contract.
  • asset_out / min_total_out: revert unless the contract nets at least min_total_out of asset_out across all routes.
  • routes: the split — each Route.amount_in of asset_in through its own path. sum(amount_in) must equal total_amount_in - fee. A path of more than one Step is a chained multi-hop (A→C→B): each hop after the first swaps exactly what the previous hop deposited into the router (its Step.amount_in is advisory only), so the intermediate amount never has to be predicted at signing time.

The fee_ppm skim is retained in the contract in the input asset and swept/converted to the fee asset later by the owner (deferred — avoids a second in-band swap in every user transaction). fee_ppm/fee_to are read from storage, never the caller.

fn swap_split(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    asset_in: soroban_sdk::Address,
    total_amount_in: i128,
    asset_out: soroban_sdk::Address,
    min_total_out: i128,
    routes: soroban_sdk::Vec,
) -> Result
fn update_owner(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    new_owner: soroban_sdk::Address,
) -> Result<(), SwapError>
fn __constructor(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    fee_ppm: u32,
    fee_to: soroban_sdk::Address,
    fee_asset: soroban_sdk::Address,
)
fn is_fn_allowed(
    env: soroban_sdk::Env,
    target: soroban_sdk::Address,
    fn_name: soroban_sdk::Symbol,
) -> bool
fn set_fee_token(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    fee_asset: soroban_sdk::Address,
) -> Result<(), SwapError>
fn is_target_allowed(env: soroban_sdk::Env, target: soroban_sdk::Address) -> bool
fn set_fee_recipient(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    fee_to: soroban_sdk::Address,
) -> Result<(), SwapError>

Imports

WebAssembly Text (WAT) ā–¶