Contract 86cbd3d1d2b969acb6364c4a7c435ebc5cb121a977fb3a34cbeba9e5902c8bd6

← Back to Index 📥 Download WASM

Meta

binver 1.2.0
rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.93.0

Instances

  • CB5NYGO6EL7IP5DTLJOZ6XES7UCW4D2UM2M3UQGN364RQK25ZKSSWL6N

Interface

Get admin address.

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

Transfer all accumulated token balance to the Revenue Processor. Callable by admin or authorized bot.

fn sweep(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    token: soroban_sdk::Address,
) -> i128

Get bot address.

fn get_bot(env: soroban_sdk::Env) -> Option

Set authorized bot (admin-only). Bot can call sweep only.

fn set_bot(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    bot: soroban_sdk::Address,
)

Update operating fee (admin-only). Capped by max_fee_bps.

fn set_fee(env: soroban_sdk::Env, admin: soroban_sdk::Address, new_fee_bps: u32)

Upgrade contract WASM (admin-only). Admin stored as standalone Address — immune to struct evolution.

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

Get paused status.

fn is_paused(env: soroban_sdk::Env) -> bool

Transfer admin role (requires both old + new admin auth).

fn set_admin(
    env: soroban_sdk::Env,
    current_admin: soroban_sdk::Address,
    new_admin: soroban_sdk::Address,
)

Extend instance TTL (callable by anyone — permissionless).

fn extend_ttl(env: soroban_sdk::Env)

Get current configuration.

fn get_config(env: soroban_sdk::Env) -> FeeCollectorConfig

Emergency pause (admin-only).

fn set_paused(env: soroban_sdk::Env, admin: soroban_sdk::Address, paused: bool)

Execute a swap through the Aquarius Router, skimming a fee from output.

Flow:

  1. User transfers in_amount of token_in to this contract
  2. This contract calls router.swap_chained (full amount)
  3. Fee = output * fee_bps / 10000
  4. Net output transferred to user
  5. Fee retained in contract balance (swept later)

Single TX, single signature — user signs for this contract.

token_out must be passed explicitly for auth pre-computation.

fn swap_chained(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    swaps_chain: soroban_sdk::Val,
    token_in: soroban_sdk::Address,
    token_out: soroban_sdk::Address,
    in_amount: u128,
    out_min: u128,
) -> u128

Protocol 22+ constructor — flat args for Admin Bridge compatibility.

  • max_fee_bps: Immutable hard cap (recommended: 200 = 2%)
  • fee_bps: Operating fee (recommended: 100 = 1%)
fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    aquarius_router: soroban_sdk::Address,
    revenue_processor: soroban_sdk::Address,
    max_fee_bps: u32,
    fee_bps: u32,
)

Imports

WebAssembly Text (WAT) ▶