Stops both swap entrypoints. Admin.
fn pause(env: soroban_sdk::Env)
Moves this contract's whole balance of token to the treasury (§5.10). Admin. The
treasury is the only destination, so there is no address to get wrong; the keeper
converts or withdraws from there under the treasury's rules. A zero balance is not an
error. Only intermediate dust can ever be here: every hop pulls exactly its input and
the swap refunds any leftover input.
fn sweep(env: soroban_sdk::Env, token: soroban_sdk::Address) -> i128
fn config(env: soroban_sdk::Env) -> Config
Admin.
fn unpause(env: soroban_sdk::Env)
In-place upgrade to an already uploaded wasm. Admin.
fn upgrade(env: soroban_sdk::Env, wasm_hash: soroban_sdk::BytesN<32>)
Sets the protocol fee and the partner floor. Admin.
fn set_fees(env: soroban_sdk::Env, protocol_bps: u32, min_partner_bps: u32)
Repoints the Soroswap and Aqua routers (§5.2). Admin. Pools of the other venues are named per hop and need no setting.
fn set_routers(
env: soroban_sdk::Env,
soroswap_router: soroban_sdk::Address,
aqua_router: soroban_sdk::Address,
)
Second half: the pending admin signs.
fn accept_admin(env: soroban_sdk::Env)
Points fees at another treasury. Admin.
fn set_treasury(env: soroban_sdk::Env, treasury: soroban_sdk::Address)
Deploys with the admin, the treasury fees go to, the two fee dials and the two venue routers (§5.1).
fn __constructor(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
treasury: soroban_sdk::Address,
protocol_bps: u32,
min_partner_bps: u32,
soroswap_router: soroban_sdk::Address,
aqua_router: soroban_sdk::Address,
)
Swaps exactly amount_in of token_in for at least min_out of token_out through
routes, each route's hops run in order with this contract as caller and each hop's
returned amount feeding the next. Returns the amount of token_out delivered. Fee in
token_in per v3 §5.3; the routes' shares add up to the post-fee amount (§5.3). §5.4
lists the steps in order.
fn swap_exact_in(
env: soroban_sdk::Env,
user: soroban_sdk::Address,
token_in: soroban_sdk::Address,
amount_in: i128,
token_out: soroban_sdk::Address,
min_out: i128,
routes: soroban_sdk::Vec,
partner: Option,
) -> i128
Buys at least amount_out of token_out (everything delivered is paid out) for at
most max_in of token_in, fee included. The routes are exact-in hops sized by the
api from a forward quote; the fee is taken on the input they consumed (§5.5). Returns
the input spent, hops plus fee.
fn swap_exact_out(
env: soroban_sdk::Env,
user: soroban_sdk::Address,
token_in: soroban_sdk::Address,
max_in: i128,
token_out: soroban_sdk::Address,
amount_out: i128,
routes: soroban_sdk::Vec,
partner: Option,
) -> i128
First half of the admin rotation. Admin.
fn transfer_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)