Smart contracts for Pay -- the complete x402 payment stack for AI agents. USDC on Base.
| Contract | Role | Upgradeability |
|---|---|---|
| PayDirect | One-shot USDC transfers with fee deduction | Immutable |
| PayTab (V2/V5) | Tab lifecycle: open, charge, settle, close, top-up | Immutable |
| PayFee | Fee calculation and provider volume tracking | UUPS upgradeable |
| PayRouter | Entry point for x402 settlement and direct payments | UUPS upgradeable |
Fund-holding contracts (PayDirect, PayTab) are immutable -- no proxy, no admin key, no upgrade path. USDC flows directly between agent and provider via the contract.
- Immutable fund-holding contracts (no admin functions)
- CEI pattern + reentrancy guards on all state-changing functions
maxChargePerCallenforced on-chain per tab- Activation fee prevents dust-tab spam
- Custom errors (no require strings)
- Fuzz tests on all numeric operations
- Invariant tests on safety properties
This is a Foundry project. Solidity 0.8.x with OpenZeppelin.
forge build
forge testAlways fetch addresses at runtime from the API:
curl https://pay-skill.com/api/v1/contractsSee Contracts & Networks for details.
Pay is the complete x402 payment stack -- gateway, facilitator, SDKs, CLI, and MCP server -- that lets AI agents pay for APIs with USDC on Base.
- Documentation
- Architecture
- SDK -- Python + TypeScript
- CLI -- Command-line tool
- pay-gate -- x402 payment gateway
- MCP Server -- Claude Desktop / Cursor / VS Code
MIT