Contract 6fbc2d8b83e0bea2e99aae9f8b3ece23826f85ced036b5205f152fefb895ced2

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.2#31b2892ef4d20538004e52713cb81e4895a8de9a
rsver 1.88.0

Instances

  • CB2FVWIMWHIYI73PS4CFTYSPNBQNJBZUOCFLKRWSCKMLFNQ4I2OAFVFH

Interface

Buyer deposits amount of token into escrow for seller, tracked under escrow_id. Transfers the funds from the buyer's wallet into this contract. Requires the buyer's authorization.

fn create_escrow(
    env: soroban_sdk::Env,
    escrow_id: soroban_sdk::String,
    buyer: soroban_sdk::Address,
    seller: soroban_sdk::Address,
    token: soroban_sdk::Address,
    amount: i128,
) -> Escrow

Buyer approves the deal. Starts the 48h countdown to auto-release. Requires the buyer's authorization.

fn approve(env: soroban_sdk::Env, escrow_id: soroban_sdk::String) -> Escrow

Permissionless: releases escrowed funds to the seller once the buyer has approved AND at least RELEASE_DELAY_SECS have passed since approval. No signature is required from either party for this call — only the on-chain time condition is enforced — so the seller (or anyone) can always claim once eligible.

fn release(env: soroban_sdk::Env, escrow_id: soroban_sdk::String) -> Escrow

Buyer reclaims funds, only allowed before approval (i.e. before the countdown has started). Requires the buyer's authorization.

fn cancel_escrow(env: soroban_sdk::Env, escrow_id: soroban_sdk::String) -> Escrow

Read-only lookup of an escrow's current state.

fn get_escrow(env: soroban_sdk::Env, escrow_id: soroban_sdk::String) -> Escrow

Seconds remaining before release becomes callable. 0 if already eligible or not yet approved/found in a releasable state.

fn seconds_until_release(env: soroban_sdk::Env, escrow_id: soroban_sdk::String) -> u64

Imports

WebAssembly Text (WAT) ▶