Repository navigation
Description
Summary
ADR 016 §1's contract inventory currently splits the surface into "PoC + Production", "PoC only", and "Production only" rows. This phasing is misleading: two contracts tagged "PoC + Production" (PublisherRegistry, OriginAssignment) have no implementation, while contracts tagged "Production only" (FeeRouter, VotingEscrow, SafetyReserve) are load-bearing for ADR 022 / 026 / 027 / 028 claims that the rest of the spec treats as canonical. The in-flight scaffolding PR (#237) further made its own scope cuts that don't match the inventory tags.
Decision: drop the Phase column. Specify the full contract surface with tunable bucket shares and governance-mutable dependency addresses so a single deployment can launch with a simplified economic configuration (e.g. 80% operator / 10% buyback / 10% treasury) and dial up gauge boost / delegator pool / safety reserve as the dependent ADRs and infrastructure stabilize. Single audit covers the full surface.
Why now
- PR feat(contracts): scaffold PoC EVM contract set per ADR 016 #237 will be closed in favor of a clean restart with the unified scope.
- The current ADR set treats
FeeRouter,VotingEscrow,SafetyReserveas deferred but ADRs 003 / 008 / 022 / 026 / 027 / 028 read against their interfaces as if they exist. The phasing distinction creates more confusion than it saves. - One audit pass against the full surface is materially cheaper than auditing twice with a migration in between, and it locks the public interface that off-chain integrations (clients, indexers, monitors) will integrate against.
Scope
A. ADR 016 §1 — inventory rewrite
Drop the Phase column. Replace the inventory table with the full contract surface:
| Contract | ADR | Holds Funds | Token Types | OZ Base Contracts |
|---|---|---|---|---|
| TOKEN (ERC-20) | 026 | No | — | ERC20, ERC20Permit, ERC20Votes |
| StakingRegistry | 003, 026 | Yes | TOKEN | AccessControl, ReentrancyGuard, Pausable, EIP712 |
| StablePaymentChannel | 003 | Yes | USDC | Ownable, ReentrancyGuard, Pausable, EIP712 |
| FeeRouter | 026 | Yes | USDC, TOKEN | AccessControl, ReentrancyGuard, Pausable |
| VotingEscrow | 026 | Yes | TOKEN (locked) | ReentrancyGuard, Pausable |
| SafetyReserve | 026, 028 | Yes | USDC, TOKEN | AccessControl, ReentrancyGuard, Pausable |
| BuybackBurner | 018, 026 | Yes | USDC, TOKEN | AccessControl, ReentrancyGuard, Pausable |
| DelegatorBuyer | 026 | Yes | USDC, TOKEN | AccessControl, ReentrancyGuard, Pausable |
| ContentBlacklist | 011 | No | — | AccessControl, ReentrancyGuard |
| PublisherRegistry | 002 | No | — | AccessControl, ReentrancyGuard |
| OriginAssignment | 011 | No | — | AccessControl, ReentrancyGuard |
| SlashJudge | 014 | Yes | TOKEN | AccessControl, ReentrancyGuard, Pausable, EIP712 |
| DecdnGovernor | 009 | No | — | OZ Governor + GovernorSettings + GovernorVotes + GovernorVotesQuorumFraction + GovernorTimelockControl |
| TimelockController | 009 | Yes (treasury custodian) | USDC | OZ TimelockController (no custom code) |
ContentBlacklist covers the full surface: hash-level (global + regional), operator-level (addOrigin / removeOrigin / isOriginBlacklisted), and the blacklist-entry appeal API per ADR 011.
StakingRegistry includes isActive(operator) (currently missing from the spec'd interface).
SafetyReserve includes the ADR 028 appeal extensions (openSlashAppeal / fastTrackAppeal / rejectAppeal / ratifyAppeal / reverseAppeal).
B. ADR 016 — new section: Tunable Economics
Document the shipping-day configuration pattern:
- Bucket shares are governance-mutable.
FeeRouter.setShares(operatorBaseBps, gaugeBoostBps, delegatorBps, buybackBps, treasuryBps, safetyBps)updates the six-bucket split with a sum-to-10000 invariant. Default ship config is 80/0/0/10/10/0; steady-state target per ADR 026 §2 is 40/40/7/5/5/3. - Dependency addresses are governance-mutable.
FeeRouter.setVotingEscrow(addr),setSafetyReserve(addr),setDelegatorBuyer(addr)may be called any time. Cross-validation:setShares(...)reverts if any non-zero share has its destination set toaddress(0). - Inactive buckets accumulate zero with no reverts. Same-tx legs (operator / buyback / treasury / safety) execute inline. Epoch-bucket legs (gauge / delegator) accumulate to per-epoch storage; at zero share, no storage writes happen and
claimBoost/claimDelegatorreturn zero. No code path reverts when a bucket is off. - Activation sequence is governance-driven. When
VotingEscrow/SafetyReserve/DelegatorBuyerare deployed and audited, governance calls the relevantset*(addr)thensetShares(...)to allocate.
C. ADR 016 §97 — carve-out for non-signing-contract addresses
Current text forbids proxy patterns to preserve EIP-712 domain-separator stability. Clarify that the immutability constraint applies only to fields included in voucher domain separators (i.e. PaymentChannel, SlashJudge self-addresses). Helper-contract addresses on those contracts — feeRouter on PaymentChannel, stakingRegistry on SlashJudge, contentBlacklist on OriginAssignment — may be governance-mutable without breaking signature validity. Add:
Non-signing helper contracts referenced by signing contracts may be re-pointed via governance-controlled setters (
setFeeRouter,setStakingRegistry, etc.) under standard 48h timelock. The EIP-712 immutability constraint applies only to fields included in voucher / challenge domain separators; helper addresses are not domain-separator inputs.
D. ADR 016 §3 — call table
Add the rows currently missing because the destination contracts were tagged "Production only":
FeeRouter→VotingEscrow(balanceOfAt,totalSupplyAt)FeeRouter→SafetyReserve(3% USDC same-tx)FeeRouter→DelegatorBuyer(delegator-pool USDC handoff)FeeRouter→BuybackBurner(5% USDC same-tx)StakingRegistry→SafetyReserve(30% slashed TOKEN)Governor→SafetyReserve(payout, appeal authorization)OriginAssignment→StakingRegistry(isActive(operator))OriginAssignment→PublisherRegistry(ownerOf(namespaceId))OriginAssignment→ContentBlacklist(isOriginBlacklisted)ContentBlacklist→StakingRegistry(ejectNodeviaaddOrigin)
E. ADR 016 §2 — deployment order
Update the dependency graph to include all 14 contracts, with a note that FeeRouter deploys with zero-address dependencies for VotingEscrow / SafetyReserve / DelegatorBuyer if those aren't ready, and the launch share config of 80/0/0/10/10/0 honors the cross-validation invariant.
F. Cross-ADR cleanups
- ADR 002: drop the framing that PoC operates on
namespaceId == 0only.PublisherRegistryexists; default-open semantics still apply pre-activation but on the same contract that production runs against. - ADR 011: drop the framing that
OriginAssignmentis production-only. The permissive bootstrap (isAuthorizedOrigin(0, op) == truefor any active staker until first DAO activation) is contract behavior, not a phase. - ADR 022 §1.6: drop the "pre-activation DHT-only" framing. The on-chain origin-directory fallback is always available; whether it returns results depends on whether governance has activated allow-lists and whether publishers have claimed namespaces.
- ADR 026 §2: mark the 40/40/7/5/5/3 share table as the steady-state target. Note that
FeeRouter.setSharesis governance-tunable from launch; default ship config is documented as 80/0/0/10/10/0. - ADR 026 §1 / TOKEN: drop the PoC-mintable variant. Production fixed-supply
TOKENis what gets built; testnet seeding is a one-time deploy-scriptmint()followed by ownership renounce (or simply a constructor_mint(deployer, supply)with nomint()function exposed at all). - CLAUDE.md: clarify that "PoC of tens of nodes" refers to network scale, not contract scope.
Out of scope
- Surface gaps in the canonical interfaces (e.g.
ContentBlacklist.isOriginBlacklistednot currently in the ADR 011 interface listing,StakingRegistry.isActive(operator)not in the ADR 016 §3 call table). These get audited in the next issue ("ADR surface gaps audit"). - Parameter values for ADR 026 / 027 / 028 (gauge-boost formula constants, epoch length, claim window, appeal windows). These remain governance-tunable post-deploy.
- Multi-token
PaymentChannelper ADR 010. PoC continues withStablePaymentChannel(USDC-only); rewiring issettleChannelforwards full balance toFeeRouter.routeSettlementinstead of inline fee-skimming, pluscommitReceiptRootper ADR 003 §118. DelegatorBuyervsBuybackBurner-multi-output-mode choice per ADR 016 §35 — implementation-time decision, both options preserve theFeeRoutercall surface.- Implementation. A separate "implement deCDN contract surface for audit" issue follows once steps 1–3 of the planning sequence are done.
Acceptance
- ADR 016 §1 inventory has no Phase column; all 14 contracts listed
- ADR 016 §"Tunable Economics" subsection added with the share-tunability + zero-address-dependency pattern documented
- ADR 016 §97 carve-out clarifies non-signing-contract address mutability
- ADR 016 §3 call table covers every cross-contract call in the unified surface
- ADR 016 §2 deployment order graph includes all 14 contracts
- ADR 002 / 011 / 022 framings cleaned of phase distinctions
- ADR 026 §2 marks 40/40/7/5/5/3 as steady-state target; documents launch default
- ADR 026 §1 fixed-supply
TOKENis the only spec'd variant - CLAUDE.md "PoC" framing scoped to network scale
Related
- Supersedes scope decisions in feat(contracts): scaffold PoC EVM contract set per ADR 016 #237 (which will be closed)
- Surfaces requirement: ADR 026 / 027 / 028 surface lock-down (formula shape, state machines, signatures) — separate review pass
- Follow-ups (in order):
- ADR surface-gap audit (this issue's "out of scope" §1)
- ADR 026 / 027 / 028 surface lock-down
- Implementation issue: "implement unified deCDN contract surface for audit"
- References: ADR 016, ADR 002, ADR 011, ADR 022, ADR 026, ADR 027, ADR 028, ADR 009, ADR 018
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
docs(adr): unify contract surface; drop PoC/Production phasing (#449)
docs(adr): unify contract surface; drop PoC/Production phasing (#449) (…
docs(adr): add depositDelegatorTokens callback to IFeeRouter
docs(adr): FeeRouter interface block in ADR 016 §1 (#450 §A.2 + §B.4 …
docs(adr): remove FeeRouter PoC stub allowance per production-from-da…