Contract 81ddfb6f28333ef680bc0d9ca29af0c2254a34995836d42fa61695718c50c456

← Back to Index 📥 Download WASM

Meta

cliver 25.2.0#28484880988199233a7e8e87c97cb12dac323cb3
rssdkver 26.0.1#f52b6aad85f18c5e312ff3f60e57cb613274e6bb
rsver 1.94.0

Instances

  • CATBRQ6RQII3MZDEPIS4GB7RLAXKREC3AUSOSJMDHZDJPF6YBZYDRJUC

Interface

Lock amount stroops from the buyer into the contract.

The buyer must have authorized the contract to move their XLM (via SAC approval mechanism or auth envelope).

Arguments

  • transaction_id – A unique u64 ID chosen by the application/marketplace.
  • buyer – The party depositing the funds.
  • seller – The party providing the order/service.
  • amount – Amount in stroops (must be > 0).

Panics

  • If the transaction_id is already used.
  • If the amount is ≤ 0.
fn deposit(
    env: soroban_sdk::Env,
    transaction_id: u64,
    buyer: soroban_sdk::Address,
    seller: soroban_sdk::Address,
    amount: i128,
)

Retrieve global contract configuration.

fn get_config(env: soroban_sdk::Env) -> Config

Initialize the contract settings for the first time. Can only be called once, right after deployment.

Arguments

  • admin_address – HyCrows treasury / admin wallet.
  • token_address – SAC contract ID for XLM on the target network.

Panics

If called more than once.

fn initialize(
    env: soroban_sdk::Env,
    admin_address: soroban_sdk::Address,
    token_address: soroban_sdk::Address,
)

Retrieve full transaction data. Useful for frontends/indexers.

fn get_transaction(env: soroban_sdk::Env, transaction_id: u64) -> EscrowTransaction

Mark that the seller has shipped the goods/service. This starts the 24-hour countdown timer for auto_release_funds.

Panics

  • If the caller is not the seller.
  • If the transaction status is not Pending.
fn mark_as_shipped(env: soroban_sdk::Env, transaction_id: u64)

Admin Only: resolve an active escrow dispute.

buyer_is_right = true → Refund (principal + stake) back to buyer. buyer_is_right = false → Funds to seller; stake slashed to treasury.

Panics

  • If the caller is not the admin.
  • If status is not Disputed.
fn resolve_dispute(env: soroban_sdk::Env, transaction_id: u64, buyer_is_right: bool)

Anyone (guardian bot / seller) can trigger this after 24 hours if the buyer becomes unresponsive.

Panics

  • If status is not Shipped.
  • If the 24-hour waiting period has not elapsed.
fn auto_release_funds(env: soroban_sdk::Env, transaction_id: u64)

Buyer opens an official dispute by depositing a 2 XLM stake. The stake is slashed to the treasury if the admin rules against the buyer.

Panics

  • If the caller is not the buyer.
  • If status is not Shipped.
fn open_dispute_with_stake(env: soroban_sdk::Env, transaction_id: u64)

Called by the buyer when satisfied with the received goods/service. Instantly releases the escrow funds to the seller.

Panics

  • If the caller is not the buyer.
  • If the transaction status is not Shipped.
fn confirm_receipt_and_release(env: soroban_sdk::Env, transaction_id: u64)

Imports

WebAssembly Text (WAT) ▶