Skip to main content
The @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:
  1. EscrowPeriod: Records authorization time, enforces waiting period before capture
  2. Freeze: Allows payer to freeze payment during escrow, receiver to unfreeze
  3. ReceiverCondition: Gates voids to the merchant (receiver)
  4. RefundRequest (IHook): Wired as voidPostActionHook, flips pending refund requests to Approved during voidPayment()
  5. StaticFeeCalculator: Optional operator fee (basis points)
  6. 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)
Call 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

Because all contracts use CREATE2, redeploying with the same parameters is idempotent. The tooling skips any contract that already exists at the predicted address. The summary tells you what was new vs reused.

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.
Deployment requires gas fees. Ensure your wallet has ETH on the target network. On Base Sepolia, you can fund a wallet from Base network faucets.

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.
Deploys 6 contracts by default: EscrowPeriod, StaticAddressCondition(arbiter), OrCondition(release), OrCondition(refund), HookCombinator, and the Operator. If you pass 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.
Compute addresses without deploying:

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.