Skip to content

docs(adr): single-token USDC payments; drop ADR 010 multi-token - #593

Merged
alpergundogdu merged 3 commits into
mainfrom
claude/compassionate-mccarthy-81c116
May 19, 2026
Merged

alpergundogdu merged 3 commits into
mainfrom
claude/compassionate-mccarthy-81c116

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

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 in adr/_history/alternatives-pre-launch.md, which is the project's canonical rejected-alternatives location (out of both built PDFs, no ADR breadcrumb — per adr/README.md § Decision-record context).

Closes #591.

What changed (20 files, +65 / −370)

  • ADR 010 deleted entirely. Multi-token rejection (arbitrary-ERC-20, multi-stablecoin, per-node-arbitrary, and the chosen single-USDC design) archived in adr/_history/alternatives-pre-launch.md. CLAUDE.md records "do not reuse 010" (same handling as 027/029).
  • ADR 003 rewritten as single-token canon: StablePaymentChannel is the launch and production contract (USDC address immutable); channelId has no token component; decimals fixed at 6; forceCloseChannel / ChannelForceClosedByTokenRemoval / token-removal removed; the #### Multi-token extension subsection removed; Circle-freeze is stated as an accepted counterparty risk (no deferral).
  • Corpus sweep (multi-token / 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, Makefile BOOK_SRCS, and the operator-key-rotation / operator-upgrade-path / poc-production-seams appendices. Former ADR-010 inbound links repointed (rate-bounds u64 → ADR 005; maxChannelDuration → ADR 003) or removed.
  • ADR 026 status: Locked-for-implementation → Draft. It was touched for StablePaymentChannel naming consistency and to drop a hypothetical multi-currency aside. Needs re-approval (see below). ADRs 028 / 032 (also Locked) were not touched.

Verification

  • Corpus residual scan clean: no ADR 010 / multi-token / PaymentChannel / addToken/removeToken / allowlist / per-token / forceCloseChannel anywhere in the canon corpus (_history/ retains the archived rejection, as intended).
  • make check-book-list green — book list in sync (23 ADRs + 12 appendices).
  • MD001 heading-level scan clean (subsection/blockquote removals introduced no level skips).
  • 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

  1. ADR 026 re-approval. Flipped to Draft because it was edited. The economic decisions are unchanged (only a contract-name consistency fix + dropping a multi-currency hypothetical) — re-approve back to Locked-for-implementation, or review separately?
  2. Carried from Single-token launch: USDC-only, address fixed at deployment — reject #583, strip multi-token/allowlist from ADRs #591: (a) rename/retitle ADR 003 now that there's no PoC-vs-production token split? (b) keep the StablePaymentChannel contract name vs. simplify to PaymentChannel (only one contract now)? I kept StablePaymentChannel (established name; minimal churn).
  3. Pre-existing self-containment debt (out of scope here): adr/architecture.md:177 and adr/appendix-binaries.md carry bare (#578) / #421 refs 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

  • Reviewer confirms items 1–2
  • cd adr && make (mermaid build) renders without broken cross-refs

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]>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread adr/003-payments.md Outdated
| 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` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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.

Suggested change
| `ChannelOpened(channelId, client, provider, …)` | `openChannel` | `token` (USDC address), `deposit`, `expiresAt` |
| ChannelOpened(bytes32 indexed channelId, address indexed client, address indexed provider) | openChannel | deposit, expiresAt |
References
  1. In smart contract function signatures, avoid redundant parameters that can be derived from the transaction context.
  2. 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.

Comment thread adr/003-payments.md Outdated
Comment on lines +499 to +502
| `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). |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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.

Suggested change
| `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
  1. In smart contract function signatures, avoid redundant parameters that can be derived from the transaction context.
  2. When refactoring or removing protocol features, perform a comprehensive update of all related documentation, including ADR tables and diagrams, to eliminate stale references.
  3. 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]>
@alpergundogdu
alpergundogdu merged commit 2ff4f6e into main May 19, 2026
11 checks passed
@alpergundogdu
alpergundogdu deleted the claude/compassionate-mccarthy-81c116 branch May 19, 2026 11:23
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.

Single-token launch: USDC-only, address fixed at deployment — reject #583, strip multi-token/allowlist from ADRs

1 participant