Contract 3afca1034f133569a907b2bc1c7436e16e09eddae4bfcf56e0932dfb53a50acf

← Back to Index 📥 Download WASM

Meta

cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdkver 27.0.6#60926a20d1f9f0a669d5fe551636f42a1302f0c0
rsver 1.94.1

Instances

  • CAVNAZFNJU63OFO7XRFQF3FBEVNBQ2SQNJY2A2AJFBGCUNCQK6J5HLER

Interface

Stops both swap entrypoints. Admin.

fn pause(env: soroban_sdk::Env)
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)

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, and the two fee dials.

fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    treasury: soroban_sdk::Address,
    protocol_bps: u32,
    min_partner_bps: u32,
)

Swaps exactly amount_in of token_in for at least min_out of token_out through invocations, run with this contract as caller. Returns the amount of token_out delivered. Fee in token_in per §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,
    invocations: soroban_sdk::Vec,
    sweep: 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 fee is taken on the input the legs consumed (§5.5). Returns the input spent, legs 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,
    invocations: soroban_sdk::Vec,
    sweep: 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)

Imports

WebAssembly Text (WAT) ▶