Skip to main content

Contract Overview


EscrowFactory

Storage

Key Functions

createEscrow

Creates and funds a new escrow atomically.
Flow:
  1. Calculate salt: keccak256(userSalt, msg.sender)
  2. Predict escrow address via CREATE2
  3. Validate: token whitelisted, amount valid, agent valid
  4. Transfer protocol fee to treasury
  5. Transfer escrow amount to predicted address
  6. Deploy clone
  7. Initialize escrow
  8. Set isEscrow[escrow] = true

quoteCreateEscrow

Preview an escrow creation without executing.

AgentRegistry

Storage

Key Functions

register

addStake / withdrawStake

validateAgentForContract

Checks:
  • Agent is registered
  • Agent is available
  • Agent’s MAV ≥ contract value
  • Agent has minimum stakes

FeeManager

Storage

Key Functions

quoteCreationFee

Logic:

EscrowImplementation

Storage

State Enum

Key Functions

accept / decline

markFulfilled

release

sellerRefund

openDispute

inviteAgent

agentResolve

proposeSplit / approveSplit / executeSplit


Events

EscrowFactory Events

EscrowImplementation Events


Integration Guide

Learn how to integrate →