Contract 0095d331033b2f380b9cf1dda46dff098aa722774a0041da1cb18159e9f20382

← Back to Index 📥 Download WASM

Meta

cliver 26.1.0#1228cff8022b804659750b94b315932b0e0f3f6a
rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.94.0

Instances

  • CDZSYODEHRJPMN63RDARHEH5NUOXWC76MFM67MEAZYOWY2YJC34OS2Z4

Interface

Full refund of all funded milestones. Admin only.

fn refund(env: soroban_sdk::Env, deal_id: u64) -> Result<(), EscrowError>

Deposit funds for a specific milestone. Client transfers tokens from their wallet to this contract.

fn deposit(
    env: soroban_sdk::Env,
    deal_id: u64,
    milestone_idx: u32,
) -> Result<(), EscrowError>

Raise a dispute on a funded milestone. Freezes funds. Can be called by either client or provider.

fn dispute(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    deal_id: u64,
    milestone_idx: u32,
) -> Result<(), EscrowError>

Get deal details by ID.

fn get_deal(env: soroban_sdk::Env, deal_id: u64) -> Result

Fund all currently pending milestones in a single client payment. Releases, disputes, and refunds still operate per milestone.

fn fund_deal(env: soroban_sdk::Env, deal_id: u64) -> Result<(), EscrowError>

Initialize the contract with admin and protocol wallet addresses. Must be called once before any other function.

fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    protocol_wallet: soroban_sdk::Address,
) -> Result<(), EscrowError>

Create a new deal with defined participants, splits, and milestones.

  • platform_fee_bps: platform fee in basis points (1000 = 10%)
  • connector_share_bps: connector's share of the platform fee in bps (4000 = 40%)
  • milestone_amounts: vector of amounts for each milestone (in token units)
fn create_deal(
    env: soroban_sdk::Env,
    client: soroban_sdk::Address,
    provider: soroban_sdk::Address,
    connector: soroban_sdk::Address,
    token_addr: soroban_sdk::Address,
    platform_fee_bps: u32,
    connector_share_bps: u32,
    milestone_amounts: soroban_sdk::Vec,
) -> Result

Get total number of deals created.

fn get_deal_count(env: soroban_sdk::Env) -> Result

Get provider's on-chain reputation (completed deal count).

fn get_reputation(env: soroban_sdk::Env, provider: soroban_sdk::Address) -> u64

Resolve a dispute. Admin splits funds between client and provider. refund_bps: percentage to refund client (5000 = 50%)

fn resolve_dispute(
    env: soroban_sdk::Env,
    deal_id: u64,
    milestone_idx: u32,
    refund_bps: u32,
) -> Result<(), EscrowError>

Release a funded milestone with atomic 3-way split.

Split logic (mirrors The Signal's approveMilestone):

  • platform_fee = amount * platform_fee_bps / 10000
  • connector_cut = platform_fee * connector_share_bps / 10000
  • protocol_cut = platform_fee - connector_cut
  • provider_cut = amount - platform_fee
fn release_milestone(
    env: soroban_sdk::Env,
    deal_id: u64,
    milestone_idx: u32,
) -> Result<(), EscrowError>

Imports

WebAssembly Text (WAT) ▶