Contract 9467dbe879165315568ab9868eb997a9ed807f9f6fd226aebf90e016d395b1fb

← Back to Index 📥 Download WASM

Meta

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

Instances

  • CCIGFRCEKN33YOGN37URMPPCWLJ43U2BXNHCLKH7LKUXJJAUTJMFVASK

Interface

fn config(env: soroban_sdk::Env) -> Config

Bookkeeping only: the aggregator has already transferred amount of token in the same transaction. Passes only for an allowlisted aggregator that is the direct invoker. A replayed entry could only come from an allowlisted aggregator whose own config.treasury is a different contract, so an aggregator is delisted here before its treasury is ever repointed (§5.8).

fn credit(
    env: soroban_sdk::Env,
    aggregator: soroban_sdk::Address,
    partner: soroban_sdk::Symbol,
    token: soroban_sdk::Address,
    amount: i128,
)

Swaps treasury-held token_in for token_out through an allowlisted aggregator, pooled per token, with this contract as the fee-exempt user. Keeper only. The keeper chooses the routes and min_out: v3 §6.4 states what a stolen key can do.

fn convert(
    env: soroban_sdk::Env,
    aggregator: soroban_sdk::Address,
    token_in: soroban_sdk::Address,
    amount_in: i128,
    token_out: soroban_sdk::Address,
    min_out: i128,
    routes: soroban_sdk::Vec,
) -> i128

In-place upgrade to an already uploaded wasm. Admin.

fn upgrade(env: soroban_sdk::Env, wasm_hash: soroban_sdk::BytesN<32>)

Cumulative gross credited to partner in token.

fn credited(
    env: soroban_sdk::Env,
    partner: soroban_sdk::Symbol,
    token: soroban_sdk::Address,
) -> i128

Sends amount of token to to, which must be the payout account, muxed or not. Keeper only. There is no free-destination withdraw; changing the destination is an admin call to set_payout.

fn withdraw(
    env: soroban_sdk::Env,
    token: soroban_sdk::Address,
    amount: i128,
    to: soroban_sdk::MuxedAddress,
)

Admin. Also how a stolen keeper key is revoked.

fn set_keeper(env: soroban_sdk::Env, keeper: soroban_sdk::Address)

Admin. The only way to change where withdraw can send funds.

fn set_payout(env: soroban_sdk::Env, payout: soroban_sdk::Address)

Second half: the pending admin signs.

fn accept_admin(env: soroban_sdk::Env)

Deploys with the admin, the keeper (api hot key), the payout G-account and the initial aggregator allowlist (empty at first deploy, see §11 deploy order).

fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    keeper: soroban_sdk::Address,
    payout: soroban_sdk::Address,
    aggregators: soroban_sdk::Vec,
)

Admin. Idempotent: listing a listed address or delisting an absent one is a no-op.

fn set_aggregator(
    env: soroban_sdk::Env,
    aggregator: soroban_sdk::Address,
    allowed: bool,
)

First half of the admin rotation. Admin.

fn transfer_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)

Imports

WebAssembly Text (WAT) ▶