Contract Overview
| Contract | Type | Purpose |
|---|---|---|
| EscrowFactory | Upgradeable (UUPS) | Creates and tracks escrows |
| AgentRegistry | Upgradeable (UUPS) | Manages agent lifecycle |
| FeeManager | Upgradeable (UUPS) | Fee configuration |
| EscrowImplementation | Immutable | Template for escrow clones |
EscrowFactory
Storage
Key Functions
createEscrow
Creates and funds a new escrow atomically.- Calculate salt:
keccak256(userSalt, msg.sender) - Predict escrow address via CREATE2
- Validate: token whitelisted, amount valid, agent valid
- Transfer protocol fee to treasury
- Transfer escrow amount to predicted address
- Deploy clone
- Initialize escrow
- Set
isEscrow[escrow] = true
quoteCreateEscrow
Preview an escrow creation without executing.AgentRegistry
Storage
Key Functions
register
addStake / withdrawStake
validateAgentForContract
- Agent is registered
- Agent is available
- Agent’s MAV ≥ contract value
- Agent has minimum stakes
FeeManager
Storage
Key Functions
quoteCreationFee
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 →