Skip to main content
V2 contracts now correctly handle tokens with non-18 decimal places (USDC = 6 decimals, USDT = 6 decimals). The General Escrow dispute policy document was finalized and uploaded to IPFS (March 2026).

Core Data Structures

Transaction Struct

Status Enumeration

Party & Resolution Enumerations


Creating Transactions

Native ETH Transaction

ERC20 Token Transaction

Both functions enforce per-token amount caps via the shouldNotExceedCap modifier. Transactions exceeding the cap will revert with AmountExceedsCap() error.

Managing Transactions

Payment Functions

Key Behaviors:
  • pay() and reimburse() can be called multiple times with partial amounts
  • When the entire amount is paid/reimbursed, status changes to TransactionResolved
  • executeTransaction() transfers all remaining funds to the seller after deadline
  • All three functions require status to be NoDispute or will revert with TransactionDisputed()

Settlement System

Settlement Functions

Settlement Flow

1

Initiate Proposal

Either party proposes a settlement amount using proposeSettlement().
2

Status Change

Status changes to WaitingSettlementBuyer or WaitingSettlementSeller.
3

Response

The other party can either accept the settlement or propose a counter-offer.
4

Counter-Offers

Counter-offers reset lastFeePaymentTime and switch the waiting status.
5

Dispute Option

Only the non-proposing party can raise a dispute (after settlementTimeout elapses).
Settlement Acceptance: Upon acceptance, funds are immediately distributed. Seller receives the proposed settlement amount, buyer receives the remainder. For ERC20 tokens, SafeERC20 library ensures both transfers succeed atomically.

Dispute Management

Arbitration Fee Functions

Dispute Creation Process

Fee Calculation

Timeout Rules:
  • Settlement proposers must wait settlementTimeout before paying fees
  • If one party fails to pay within feeTimeout, the other party wins by default
  • The winning party receives all escrowed funds plus their fee refunded

Query Functions

Transaction Queries

Payout Calculation

Payout Logic:

Other Queries


Governor Functions

All governor functions are restricted to the current governor address.

Events

Transaction Events

Management Events


Transaction Metadata Format

Transactions store metadata onchain using data URIs. The metadata JSON structure:
For crypto-to-crypto transactions:

Creating Data URIs

Metadata Guidelines:
  • Metadata is stored directly onchain via data URIs, eliminating IPFS dependencies
  • Keep core metadata concise as base64 encoding increases transaction size
  • Use extraDescriptionUri for large attachments or evidence documents