Repository navigation
docs(adr): single-token USDC payments; drop ADR 010 multi-token - #593
Conversation
Launch with one payment token, USDC, address fixed at contract deployment (immutable constructor arg). No governance allowlist, no addToken/removeToken, no per-token rate bounds, no oracle/swap. Supersedes the multi-stablecoin variant (#583 / closed PR #585). - ADR 010 deleted entirely; multi-token rejection archived in adr/_history/alternatives-pre-launch.md (the canonical rejected-alternatives location); CLAUDE.md records do-not-reuse 010. - ADR 003 rewritten as single-token canon: StablePaymentChannel is the launch and production contract; channelId has no token component; decimals fixed at 6; forceCloseChannel / token-removal removed; Circle-freeze is an accepted counterparty risk (no multi-token deferral). - Multi-token / PaymentChannel / allowlist refs removed across 008, 009, 012, 013, 016, 018, 019, 026, README, architecture, glossary, _build/part-3, and the operator-key-rotation / operator-upgrade-path / poc-production-seams appendices. - ADR 026 (was Locked-for-implementation) flipped to Draft: touched for StablePaymentChannel naming + dropped multi-currency aside; needs re-approval. 028/032 untouched. Reads as canon: no Dropped/Superseded/"deferred to ADR 010" or PoC-then-multi-token framing anywhere in the rendered spec. Verified: corpus residual scan clean (no ADR-010 / multi-token / PaymentChannel / allowlist), make check-book-list green (23 ADRs + 12 appendices), MD001 heading levels clean, adr/ self-contained (no new issue/PR refs), pre-commit all green. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request removes the multi-token payment support (ADR 010), reverting the protocol to a single-token model using USDC. The changes involve deleting the ADR 010 specification and updating all related documentation to remove references to token allowlists, per-token rate bounds, and multi-token normalization. Feedback identifies remaining redundancies in the documentation, specifically recommending the removal of the "token" parameter from the ChannelOpened event and the executeBuyback and getAccumulatedFees function signatures to ensure consistency with the simplified single-token architecture.
| | Event | Emitted by | Non-indexed fields | | ||
| | --- | --- | --- | | ||
| | `ChannelOpened(channelId, client, provider, …)` | `openChannel` | `token` (USDC address for PoC; arbitrary ERC-20 in production per [ADR 010](010-multi-token.md)), `deposit`, `expiresAt` | | ||
| | `ChannelOpened(channelId, client, provider, …)` | `openChannel` | `token` (USDC address), `deposit`, `expiresAt` | |
There was a problem hiding this comment.
The token field in the ChannelOpened event is redundant because the payment token is fixed to USDC at the contract level. Removing it simplifies the event signature and reduces log data costs. Ensure that the remaining address fields (client, provider) and the channelId are indexed to facilitate off-chain filtering, keeping the total indexed parameters at the EVM limit of three.
| | `ChannelOpened(channelId, client, provider, …)` | `openChannel` | `token` (USDC address), `deposit`, `expiresAt` | | |
| | ChannelOpened(bytes32 indexed channelId, address indexed client, address indexed provider) | openChannel | deposit, expiresAt | |
References
- In smart contract function signatures, avoid redundant parameters that can be derived from the transaction context.
- Smart contract events should index address fields (such as recipients) and downstream record IDs to facilitate off-chain filtering and reconciliation. Ensure the number of indexed parameters remains within the EVM limit of three per event.
| | `executeBuyback(token, amount, minTokenOut)` | Governance multisig or `keeper`: swap `amount` of `token` for ≥ `minTokenOut` TOKEN and burn the proceeds. | | ||
| | `setKeeper(addr)` / `setSwapRouter(addr)` / `setPool(addr)` | Governance: rotate the authorized keeper, swap router, or pool. | | ||
| | `setSlippageTolerance(bps)` / `setMinBuybackAmount(n)` / `setMaxBuybackAmount(n)` | Governance: per-call execution guards. | | ||
| | `keeper() → address` / `getAccumulatedFees(token) → uint256` | Views: current keeper and accumulated buyback inflow per token. | | ||
| | `keeper() → address` / `getAccumulatedFees(token) → uint256` | Views: current keeper and accumulated buyback inflow (USDC). | |
There was a problem hiding this comment.
The executeBuyback and getAccumulatedFees functions still include a token parameter in their signatures. Since the protocol has been simplified to a single immutable USDC token, these parameters are redundant. Removing them ensures documentation consistency across the ADR and eliminates stale references to multi-token support.
| | `executeBuyback(token, amount, minTokenOut)` | Governance multisig or `keeper`: swap `amount` of `token` for ≥ `minTokenOut` TOKEN and burn the proceeds. | | |
| | `setKeeper(addr)` / `setSwapRouter(addr)` / `setPool(addr)` | Governance: rotate the authorized keeper, swap router, or pool. | | |
| | `setSlippageTolerance(bps)` / `setMinBuybackAmount(n)` / `setMaxBuybackAmount(n)` | Governance: per-call execution guards. | | |
| | `keeper() → address` / `getAccumulatedFees(token) → uint256` | Views: current keeper and accumulated buyback inflow per token. | | |
| | `keeper() → address` / `getAccumulatedFees(token) → uint256` | Views: current keeper and accumulated buyback inflow (USDC). | | |
| | executeBuyback(amount, minTokenOut) | Governance multisig or keeper: swap amount of USDC for ≥ minTokenOut TOKEN and burn the proceeds. | | |
| | setKeeper(addr) / setSwapRouter(addr) / setPool(addr) | Governance: rotate the authorized keeper, swap router, or pool. | | |
| | setSlippageTolerance(bps) / setMinBuybackAmount(n) / setMaxBuybackAmount(n) | Governance: per-call execution guards. | | |
| | keeper() → address / getAccumulatedFees() → uint256 | Views: current keeper and accumulated buyback inflow (USDC). | |
References
- In smart contract function signatures, avoid redundant parameters that can be derived from the transaction context.
- When refactoring or removing protocol features, perform a comprehensive update of all related documentation, including ADR tables and diagrams, to eliminate stale references.
- Ensure protocol documentation is internally consistent by verifying that function descriptions, field lists, and edge-case logic are aligned across all sections of the document.
…xisting #NNN refs Follow-ups on #591 review: - Contract renamed StablePaymentChannel -> PaymentChannel corpus-wide (68 refs across 9 ADRs; the name is free now that the multi-token PaymentChannel is gone). EIP-712 domain `name` string and the camelCase instance var updated for consistency; the intra-doc #stablepaymentchannel anchor in ADR 003 repointed to #paymentchannel. - Removed pre-existing bare GitHub PR refs (#578/#421) from the canon corpus per the adr/ self-containment convention: architecture.md and appendix-binaries.md (trivial parentheticals deleted, sentence-subject ref reworded preserving meaning). CLAUDE.md refs left intact (not spec). Verified: zero StablePaymentChannel residue, no broken anchors, adr/ fully self-contained (no issue/PR/repo refs), no multi-token residue, make check-book-list green (23 ADRs + 12 appendices), MD001 heading levels clean, pre-commit all green. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…le-USDC) gemini-code-assist flagged token params now redundant under the single immutable USDC model; verified against ADR 016, which already dropped them — so this resolves a real cross-ADR inconsistency, not just style: - ADR 003 ChannelOpened event: drop non-indexed `token` (always the fixed USDC address; channelId/client/provider stay the 3 indexed). - ADR 003 BuybackBurner: executeBuyback(amount, minTokenOut), getAccumulatedFees() — `token` param removed (input is USDC). - ADR 018: executeBuyback signature aligned to the same (no `token`). Kept the doc's 3-column event table format rather than the bot's Solidity-signature rewrite. pre-commit/markdownlint green. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Summary
Launch with a single payment token, USDC, address fixed at contract deployment (immutable constructor argument). No governance allowlist, no
addToken/removeToken, no per-token rate bounds, no Token Vetting Checklist, no oracle/swap on-protocol. This supersedes the multi-stablecoin variant (#583 / closed PR #585).Per your instruction, this reads as canon — there is no
Dropped/Superseded/"deferred to ADR 010" or PoC-then-multi-token framing anywhere in the rendered spec (that was the mistake in closed PR #585). The rejected design is recorded only inadr/_history/alternatives-pre-launch.md, which is the project's canonical rejected-alternatives location (out of both built PDFs, no ADR breadcrumb — peradr/README.md§ Decision-record context).Closes #591.
What changed (20 files, +65 / −370)
adr/_history/alternatives-pre-launch.md.CLAUDE.mdrecords "do not reuse 010" (same handling as 027/029).StablePaymentChannelis the launch and production contract (USDC address immutable);channelIdhas notokencomponent; decimals fixed at 6;forceCloseChannel/ChannelForceClosedByTokenRemoval/ token-removal removed; the#### Multi-token extensionsubsection removed; Circle-freeze is stated as an accepted counterparty risk (no deferral).PaymentChannel/ allowlist / per-token → single USDC): 008, 009, 012, 013, 016, 018, 019, 026,README.md,architecture.md(Chapter 3 reading order + numeric index + assumptions),glossary.md,_build/part-3-payments.md, MakefileBOOK_SRCS, and the operator-key-rotation / operator-upgrade-path / poc-production-seams appendices. Former ADR-010 inbound links repointed (rate-boundsu64→ ADR 005;maxChannelDuration→ ADR 003) or removed.Locked-for-implementation→Draft. It was touched forStablePaymentChannelnaming consistency and to drop a hypothetical multi-currency aside. Needs re-approval (see below). ADRs 028 / 032 (also Locked) were not touched.Verification
ADR 010/multi-token/PaymentChannel/addToken/removeToken/ allowlist / per-token /forceCloseChannelanywhere in the canon corpus (_history/retains the archived rejection, as intended).make check-book-listgreen — book list in sync (23 ADRs + 12 appendices).adr/self-contained: this change adds zero new issue/PR/self-repo refs to ADR bodies.pre-commit(markdownlint + all hooks): all Passed.Needs your call
Draftbecause it was edited. The economic decisions are unchanged (only a contract-name consistency fix + dropping a multi-currency hypothetical) — re-approve back toLocked-for-implementation, or review separately?StablePaymentChannelcontract name vs. simplify toPaymentChannel(only one contract now)? I keptStablePaymentChannel(established name; minimal churn).adr/architecture.md:177andadr/appendix-binaries.mdcarry bare(#578)/#421refs from the unrelated config-types work — flagging per the adr/ self-containment convention; not fixed here to keep this PR scoped. Want a separate cleanup issue?Test plan
cd adr && make(mermaid build) renders without broken cross-refs