Contract 03b66cdc940bcc8951e1810bfb2fdf96e2a3acb7a04fc1e5d1aa6f010f8cdb08

← Back to Index 📥 Download WASM

Meta

cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdkver 26.1.0#175aa41306f383057a8cdfc84b68d931664fc34e
rsver 1.93.1

Instances

  • CALQQHD5J6A5I2TGGXW4KUCUOFHDVO674MELON7R5IZLKZJPD7RWMJU3

Interface

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)

Imports

WebAssembly Text (WAT) ▶