Current admin (read-only).
fn admin(env: soroban_sdk::Env) -> soroban_sdk::Address
Execute a multi-hop atomic arb.
Flow:
caller authorises this invocation (must include token transfer auth).amount_in of token_in from caller.min_final_out; panics if below.caller.For cyclic arbs, token_in equals the last hop's output token.
Returns the final output amount.
fn execute(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
token_in: soroban_sdk::Address,
amount_in: i128,
min_final_out: i128,
hops: soroban_sdk::Vec,
) -> i128
Replace this contract's WASM with the code identified by new_wasm_hash (which must already
be installed on-chain). Admin-gated; instance storage (the admin) is preserved across the
upgrade. Takes effect for invocations after this transaction.
fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)
On-chain code version. Bump on each upgrade so callers can detect which WASM is live.
fn version(env: soroban_sdk::Env) -> u32
Rotate the upgrade admin. Admin-gated by the current admin.
fn set_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)
Execute a multi-hop atomic swap along an OPEN path (token_in need NOT equal the final
output token).
Identical to [Self::execute] except it drops the NotCyclic invariant: the route is a leg
token_in → … → token_out, not a closed cycle. min_final_out is denominated in the route's
FINAL output token, and those final tokens are returned to caller. Returns the final amount.
This is the Soroban segment primitive for the mixed (native↔soroban) lane: a mixed cycle
crosses the lane boundary and so executes as a sequence of single-lane txs, and every such
Soroban segment is an open leg (e.g. M→XLM), never a self-contained cycle. The per-hop and
final amount_out_min/min_final_out guards still make a decayed leg revert atomically —
what they CANNOT do is unwind an already-completed earlier segment in a different tx; that
inventory risk is the multi-tx caller's to manage, not the contract's.
fn execute_open(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
token_in: soroban_sdk::Address,
amount_in: i128,
min_final_out: i128,
hops: soroban_sdk::Vec,
) -> i128
Set the upgrade admin at deploy time. Runs exactly once, atomically with deployment, so the
contract is never live without an admin. admin is the only address that can later call
[Self::upgrade] or [Self::set_admin].
fn __constructor(env: soroban_sdk::Env, admin: soroban_sdk::Address)