One-time setup. Records the admin and unpauses the contract.
fn initialize(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Lock amount of token for an invoice into the contract's custody.
Auth: requires the client's signature; the same authorization covers the
inner SAC transfer(client -> contract).
fn deposit(
env: soroban_sdk::Env,
invoice_ref: soroban_sdk::BytesN<32>,
client: soroban_sdk::Address,
freelancer: soroban_sdk::Address,
token: soroban_sdk::Address,
amount: i128,
) -> Result<(), soroban_sdk::Error>
Release a funded escrow to the freelancer (the instant payout).
Auth: the contract admin or the escrow's own client may trigger it. Either way, the only possible destination is the freelancer recorded at deposit time.
fn release(
env: soroban_sdk::Env,
invoice_ref: soroban_sdk::BytesN<32>,
caller: soroban_sdk::Address,
) -> Result
Refund a funded escrow back to the client (cancel before release).
Auth: the contract admin or the escrow's own client.
fn refund(
env: soroban_sdk::Env,
invoice_ref: soroban_sdk::BytesN<32>,
caller: soroban_sdk::Address,
) -> Result
fn get_escrow(
env: soroban_sdk::Env,
invoice_ref: soroban_sdk::BytesN<32>,
) -> Result
fn has_escrow(env: soroban_sdk::Env, invoice_ref: soroban_sdk::BytesN<32>) -> bool
fn total_escrows(env: soroban_sdk::Env) -> u64
fn is_paused(env: soroban_sdk::Env) -> bool
fn get_admin(env: soroban_sdk::Env) -> Result
fn pause(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>
fn unpause(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>
fn set_admin(
env: soroban_sdk::Env,
new_admin: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Replace the contract's own code (admin-gated). Lets PayRosa ship fixes without migrating escrow state — important for a mainnet (L6) deploy.
fn upgrade(
env: soroban_sdk::Env,
new_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), soroban_sdk::Error>