Contract d19329c207d1b1ed18d3a14c3a49ac1c6ab31ce8e58fe4f926e43a6478eb501f

← Back to Index 📥 Download WASM

Meta

cliver 25.2.0#28484880988199233a7e8e87c97cb12dac323cb3
rssdkver 25.3.0#dcbea44513feb7734af6b6c4aced2c4a7a2715d0
rsver 1.94.1

Instances

  • CBNM4AWSSO5PSD2D4QZ6R4JDN3A3NKI3MZOFG3TMGIMO5SMY3SCLV32B

Interface

Get current nonce for a user Used to get the current nonce before calling functions that require it

fn get_nonce(env: soroban_sdk::Env, user: soroban_sdk::Address) -> u64
fn get_config(env: soroban_sdk::Env) -> Config
fn get_escrow(env: soroban_sdk::Env, escrow_id: u64) -> Result

Initialize contract configuration Can only be called once on deploy (or when empty).

fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    collect_on_create: bool,
) -> Result<(), EscrowError>

Create escrow with guarantee period

fn create_escrow(
    env: soroban_sdk::Env,
    buyer: soroban_sdk::Address,
    seller: soroban_sdk::Address,
    amount: i128,
    asset: soroban_sdk::Address,
    fee_bps: u32,
    guarantee_days: u32,
    product_id: soroban_sdk::String,
    allow_early_release: bool,
) -> Result

Update configuration (only current admin)

fn update_config(
    env: soroban_sdk::Env,
    new_admin: soroban_sdk::Address,
    collect_on_create: bool,
)

Withdraw funds from the contract (admin only)

fn admin_withdraw(
    env: soroban_sdk::Env,
    asset: soroban_sdk::Address,
    amount: i128,
) -> Result<(), EscrowError>

Initiate a dispute on an active escrow

fn dispute_escrow(
    env: soroban_sdk::Env,
    escrow_id: u64,
    caller: soroban_sdk::Address,
    nonce: u64,
) -> Result<(), EscrowError>

Refund (only buyer and within guarantee period) Includes nonce for replay attack protection and traceability

fn request_refund(
    env: soroban_sdk::Env,
    escrow_id: u64,
    buyer: soroban_sdk::Address,
    nonce: u64,
) -> Result<(), EscrowError>

Release payment to seller (after guarantee period or by seller) Includes nonce for replay attack protection and traceability

fn release_payment(
    env: soroban_sdk::Env,
    escrow_id: u64,
    seller: soroban_sdk::Address,
    nonce: u64,
) -> Result<(), EscrowError>

Resolve a disputed escrow when both parties agree

fn resolve_dispute(
    env: soroban_sdk::Env,
    escrow_id: u64,
    caller: soroban_sdk::Address,
    nonce: u64,
) -> Result<(), EscrowError>

Check if a token is allowed (public helper function)

fn is_token_allowed(env: soroban_sdk::Env, token: soroban_sdk::Address) -> bool

Add a token to the allowed list (admin only) This ensures only trusted tokens can be used in escrows

fn add_allowed_token(env: soroban_sdk::Env, token: soroban_sdk::Address)

Get the list of allowed tokens (public)

fn get_allowed_tokens(env: soroban_sdk::Env) -> soroban_sdk::Vec

Propose a resolution for a disputed escrow

fn propose_resolution(
    env: soroban_sdk::Env,
    escrow_id: u64,
    caller: soroban_sdk::Address,
    nonce: u64,
    favor_buyer: bool,
) -> Result<(), EscrowError>

Remove a token from the allowed list (admin only) Note: Existing escrows with this token will still function

fn remove_allowed_token(env: soroban_sdk::Env, token: soroban_sdk::Address)

Admin resolves dispute when parties can't agree

fn admin_resolve_dispute(
    env: soroban_sdk::Env,
    escrow_id: u64,
    favor_buyer: bool,
    nonce: u64,
) -> Result<(), EscrowError>

Imports

WebAssembly Text (WAT) ▶