Locks amount of token from client into the contract under
deal_id. Requires the client's signature. Fails if deal_id is taken.
fn init(
env: soroban_sdk::Env,
deal_id: u64,
client: soroban_sdk::Address,
freelancer: soroban_sdk::Address,
token: soroban_sdk::Address,
amount: i128,
) -> Result<(), soroban_sdk::Error>
The address allowed to upgrade the contract.
fn admin(env: soroban_sdk::Env) -> soroban_sdk::Address
Anchors commitment under record_id, authored by author. Requires
the author's signature; records are write-once.
fn anchor(
env: soroban_sdk::Env,
author: soroban_sdk::Address,
record_id: u64,
kind: RecordKind,
commitment: soroban_sdk::BytesN<32>,
) -> Result<(), soroban_sdk::Error>
Returns the locked funds to the client (client cancels before delivery).
fn refund(env: soroban_sdk::Env, deal_id: u64) -> Result<(), soroban_sdk::Error>
Pays the locked funds out to the freelancer (client confirms delivery).
fn release(env: soroban_sdk::Env, deal_id: u64) -> Result<(), soroban_sdk::Error>
Swaps the contract's Wasm for a new build, keeping the same contract id and all stored deals and records. Only the admin may upgrade.
fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)
The deployed contract version — changes when a new build is upgraded in.
fn version(env: soroban_sdk::Env) -> u32
Returns a deal, for status displays and CLI inspection.
fn get_deal(env: soroban_sdk::Env, deal_id: u64) -> Result
Returns an anchored record, for verification and CLI inspection.
fn get_record(
env: soroban_sdk::Env,
record_id: u64,
) -> Result
Sets the upgrade admin. Runs once, at deployment.
fn __constructor(env: soroban_sdk::Env, admin: soroban_sdk::Address)