Repository navigation
refactor(contracts): remove on-chain Genesis Bond Credit; update emission schedule - #799
Conversation
…sion schedule Remove the on-chain Genesis Bond Credit subsystem from CapacityBond and SlashEscrowLib — early/testnet operator rewards move to off-chain TGE unlocks with no contract surface. Contracts: - CapacityBond: drop grant/vest/claim/forfeit surface, GENESIS_GRANTOR_ROLE, PendingCredit struct/mapping, genesisCreditWindow constructor param, treasury/setTreasury, and claimSlashGateEpochs. slash(), _mintSlashRecord, and settleAppealGranted are now bond-only; a granted appeal refunds the full escrowed bond liquid. - SlashEscrowLib: drop creditPortion from SlashRecord/mint/settleGranted (struct shrinks 4->3 slots). - Deploy scripts: drop the genesis-credit wiring and assertions. - Tests: delete genesis-credit tests; fix all CapacityBond constructor call sites; add zero-bond slash coverage (finalize + granted-appeal no-op paths); regenerate .gas-snapshot. Docs (ADR is single source of truth): - ADR 026: remove the Genesis Bond Credits section; DAO Treasury keeps a flat 15% (30% at TGE, then 48mo linear); refresh the full Lock & Vest emission schedule across the allocation table and the TGE-unlock / liquid-float / sell-pressure / App Incentives sections. - ADRs 016/028/036/008, architecture, glossary, observability and key-rotation appendices, and CLAUDE.md: drop all stale genesis references. No Rust changes; vesting is off-chain (no vesting contract). 456 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Gas snapshotGas changes vs baseRun: 26907119727 |
Contracts coverageLine coverage: 88.61% (1704/1923 lines) |
There was a problem hiding this comment.
Pull request overview
This pull request removes the on-chain Genesis Bond Credit mechanism from the Solidity contracts (and all associated deployment wiring/tests), making slashing/appeals strictly bond-only, and updates the tokenomics/references across ADR documentation to reflect the new off-chain unlock/subsidy approach.
Changes:
- Refactors
CapacityBondandSlashEscrowLibto remove all genesis-credit accounting and make appeal refunds purely liquid bond refunds. - Updates deployment scripts and all contract tests to match the new constructor/API surface; adds coverage for zero-bond slash/appeal paths and regenerates gas snapshots.
- Refreshes ADR/tokenomics docs and removes stale genesis-credit references across architecture/glossary/appendices.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| contracts/test/SlashAppeal.t.sol | Removes genesis-credit appeal test and updates constructor args. |
| contracts/test/GovernanceLifecycle.t.sol | Drops governance lifecycle coverage for removed treasury/claim-gate setters and updates constructor args. |
| contracts/test/E2EProtocol.t.sol | Updates comments/expectations for bond-only granted-appeal refunds and constructor args. |
| contracts/test/DeployProtocolScript.t.sol | Removes deploy config assertion for genesis credit window. |
| contracts/test/DeployProtocol.t.sol | Removes cross-contract wiring test for GENESIS_GRANTOR_ROLE and updates constructor args. |
| contracts/test/CapacityBondRegionE2E.t.sol | Updates constructor args to remove genesis credit window. |
| contracts/test/CapacityBond.t.sol | Deletes genesis-credit tests/helpers; adds new zero-bond slash/appeal coverage; updates docstrings and constructor args. |
| contracts/src/SlashEscrowLib.sol | Removes creditPortion from SlashRecord and settle APIs; keeps escrow state machine bond-only. |
| contracts/src/interfaces/ICapacityBond.sol | Updates interface docs to remove genesis-credit references and clarify bond-only slash amounts. |
| contracts/src/CapacityBond.sol | Removes all genesis-credit surface/storage/roles; makes slashing + appeal settlement bond-only. |
| contracts/script/DeployProtocol.s.sol | Removes genesis-credit env var/default wiring from deploy script config. |
| contracts/script/BaseProtocolDeploy.s.sol | Removes config field and peer-role wiring/assertions for genesis grantor role. |
| contracts/.gas-snapshot | Regenerates gas snapshot after surface/tests changes. |
| CLAUDE.md | Updates ADR history notes to document genesis-credit removal and related doc touchpoints. |
| adr/glossary.md | Updates glossary tokenomics terms to remove genesis-credit definitions and adjust App Incentives schedule text. |
| adr/architecture.md | Removes genesis-credit references from the architecture overview/index. |
| adr/appendix-operator-key-rotation.md | Removes references to PendingCredit surviving key rotation. |
| adr/appendix-observability.md | Removes genesis-credit metrics section and updates CapacityBond metric descriptions. |
| adr/036-served-bytes-voting-weight.md | Updates multi-slash watermark explanation to remove claim-vs-credit gating mention. |
| adr/028-slashing-appeals.md | Removes Genesis Bond Credits section from slashing appeals ADR. |
| adr/026-tokenomics.md | Reworks allocation/vesting schedule and replaces genesis-credit mechanism with off-chain recognition + USDC subsidy framing. |
| adr/016-contract-interactions.md | Updates contract inventory/diagrams/call graphs to remove genesis-credit surface and wiring. |
| adr/008-reputation.md | Updates tokenomics cross-reference to remove genesis-credit bootstrap framing. |
| adr/_build/part-4-tokenomics.md | Updates built tokenomics chapter text to remove genesis-credit reference. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request completely removes the on-chain Genesis Bond Credit mechanism from the protocol's smart contracts, deployment scripts, tests, and architectural documentation (ADRs). This includes deleting the CapacityBond grant, vest, claim, and forfeit logic, the GENESIS_GRANTOR_ROLE, PendingCredit accounting, and the credit-slashing paths. The 5% tokenomics allocation previously earmarked for this mechanism is folded back into the operational DAO Treasury, shifting testnet operator recognition to a discretionary off-chain distribution. There are no review comments to assess, and the changes successfully streamline the contract surface.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Copilot review: the group was labeled "Exchange Partnerships (co-marketing)" in the allocation table and the TGE-unlock paragraph but plain "Exchange Partnerships" in the internal/external and sell-pressure rollups. Use the plain canonical name everywhere (matching every other group's rollup usage and avoiding nested parens in the rollup lists); the co-marketing nature is retained in the row mechanic cell and the sell-pressure rationale. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Re-review (pr-test-analyzer): the zero-bond tests asserted `slashedAtEpoch > 0`, which is near-trivially true since the watermark is +1-encoded (any slash stamps >= 1) — and the accompanying comment wrongly credited the warp for the non-zero value. Assert the exact +1-encoded epoch (3 = epoch 2 + 1) in both tests so the stamp arithmetic is actually pinned, and add a SlashReversed(slashId, op, 0) expectEmit so a regression that stops emitting over a zero-amount record is caught. Regenerate .gas-snapshot. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Summary
Removes the on-chain Genesis Bond Credit subsystem and replaces it with off-chain TGE unlocks (no contract surface), then refreshes the tokenomics emission schedule in the ADRs.
Contracts
GENESIS_GRANTOR_ROLE, thePendingCreditstruct/mapping, thegenesisCreditWindowconstructor param,treasury/setTreasury, andclaimSlashGateEpochs.slash(),_mintSlashRecord, andsettleAppealGrantedare now bond-only — a granted appeal refunds the full escrowed bond liquid.creditPortionfromSlashRecord/mint/settleGranted(struct shrinks 4→3 slots)._assertPeerRolesWiredassertion.CapacityBondconstructor call site, add zero-bond slash coverage (finalize + granted-appeal no-op paths), and regenerate.gas-snapshot.CapacityBondruntime size drops to ~21KB, easing the EIP-170 ceiling pressure.Docs (ADRs are the single source of truth)
architecture.md,glossary.md, the observability + key-rotation appendices, andCLAUDE.md: drop all stale genesis references (no dangling anchors).No Rust changes — vesting is off-chain (no vesting contract).
Test plan
forge build --deny warnings(FOUNDRY_PROFILE=ci) ✅forge test→ 456 passed, 0 failed ✅forge fmt --check, aderyn (fail-on high), slither (fail-on medium) ✅cargo build✅ (Rust untouched)make check-refs) ✅🤖 Generated with Claude Code