Contract 63cc9ddab3b68f0bdf7d8a8db4d8cd2eeefd3ac6c1ca7e87204abcf956463e29

← 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 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_to is read from storage, never the caller.

Effective fee resolution (a caller can never raise the fee

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,
    fee_ppm_override: Option,
) -> Result
fn account_fee(env: soroban_sdk::Env, account: soroban_sdk::Address) -> Option
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 fee_authorizer(env: soroban_sdk::Env) -> Option

Set a per-account fee override in ppm (e.g. 0 for an internal service account that should swap fee-free). Applies automatically on every swap by account, ahead of the default fee and any per-swap voucher.

fn set_account_fee(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    account: soroban_sdk::Address,
    fee_ppm: u32,
) -> Result<(), SwapError>

Remove an account's fee override (it reverts to the default fee).

fn clear_account_fee(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    account: 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>

Register the address whose signature authorizes per-swap fee overrides (the backend's referral-discount signer).

fn set_fee_authorizer(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    authorizer: soroban_sdk::Address,
) -> Result<(), SwapError>

Imports

WebAssembly Text (WAT) ā–¶