Clone and Build
Run Tests
Check Gas Usage
.gas-snapshot.
Supported Networks
Environment Setup
Deploy
The deployment script deploys two contracts:- x402Escrow implementation — the contract logic.
- ERC1967Proxy — the proxy that delegates to the implementation and holds all state.
- Local (Anvil)
- Base
- Monad
- Base Sepolia (Testnet)
- Monad Testnet
Start a local node:In a new terminal:
Post-Deployment Verification
--verify, the source code appears on Basescan. Otherwise, verify manually:
Role Management
Add a Facilitator
Remove a Facilitator
Adjust Timeout
Upgrade Procedure
x402Escrow uses the UUPS proxy pattern. To upgrade:- Deploy the new implementation contract.
- Call
upgradeToAndCall()on the proxy from the Owner address.
Production Checklist
- Deploy with a hardware wallet or multisig as the Owner
- Use separate addresses for Owner, Admin, and Facilitator roles
- Verify contract source on block explorer
- Confirm USDC address is correct for the target network
- Confirm
timeoutSecsis appropriate for your use case - Set up event monitoring for
Deposited,Released, andRefunded - Test a full escrow cycle (settle -> release) on testnet before mainnet
- Ensure
.envis listed in.gitignore