Repository navigation
Description
Summary
Follow-up to #449. With the contract inventory unified, the next blocker for audit-readiness is that several contracts have no canonical Solidity interface block in the ADRs — their signatures are scattered across narrative paragraphs, mermaid diagrams, and call-table rows. Other functions are referenced in cross-contract call graphs but never specified anywhere. This issue is the inventory pass; the actual fills land as a series of small ADR PRs (step 3 of the planning sequence).
Why now
Auditors and implementers both need a single canonical place per contract that says "here is the external surface". For PublisherRegistry, OriginAssignment, ContentBlacklist, StakingRegistry, StablePaymentChannel, SlashJudge, BuybackBurner, and TOKEN this exists today (formal interface IFoo { ... } blocks in ADR 002 / 003 / 011 / 014). For the remaining contracts in the unified inventory it does not.
This issue lists every gap; PRs against it land the missing interface blocks.
A. Missing formal interface blocks
For each contract below, no consolidated interface IFoo { ... } block exists in any ADR. Methods are inferred from prose, mermaid diagrams, and ADR 016 §3 call-table rows.
A.1 VotingEscrow (ADR 026 §4)
ADR 026 §4 describes the contract narratively and mentions createLock, increaseAmount, increaseUnlockTime, balanceOfAt, totalSupplyAt. Add a formal interface block to ADR 026 §4 covering at minimum:
createLock(uint256 amount, uint256 unlockTime)/increaseAmount(uint256)/increaseUnlockTime(uint256 unlockTime)/withdraw()balanceOf(address)/balanceOfAt(address, uint256 ts)/totalSupply()/totalSupplyAt(uint256 ts)delegate(address)(Governor Bravo pattern, referenced in ADR 009 §44)- Lock view:
locked(address) returns (uint256 amount, uint256 end) - Events:
LockCreated,LockIncreased,LockExtended,Withdrawn,DelegateChanged
A.2 FeeRouter (ADR 016 §1, ADR 026 §2)
The function-name pieces are scattered across the ADR 016 §3 call table, ADR 026 §2 narrative, and the ADR 016 §1 mermaid classDiagram block. Add a formal interface block to ADR 016 (new subsection §"FeeRouter contract surface") covering:
routeSettlement(address operator, uint256 bytesDelivered, uint256 amount)(signature confirmed by ADR 003 §110, §407 and ADR 016 §283 — verify all three stay in sync)claimBoost(uint256[] epochs)/claimDelegator(uint256[] epochs)commitEpochReceiptRoot(uint256 epoch, bytes32 root)/commitEpochSummary(...)(called by operators; see §B.3 below)workingBytes(address operator, uint256 epoch)/ read-side surface for off-chain claim simulationexecuteDelegatorSwap(uint256 epoch, uint256 minOut)(KEEPER_ROLE)- Tunability surface from ADR: unify contract surface; drop PoC/Production phasing in favor of tunable economics #449 §B (see §B.4 below)
- Events:
Settled,BoostClaimed,DelegatorClaimed,EpochReceiptRootCommitted,DelegatorSwapped, plus the share/dependency setter events
A.3 SafetyReserve (ADR 026 §5, ADR 028)
ADR 028 §123 defines the appeal extensions but the base interface (payout, incidents) is only referenced. Consolidate in ADR 026 §5 (and link from ADR 028):
payout(bytes32 bundle, address recipient, uint256 amount)—PAYOUT_AUTHORIZER_ROLEper ADR 016 §454incidents(uint256 id)view returning the on-chain incident record- ADR 028 §123 appeal extensions:
openSlashAppeal/fastTrackAppeal/rejectAppeal/ratifyAppeal/reverseAppeal - Slashing-redirect inflow surface (
StakingRegistrycallsSafetyReservewith TOKEN; per ADR 016 §300 row — what's the function signature it calls?) - Keeper-triggered TOKEN→USDC swap path per ADR 016 §190 (same Vault-scoped self-approval pattern as
BuybackBurner) - Events:
IncidentRecorded,Paid,SlashAppealOpened,SlashAppealFastTracked,SlashAppealRejected,SlashAppealRatified,SlashAppealReversed,SlashedTokenReceived,SwapExecuted
A.4 DelegatorBuyer (or BuybackBurner-multi-output mode)
ADR 026 §6 describes the swap behavior; ADR 016 §35 leaves the implementation choice deferred. Either way, FeeRouter.executeDelegatorSwap needs to know what it's calling. Add a minimal interface to ADR 026 §6:
swapDelegatorBucket(uint256 epoch, uint256 amountIn, uint256 minOut)—KEEPER_ROLEorFeeRouter-only- A defined return path so swapped TOKEN ends up in
FeeRouter's delegator bucket forclaimDelegatorto draw against (storage write target needs to be specified — doesDelegatorBuyerpush toFeeRouter, or doesFeeRouterpull?)
B. Function signatures referenced but never specified
B.1 StakingRegistry.isActive(address operator) → bool
Referenced in:
- ADR 016 §3 call graph line
OA -->|"isActive(operator)"| SR - ADR 016 §3 call table row 295 (
OriginAssignment → StakingRegistry: isActive(operator)) - ADR 011 §454 (
OriginAssignment reads StakingRegistry.isActive(operator)) - ADR 016 §586, §587, §591 (
OriginAssignment.proposeAssignment/activateAssignment/ default-open setters validate per operator)
Not in IStakingRegistry definition. Add to ADR 003 §"IStakingRegistry interface" (currently around §623 where nodeIdOf lives).
B.2 nodeIdOf return type — pick one
Cross-ADR inconsistency:
- ADR 003 §623:
function nodeIdOf(address operator) external view returns (bytes32 nodeId, bool active);(tuple) - ADR 022 §148: also claims tuple return ("a single read per operator, returning
(nodeId, active)") - Implementation in feat(contracts): scaffold PoC EVM contract set per ADR 016 #237: returns plain
bytes32(noactiveflag)
Resolve by either: (a) splitting into nodeIdOf(address) returns (bytes32) + isActive(address) returns (bool) (matches §B.1), or (b) keeping the tuple. Recommendation: (a) — separate functions are cheaper to compose and avoid tuple-return gas overhead when callers only need one value. Update ADR 003 §623 and ADR 022 §148 accordingly.
B.3 commitEpochReceiptRoot / commitEpochSummary full spec
ADR 003 §407 says "operators commit per-epoch roots directly to FeeRouter.commitEpochReceiptRoot (see ADR 027 §4)". ADR 016 §538 references the same names. The full signatures, who-can-call rules, when-callable rules, storage layout, and interaction with routeSettlement and claimBoost need a formal spec in ADR 027 §4 (anchoring) — and a back-link from ADR 026 §3 (gauge formula).
B.4 Tunability surface from #449 §B
Issue #449 §B specifies the tunability pattern but the actual function signatures haven't landed in any ADR:
FeeRouter.setShares(uint256 operatorBaseBps, uint256 gaugeBoostBps, uint256 delegatorBps, uint256 buybackBps, uint256 treasuryBps, uint256 safetyBps)—GOVERNANCE_ROLE, sum-to-10000 invariant, cross-validation against dependency addressesFeeRouter.setVotingEscrow(address)/setSafetyReserve(address)/setDelegatorBuyer(address)/setBuybackBurner(address)/setTreasury(address)—GOVERNANCE_ROLE, governance timelock- Read views:
getShares() returns (uint256[6]),votingEscrow() / safetyReserve() / delegatorBuyer() / buybackBurner() / treasury()address getters
Lands as part of A.2 in ADR 016.
B.5 PaymentChannel.setFeeRouter carve-out
ADR 003 §341 declares the function. #449 §C adds the §97 carve-out clarifying that helper-contract addresses are governance-mutable on signing contracts. The actual setter signature, the role that can call it, and the timelock requirement are not yet specified in ADR 003. Add to ADR 003 §"Governance functions" near §341.
B.6 StakingRegistry → SafetyReserve slashing-redirect call
ADR 016 §300 row says StakingRegistry → SafetyReserve for the 30% slashed-TOKEN redirect, but the receiving function on SafetyReserve is unnamed. Either:
SafetyReserveexposes asafeTransfer-only inflow (no callback) andStakingRegistry.slashdoessafeTransfer(safetyReserve, slashedAmount * 30 / 100)— simplestSafetyReserve.recordSlashInflow(address slashedNode, uint256 amount)for indexed accounting
Pick one and specify in §A.3.
C. Construction and init edge cases
C.1 FeeRouter zero-address dependencies
Issue #449 §A & §E state that FeeRouter deploys with zero-address dependencies for VotingEscrow / SafetyReserve / DelegatorBuyer if those aren't ready, with setShares cross-validation enforcing share=0 when address=0. The constructor parameter list in ADR 016 §152 currently requires all addresses. Update §152 to allow zero addresses and document the cross-validation invariant.
C.2 OriginAssignment edge cases
ADR 011 §"Contract: OriginAssignment" specifies the proposal/activation flow but does not enumerate edge cases:
- Zero proposed operators in
proposeAssignment— revert? allow as "remove all origins"? - Multiple pending proposals for the same namespace — overwrite previous, or revert until previous is activated/expired?
- Pending proposal expiry — does a stale proposal time out, or does it sit until manually replaced?
- All proposed operators become inactive between proposal and activation —
activateAssignmentreverts and publisher must re-propose (ADR 011 §427) — confirmed; document the storage-cleanup behavior for the rejected proposal
Resolve in ADR 011 §"Contract: OriginAssignment" or in a new §"Edge cases" subsection.
C.3 PublisherRegistry namespace registration cap & timelock binding
ADR 002 §93 says "per-publisher namespace cap and ownership-transfer timelock are governable parameters with safety bounds (see ADR 009)". ADR 009 §92 has the bounds. The actual setter functions (setMaxNamespacesPerPublisher, setNamespaceTransferTimelock) and which contract holds these (governance parameter store vs PublisherRegistry-local) need to be pinned. Add to ADR 002 §"Contract: PublisherRegistry".
Out of scope
- Implementation. Each gap fill is an ADR-only PR. The implementation issue is downstream after ADR: unify contract surface; drop PoC/Production phasing in favor of tunable economics #449 + this issue + the ADR fills land.
- New economic decisions. This issue surfaces missing interfaces for already-decided behavior. If filling a gap requires picking new economic semantics (e.g. swap return path in §A.4), the corresponding ADR PR makes that decision narrowly; it's not a new ADR.
- Inventory consolidation. That's ADR: unify contract surface; drop PoC/Production phasing in favor of tunable economics #449.
- ADR 026 / 027 / 028 design lock-down. Separate review pass — also surfaced as a follow-up by ADR: unify contract surface; drop PoC/Production phasing in favor of tunable economics #449.
Acceptance
Each subsection becomes one ADR PR. Track here:
- §A.1
VotingEscrowinterface block in ADR 026 §4 - §A.2
FeeRouterinterface block in ADR 016 (new subsection) - §A.3
SafetyReserveinterface block in ADR 026 §5 (with appeals extensions consolidated from ADR 028) - §A.4
DelegatorBuyerminimal interface in ADR 026 §6 - §B.1
StakingRegistry.isActive(operator)in ADR 003 IStakingRegistry block - §B.2
nodeIdOfreturn type aligned across ADR 003 §623, ADR 022 §148, and feat(contracts): scaffold PoC EVM contract set per ADR 016 #237's source - §B.3
commitEpochReceiptRoot/commitEpochSummaryfull spec in ADR 027 §4 - §B.4
FeeRoutertunability setters in ADR 016 - §B.5
PaymentChannel.setFeeRoutersetter spec in ADR 003 - §B.6
StakingRegistry → SafetyReserveredirect call signature pinned - §C.1
FeeRouterzero-address constructor in ADR 016 §152 - §C.2
OriginAssignmentedge cases in ADR 011 - §C.3
PublisherRegistrycap/timelock setters in ADR 002
Related
- Depends on: ADR: unify contract surface; drop PoC/Production phasing in favor of tunable economics #449 (unified inventory)
- Blocks: ADR 026 / 027 / 028 surface lock-down + implementation issue
- References: ADR 002, 003, 009, 011, 014, 016, 022, 026, 027, 028
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): split nodeIdOf, add isActive, spec setFeeRouter (#450 §B.1…
docs(adr): VotingEscrow interface block in ADR 026 §4 (#450 §A.1) (#456)
docs(adr): FeeRouter interface block in ADR 016 §1 (#450 §A.2 + §B.4 …
docs(adr): SafetyReserve + DelegatorBuyer interface blocks (#450 §A.3…
docs(adr): full receipt-anchoring spec in ADR 027 §4 (#450 §B.3) (#460)
docs(adr): OriginAssignment edge cases + PublisherRegistry setters (#450
docs(adr): pin gap-fix items (timing bounds, commitEpochSummary valid…