Skip to content

core: add commerce-payments v1 canonical addresses + drop SKALE#121

Closed
A1igator wants to merge 3 commits into
mainfrom
A1igator/commerce-payments-v1-addresses
Closed

core: add commerce-payments v1 canonical addresses + drop SKALE#121
A1igator wants to merge 3 commits into
mainfrom
A1igator/commerce-payments-v1-addresses

Conversation

@A1igator
Copy link
Copy Markdown
Contributor

Summary

  • Adds the canonical CREATE2 addresses for the three base/commerce-payments@v1.0.0 primitives, redeployed via CreateX permissionless salts.
  • Drops SKALE Base (1187947933) from x402rChains — Shanghai EVM is incompatible with the Cancun-locked canonical bytecode.
  • Notes Ethereum mainnet and Monad as pending an imminent primitives deploy.

New addresses (same on every chain via permissionless CREATE2)

Contract Address
AuthCaptureEscrow 0xF8211868187974a7Fb9d99b8fFB171AD70665Dc6
ERC3009PaymentCollector(escrow, multicall3) 0x7561DC178D9aD5bc5fb103C01f448A510d2A36D0
Permit2PaymentCollector(escrow, permit2, multicall3) 0xD8490609d2da0ee626b0e676941b225cbc1A8C08

Salt namespace: commerce-payments::v1::<ContractName>.

Currently live

10 chains verified on-chain via direct eth_getCode checks:

  • Mainnets: Base (8453), Optimism (10), Arbitrum One (42161), Polygon (137), Celo (42220), Avalanche C-Chain (43114), Linea (59144)
  • Testnets: Base Sepolia (84532), Ethereum Sepolia (11155111), Arbitrum Sepolia (421614)

Pending deploys (in registry, addresses not yet live on these chains): Ethereum (1), Monad (143).

Surface

import {
  commercePaymentsAddresses,
  commercePaymentsAuthCaptureEscrow,
  commercePaymentsErc3009PaymentCollector,
  commercePaymentsPermit2PaymentCollector,
} from '@x402r/core'

The existing legacy CREATE3 constants (authCaptureEscrow, tokenCollector, factories, conditions, recorders, usdcTvlLimit, protocolFeeConfig, receiverRefundCollector, recorderCombinatorCodehash) are unchanged in this PR. They'll be retired in the follow-up that ships the x402r-authored contracts at CREATE2 addresses.

Test plan

  • pnpm tsc --noEmit clean
  • pnpm vitest run tests/config.test.ts — 25/25 passing
  • All non-fork unit tests passing (198/198)
  • Reviewer cross-checks forge script script/PredictAddresses.s.sol -vvv in x402r-contracts reproduces the same three addresses

🤖 Generated with Claude Code

base/commerce-payments@v1.0.0 redeployed at canonical CREATE2 addresses
via CreateX permissionless salts. Adds three top-level address constants
+ a `commercePaymentsAddresses` bundle:

  AuthCaptureEscrow:        0xF8211868187974a7Fb9d99b8fFB171AD70665Dc6
  ERC3009PaymentCollector:  0x7561DC178D9aD5bc5fb103C01f448A510d2A36D0
  Permit2PaymentCollector:  0xD8490609d2da0ee626b0e676941b225cbc1A8C08

Same address on every chain in `x402rChains`. The chain registry is the
source of truth for both commerce-payments primitives and (eventually)
the x402r-authored contracts; both deploy to the same set going forward.

Currently live on: Base, Optimism, Arbitrum One, Polygon, Celo, Avalanche
C-Chain, Linea, plus Base Sepolia, Ethereum Sepolia, Arbitrum Sepolia.
Ethereum mainnet and Monad remain in the registry pending an imminent
primitives deploy.

SKALE Base (1187947933) dropped — Shanghai EVM is incompatible with the
Cancun-locked toolchain used for the canonical bytecode.

Existing legacy CREATE3 constants (`authCaptureEscrow`, `tokenCollector`,
`factories`, etc.) are unchanged in this PR and will be retired in the
follow-up that deploys the x402r-authored contracts at CREATE2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mintlify
Copy link
Copy Markdown

mintlify Bot commented Apr 29, 2026

Docs PR opened: BackTrackCo/docs#33

Added a commerce-payments v1 primitives section with the new CREATE2 addresses and @x402r/core exports to sdk/overview.mdx, and removed SKALE Base from the supported chains table.

Ethereum mainnet (1) deploy completed at 0.95 gwei effective. All 12
chains in x402rChains now have the commerce-payments v1 primitives
live at canonical addresses.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
vraspar
vraspar previously approved these changes Apr 30, 2026
} from './config/index.js'
export {
authCaptureEscrow,
commercePaymentsAddresses,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to remove certain things as well

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah but later. this is just addresses. you can build on top of it if you want

Both chains have the commerce-payments v1 primitives deployed at the
canonical CREATE2 addresses.

- BSC (56): USDC at 0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d
  (Binance-Peg USD Coin)
- Tempo (4217): pathUSD at 0x20c0000000000000000000000000000000000000
  (TIP-20 predeploy; native USDC not yet issued on Tempo)

Tempo deploys required `--gas-estimate-multiplier 1000` because TIP-1000
charges 5-10x more gas for contract deployments to deter state-growth
attacks. Forge's standard estimate undershoots by an order of magnitude.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
A1igator added a commit that referenced this pull request May 6, 2026
…ored)

Replaces the legacy CREATE3 addresses in `packages/core/src/config/index.ts`
with the canonical CREATE2 deployment (BackTrackCo/x402r-contracts#34, salt
namespaces `commerce-payments::v1::*` and `x402r-canonical-v1::*`).

- `authCaptureEscrow`, `tokenCollector`, `protocolFeeConfig`,
  `receiverRefundCollector`, `factories.*`, `conditions.*` updated.
- New `commercePayments*` exports surface the three primitives (escrow,
  ERC3009 collector, Permit2 collector) — supersedes #121.
- `hooks.paymentIndexHook` set to `zeroAddress`: the canonical deploy
  script does not include a chain-singleton `PaymentIndexHook`. Consumers
  pass an instance via `paymentIndexHookAddress` on the preset.
- `hookCombinatorCodehash` recomputed from the new HookCombinator runtime
  bytecode (`0x99360a2e...`).

Owner / fee recipient on `ProtocolFeeConfig` is
`0x773dBcB5BDb3Df8359ba4e42D7Ce7AE3fC9Ee235`; protocol-fee calculator
is unset, so `getProtocolFeeBps()` returns `0`.

Tests:
- `presets.test.ts` `makeDeliveryProtectionOptions` defaults
  `paymentIndexHookAddress` to a non-zero fixture so the HookCombinator
  path is exercised; the explicit-`zeroAddress` test still overrides.
- `erc3009.test.ts` updated to expect the canonical ERC3009 collector
  address (`0x7561DC17...`) instead of the legacy CREATE3 one.

198/198 unit tests passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@A1igator
Copy link
Copy Markdown
Contributor Author

A1igator commented May 6, 2026

Superseded by #122 — the canonical CREATE2 addresses landed there alongside the x402r-authored contracts (BackTrackCo/x402r-contracts#34) in a single migration. The three primitive constants (commercePaymentsAuthCaptureEscrow, commercePaymentsErc3009PaymentCollector, commercePaymentsPermit2PaymentCollector) and the commercePaymentsAddresses bundle from this PR were carried over verbatim; same addresses, same salt namespace.

Live deployment status (canonical CREATE2 verified live as of this commit):

  • Mainnets: Base (8453), Optimism (10), Celo (42220), Avalanche C-Chain (43114), Linea (59144)
  • Testnets: Base Sepolia (84532), Ethereum Sepolia (11155111), Arbitrum Sepolia (421614)

Pending (in registry, not yet live): Arbitrum One (42161 — partial deploy, deployer needs gas top-up), Polygon (137 — needs MATIC), Ethereum (1) and Monad (143) — both blocked on the upstream commerce-payments primitives landing on those chains first.

@A1igator A1igator closed this May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants