Returns the current Ownable owner; panics with Error::NotAdmin if unset.
A convenience wrapper over [Ownable::get_owner] for callers that want a hard failure
rather than an Option; both read the same Ownable slot.
fn admin(env: soroban_sdk::Env) -> soroban_sdk::Address
Upgrade contract WASM. Owner only.
fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)
Returns the referral config for id, or None if it does not exist.
fn referral(env: soroban_sdk::Env, id: u64) -> Option
Returns the current owner, or None if ownership has been renounced or was never set.
fn get_owner(env: soroban_sdk::Env) -> Option
Create a referral; returns the new id. Owner only.
fn add_referral(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
fee_bps: u32,
) -> u64
Set admin as Ownable owner.
The static fee and referral counter are deliberately left unwritten:
storage::static_fee_bps and storage::referral_counter both default to
zero on a missing key, so writing zeros here only bought two instance
entries' worth of rent.
fn __constructor(env: soroban_sdk::Env, admin: soroban_sdk::Address)
Recover non-fee token balances to recipient. Leaves fee buckets intact. Owner only.
fn sweep_balance(
env: soroban_sdk::Env,
recipient: soroban_sdk::Address,
tokens: soroban_sdk::Vec,
)
Returns whether token is on the fee whitelist.
fn is_whitelisted(env: soroban_sdk::Env, token: soroban_sdk::Address) -> bool
Set the protocol static fee in bps (<= FEE_CAP). Owner only.
fn set_static_fee(env: soroban_sdk::Env, fee_bps: u32)
Returns the protocol static fee in basis points.
fn static_fee_bps(env: soroban_sdk::Env) -> u32
Completes a pending ownership transfer. Requires authorization from the pending owner.
fn accept_ownership(env: soroban_sdk::Env)
Mark token as fee-whitelisted (affects input-side fee selection). Owner only.
fn add_to_whitelist(env: soroban_sdk::Env, token: soroban_sdk::Address)
Pay out accrued admin fee balances for tokens. Owner only.
fn claim_admin_fees(
env: soroban_sdk::Env,
recipient: soroban_sdk::Address,
tokens: soroban_sdk::Vec,
)
Decode swap_xdr as StrategyPayload and execute it.
Pulls total_in from sender, runs optional LP burn/paths/mint, applies
fees, enforces total_min_out, and returns delivered output.
fn execute_strategy(
env: soroban_sdk::Env,
sender: soroban_sdk::Address,
total_in: i128,
swap_xdr: soroban_sdk::Bytes,
) -> i128
Returns the highest referral id issued so far.
fn referral_counter(env: soroban_sdk::Env) -> u64
Update a referral's fee bps. Owner only.
fn set_referral_fee(env: soroban_sdk::Env, id: u64, fee_bps: u32)
Returns the accrued admin fee balance for token.
fn admin_fee_balance(env: soroban_sdk::Env, token: soroban_sdk::Address) -> i128
Clears the current owner. Requires current-owner authorization and panics if a transfer is pending.
fn renounce_ownership(env: soroban_sdk::Env)
Transfer claim rights for a referral. Owner only.
fn set_referral_owner(env: soroban_sdk::Env, id: u64, new_owner: soroban_sdk::Address)
Starts a two-step ownership transfer to new_owner, acceptable until ledger
live_until_ledger. Requires current-owner authorization; overrides any
pending transfer.
fn transfer_ownership(
env: soroban_sdk::Env,
new_owner: soroban_sdk::Address,
live_until_ledger: u32,
)
Returns the full fee-whitelist token list.
fn whitelisted_tokens(env: soroban_sdk::Env) -> soroban_sdk::Vec
Pay out accrued fees for referral id to its configured owner.
fn claim_referral_fees(
env: soroban_sdk::Env,
id: u64,
tokens: soroban_sdk::Vec,
)
Activate or deactivate a referral. Owner only.
fn set_referral_active(env: soroban_sdk::Env, id: u64, active: bool)
Returns the accrued referral fee balance for (id, token).
fn referral_fee_balance(
env: soroban_sdk::Env,
id: u64,
token: soroban_sdk::Address,
) -> i128
Remove token from the fee whitelist. Owner only.
fn remove_from_whitelist(env: soroban_sdk::Env, token: soroban_sdk::Address)