From 1ba540bc64149ce9d51a10e98bf8c794ce4cd5b5 Mon Sep 17 00:00:00 2001 From: A1igator Date: Wed, 29 Apr 2026 16:57:12 -0700 Subject: [PATCH 1/3] feat(core): add commerce-payments v1 canonical addresses + drop SKALE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- packages/core/src/config/index.ts | 44 ++++++++++++++++++++++++++----- packages/core/src/index.ts | 4 +++ 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/packages/core/src/config/index.ts b/packages/core/src/config/index.ts index da174842..5db2ae4d 100644 --- a/packages/core/src/config/index.ts +++ b/packages/core/src/config/index.ts @@ -89,6 +89,44 @@ export const recorders = { '0xa83A44836e16A35505EFA9c6b6a1BD9C0Ecc40E9' as const satisfies Address, } as const satisfies RecorderSingletonAddresses +// --------------------------------------------------------------------------- +// commerce-payments v1 primitives — canonical CREATE2 addresses +// --------------------------------------------------------------------------- +// +// Upstream `base/commerce-payments@v1.0.0` contracts redeployed at canonical +// CREATE2 addresses via CreateX permissionless salts. Same address on every +// chain. These replace the legacy CREATE3 `authCaptureEscrow` / +// `tokenCollector` constants above; the existing legacy addresses are kept in +// place for now to avoid breaking existing tests/consumers, and will be +// retired in the SDK v2 migration. +// +// Salt namespace: `commerce-payments::v1::`. +// Source of truth: `x402r-contracts/script/PredictAddresses.s.sol`. + +/** AuthCaptureEscrow at canonical CREATE2 address (commerce-payments v1.0.0). */ +export const commercePaymentsAuthCaptureEscrow = + '0xF8211868187974a7Fb9d99b8fFB171AD70665Dc6' as const satisfies Address + +/** ERC3009PaymentCollector(escrow, multicall3) at canonical CREATE2 address. */ +export const commercePaymentsErc3009PaymentCollector = + '0x7561DC178D9aD5bc5fb103C01f448A510d2A36D0' as const satisfies Address + +/** Permit2PaymentCollector(escrow, permit2, multicall3) at canonical CREATE2 address. */ +export const commercePaymentsPermit2PaymentCollector = + '0xD8490609d2da0ee626b0e676941b225cbc1A8C08' as const satisfies Address + +/** Convenience bundle of all three primitive addresses. */ +export const commercePaymentsAddresses = { + authCaptureEscrow: commercePaymentsAuthCaptureEscrow, + erc3009PaymentCollector: commercePaymentsErc3009PaymentCollector, + permit2PaymentCollector: commercePaymentsPermit2PaymentCollector, +} as const + +// `x402rChains` below is the canonical chain registry. The commerce-payments +// v1 primitives + the x402r-authored contracts deploy to the same set of +// chains; the registry is the source of truth for both. Ethereum mainnet and +// Monad are listed pending an imminent primitives deploy. + /** * Runtime codehash of RecorderCombinator contract. * All RecorderCombinator instances share identical runtime bytecode — @@ -175,12 +213,6 @@ export const x402rChains = { 59144, '0x176211869cA2b568f2A7D4EE941E073a821EE1ff', ), - - 1187947933: chainConfig( - 'SKALE Base', - 1187947933, - '0x85889c8c714505E0c94b30fcfcF64fE3Ac8FCb20', - ), } as const satisfies Record // --------------------------------------------------------------------------- diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index a943d089..44a6dc3a 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -214,6 +214,10 @@ export type { } from './config/index.js' export { authCaptureEscrow, + commercePaymentsAddresses, + commercePaymentsAuthCaptureEscrow, + commercePaymentsErc3009PaymentCollector, + commercePaymentsPermit2PaymentCollector, conditions, factories, fromNetworkId, From 100fd8c0029ea60097f62555254f2e571bc40f17 Mon Sep 17 00:00:00 2001 From: A1igator Date: Wed, 29 Apr 2026 17:13:27 -0700 Subject: [PATCH 2/3] docs: confirm primitives deployed on every chain in registry 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) --- packages/core/src/config/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/config/index.ts b/packages/core/src/config/index.ts index 5db2ae4d..ce741687 100644 --- a/packages/core/src/config/index.ts +++ b/packages/core/src/config/index.ts @@ -124,8 +124,8 @@ export const commercePaymentsAddresses = { // `x402rChains` below is the canonical chain registry. The commerce-payments // v1 primitives + the x402r-authored contracts deploy to the same set of -// chains; the registry is the source of truth for both. Ethereum mainnet and -// Monad are listed pending an imminent primitives deploy. +// chains; the registry is the source of truth for both. As of 2026-04-29, +// the primitives are deployed on every chain listed here. /** * Runtime codehash of RecorderCombinator contract. From 3ff92b04d7d05bb1669eb1a02c6edb06dc30398d Mon Sep 17 00:00:00 2001 From: A1igator Date: Wed, 29 Apr 2026 17:25:33 -0700 Subject: [PATCH 3/3] core: add BSC (56) and Tempo (4217) to chain registry 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) --- packages/core/src/config/index.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/core/src/config/index.ts b/packages/core/src/config/index.ts index ce741687..eef38af7 100644 --- a/packages/core/src/config/index.ts +++ b/packages/core/src/config/index.ts @@ -213,6 +213,18 @@ export const x402rChains = { 59144, '0x176211869cA2b568f2A7D4EE941E073a821EE1ff', ), + 56: chainConfig( + 'BNB Smart Chain', + 56, + '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d', + ), + // Tempo's canonical USD-pegged stablecoin is pathUSD (predeploy TIP-20). + // Native USDC is not yet issued on Tempo. + 4217: chainConfig( + 'Tempo', + 4217, + '0x20c0000000000000000000000000000000000000', + ), } as const satisfies Record // ---------------------------------------------------------------------------