Contract ed9d38f4f6c63858eb71be609bbc2a6d3a4e35bb3bd0ee97db838470d5a6dffb

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.95.0

Instances

  • CDGQ7K4XGAPG3YJVAGHCE45XOR63HLD6ARJCRESEEKSRQZSIRAKG6F6V

Interface

Initialize the contract. Caller becomes admin. Only callable once. caller.require_auth() prevents front-running — the first authenticated caller to invoke init is the admin.

fn init(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    oracle: soroban_sdk::Address,
)

Retrieve admin address

fn admin(env: soroban_sdk::Env) -> soroban_sdk::Address

Pause all escrow operations (admin only)

fn pause(env: soroban_sdk::Env)

Admin cancels an escrow (refunds to sender)

fn cancel(env: soroban_sdk::Env, escrow_id: u64)

Sender reclaims tokens after timeout

fn refund(env: soroban_sdk::Env, escrow_id: u64)

Admin finalizes settlement. Applies locked FX rate.

fn settle(env: soroban_sdk::Env, escrow_id: u64)

Resume escrow operations (admin only)

fn unpause(env: soroban_sdk::Env)
fn version(env: soroban_sdk::Env) -> u32
fn is_paused(env: soroban_sdk::Env) -> bool
fn get_escrow(env: soroban_sdk::Env, escrow_id: u64) -> Option
fn get_oracle(env: soroban_sdk::Env) -> soroban_sdk::Address

Update the FX rate oracle address (admin only)

fn set_oracle(env: soroban_sdk::Env, oracle: soroban_sdk::Address)
fn escrow_count(env: soroban_sdk::Env) -> u64
fn list_escrows(env: soroban_sdk::Env, start: u64, limit: u64) -> soroban_sdk::Vec

Create a new escrow. Returns the escrow ID.

fn create_escrow(
    env: soroban_sdk::Env,
    sender: soroban_sdk::Address,
    receiver: soroban_sdk::Address,
    token: soroban_sdk::Address,
    amount: i128,
    timeout_blocks: u32,
    corridor: u32,
) -> u64

Transfer admin authority to a new address (current admin only)

fn transfer_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)
fn escrow_summaries(
    env: soroban_sdk::Env,
    ids: soroban_sdk::Vec,
) -> soroban_sdk::Map

Counterparty (receiver) approves the settlement terms.

fn counterparty_approve(env: soroban_sdk::Env, escrow_id: u64)

Imports

WebAssembly Text (WAT) ▶