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).
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).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.
admin_address – HyCrows treasury / admin wallet.token_address – SAC contract ID for XLM on the target network.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.
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.
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.
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.
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.
fn confirm_receipt_and_release(env: soroban_sdk::Env, transaction_id: u64)