contracts: base commerce-payments port (escrow + spl-token-collector)#2
Open
A1igator wants to merge 1 commit into
Open
contracts: base commerce-payments port (escrow + spl-token-collector)#2A1igator wants to merge 1 commit into
A1igator wants to merge 1 commit into
Conversation
Adds the SVM port of base/commerce-payments' authCapture primitives: - auth-capture-escrow: pure escrow primitive. 6 lifecycle ixs (authorize/charge/capture/void/refund/reclaim) + 1 admin (initialize_protocol_fee_config). CPIs into ITokenCollector for fund movement; knows nothing about plugins / arbitration. - spl-token-collector: the pilot's only ITokenCollector impl. SPL Token transfers for collect_authorize (payer ATA -> vault) and collect_refund (treasury -> payer). Future Token-2022 / bridge collectors slot in via the same interface. Also adds workspace plumbing (Anchor.toml, Cargo workspace, Vitest + Codama generator wiring), a Trident fuzz harness for the splits math, and migration scripts for protocol-fee-config init + post-deploy program-ID pinning. x402r-specific extensions (payment-operator factory, condition plugins, slot-dispatch fuzz) ship in a follow-up PR that stacks on top of this one. Status: pilot, unaudited. Mainnet usage is at users' own risk. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SVM port of
base/commerce-payments' authCapture primitives. First half of a two-PR split of #1 — this PR isolates the commerce-payments-analog code so it can be reviewed against the EVM original without the x402r-specific layer mixed in.auth-capture-escrowAuthCaptureEscrowanalog). 6 lifecycle ixs (authorize/charge/capture/void/refund/reclaim) + 1 admin (initialize_protocol_fee_config). CPIs intoITokenCollectorfor fund movement; knows nothing about plugins / arbitration.spl-token-collectorITokenCollectorimpl (EIP3009TokenCollector/Permit2TokenCollectoranalog). SPL Token transfers forcollect_authorize(payer ATA → vault) andcollect_refund(treasury → payer). Future Token-2022 / bridge collectors slot in via the same interface.Also adds:
Anchor.toml,Cargoworkspace, Vitest + Codama generator wiring, deploy/pin-program-ids migration scripts.fuzz_splits).tests/(Vitest, bodies areexpect.fail("TODO")stubs).Stacked follow-up
The x402r-specific layer (
payment-operatorfactory +static-address-condition/receiver-condition/payer-conditionplugins + slot-dispatch fuzz scaffold) ships in a stacked PR targeting this branch.Licensing
SPDX-License-Identifier: BUSL-1.1and// CONTRACTS UNAUDITED: USE AT YOUR OWN RISK.Cargo.tomldeclareslicense = "BUSL-1.1".x402r-contracts: Change Date 2029-12-09, Change License MIT, Hackathon Promotional Rights grant retained.Status
Pilot, unaudited. Mainnet usage is at users' own risk.
Pre-merge follow-ups (apply to both PRs in the split, tracked here for visibility):
anchor buildto produce IDLs (toolchain not installed locally)pnpm codama:generateto swap stubs in the@x402r/svmSDKtarget/idl/*.jsonexpect.fail("TODO")scaffolding)migrations/deploy.ts+migrations/pin-program-ids.ts🤖 Generated with Claude Code