@x402r/core package includes deployment presets that handle the full lifecycle of deploying a PaymentOperator and all its supporting contracts.
Presets
The SDK ships two deployment presets. Pick the one that matches your use case:
All contracts ship via CREATE2 factories, so identical configurations produce identical addresses across deployments.
Marketplace operator
A complete marketplace operator deployment includes:- EscrowPeriod: Records authorization time, enforces waiting period before capture
- Freeze: Allows payer to freeze payment during escrow, receiver to unfreeze
- ReceiverCondition: Gates voids to the merchant (receiver)
- RefundRequest (
IHook): Wired asvoidPostActionHook, flips pending refund requests toApprovedduringvoidPayment() - StaticFeeCalculator: Optional operator fee (basis points)
- PaymentOperator: The main contract tying everything together
Deploy your operator
Prerequisites:- Node.js 20+, pnpm 9.15+
- A private key with Base Sepolia ETH (get Sepolia ETH)
deployMarketplaceOperator from @x402r/core with a viem wallet client. Because every contract uses CREATE2, deploys are idempotent: re-running with the same parameters reuses any existing contract at the predicted address and skips it.
Configuration options
Deployment result
Preview addresses (no deploy)
Marketplace operator slot configuration
The deployed marketplace operator has the following slot configuration:Network support
The deploy presets target the chains in@x402r/core’s x402rChains (Base and Base Sepolia today). See Network support for chain IDs, EIP-155 IDs, and token addresses.
Delivery Protection Operator
For programmatic quality verification (AI garbage detection, schema validation), use the delivery protection preset. No RefundRequest, Evidence, or Freeze contracts. The arbiter or payer can capture funds, and the arbiter can issue immediate refunds without waiting for escrow expiry.Deployment Result Type
Deployment Result Type
paymentIndexRecorderHookAddress: zeroAddress, the HookCombinator is skipped (5 contracts).Redeploying with the same parameters is idempotent (CREATE2). The tooling reuses any contract that already exists at the predicted address.Preview Addresses (No Deploy)
Preview Addresses (No Deploy)
Compute addresses without deploying:
Delivery Protection Slot Configuration
Delivery Protection Slot Configuration
Next Steps
Merchant Guide
Accept payments, capture funds from escrow.
Examples
See working merchant and client examples.
forwardToArbiter()
Forward escrow settlements to an arbiter service.
Smart Contracts
On-chain architecture, conditions, and hooks.
