Contract 318e477634a134419d7e8996bcd335afa95c073167539bce8352db682dcbe656

← Back to Index 📥 Download WASM

Meta

binver 1.4.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>,
)

Sweep all accumulated token balance to an arbitrary destination. Used by the revenue relay to redirect fees directly to the Revenue Vault (or any other destination), bypassing the Revenue Processor.

v1.3.0 — Callable by admin or authorized bot.

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

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,
)

Public, permissionless sweep hook to push accumulated fees to the Revenue Vault. Can be called by anyone (e.g. automatically on Vault deposit). Prevents front-running dilution by sweeping fees before shares are issued.

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

Get revenue vault.

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

Set authorized Revenue Vault (admin-only). Target for public sweep hook.

fn set_revenue_vault(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    vault: soroban_sdk::Address,
)

Imports

WebAssembly Text (WAT) ▶