Escrow
For actions that require trust guarantees, Atlas supports escrow settlement through the ZoneEscrow contract. Funds are locked on-chain and released only when conditions are met.Escrow lifecycle
How escrow works
Payment requirement with escrow mode
When a zone action uses
settlement_mode: "escrow" in its price definition, the steward’s zone.payment_required message points to the ZoneEscrow contract instead of ZoneSettlement.Deposit
The steward calls
depositWithAuthorization() on the ZoneEscrow contract using the client’s signed USDC authorization. The funds are locked in the contract, associated with a unique task_id (keccak256 of the request ID) and the depositor’s address.The escrow ID is computed as: keccak256(depositor_address || task_id).Work is performed
With funds locked, the steward performs the requested action. The escrow remains in
Deposited state until explicitly resolved.Status states
| Status | Description |
|---|---|
pending_deposit | Authorization received, deposit transaction not yet confirmed |
deposited | Funds locked on-chain in the escrow contract |
released | Funds sent to the recipient by the depositor |
refunded | Funds returned to the depositor after deadline |
disputed | Escrow flagged for dispute; deadline extended |
failed | Deposit transaction reverted or other failure |
CLI commands
List escrow receipts
Release escrow
Release funds to a recipient after successful task completion:Only the original depositor (the wallet that created the escrow) can release funds. The CLI verifies this before submitting the transaction.
Refund escrow
Reclaim funds after the escrow deadline has passed:Dispute escrow
Flag an escrow for dispute, which extends the deadline:Escrow receipt record
Each escrow operation is persisted locally as anEscrowReceiptRecord:
| Field | Description |
|---|---|
escrow_id | Unique escrow identifier (keccak256 hash) |
request_id | Original zone action request ID |
zone_id | Zone where the action was performed |
action | Action name |
task_id | keccak256 of the request ID (bytes32) |
tx_hash | On-chain transaction hash |
chain_id | Chain ID (8453 or 84532) |
depositor | Address of the depositing wallet |
recipient | Address of the recipient (set on release) |
token | Token contract address (USDC) |
amount | Amount in raw units |
deadline | Unix timestamp after which refund is allowed |
status | Current escrow status |
error | Error message if failed |
recorded_at | Unix timestamp of last update |
Settlement info for escrow
When azone.response includes escrow settlement, the settlement object contains:
For escrow deposits, the
recipient_amount, creator_fee, and protocol_fee are all "0" because fee splitting happens at release time, not at deposit time.