Skip to content

docs(adr): VotingEscrow interface block in ADR 026 §4 (#450 §A.1) - #456

Merged
alpergundogdu merged 2 commits into
mainfrom
adr/450-pr2-votingescrow
May 7, 2026
Merged

alpergundogdu merged 2 commits into
mainfrom
adr/450-pr2-votingescrow

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Summary

Second slice of #450. Closes §A.1 — the formal interface IVotingEscrow { ... } block in ADR 026 §4.

Adds a new "#### Contract: VotingEscrow" subsection between "#### Lock ownership" and "### 5. Safety and insurance reserve". The interface signatures were previously scattered across §4 prose and the ADR 016 §1 classDiagram; this consolidates them in one canonical place.

Decisions baked in (per planning conversation)

Decision Pick Rationale
Lock-extension API increaseUnlockTime(uint256 unlockTime) (absolute) Matches Curve veCRV literature; absolute timestamps are unambiguous
Lock view locked(address) returns (uint256 amount, uint256 end) Single tuple; matches veCRV's locked mapping; one RPC for the common query
Vote delegation OZ Governor Bravo: delegate + delegateBySig + delegates + DelegateChanged + DelegateVotesChanged Existing Bravo-aware tooling (Tally, Boardroom) integrates without adapter
createLock return void; one-lock-per-address (veCRV style) NFT-per-lock is out of scope; if needed later, an additive top-level contract holds a single pooled lock here
balanceOfAt argument uint256 timestamp ve-weight decays linearly in time; matches §91 prose
Withdrawal pattern withdraw() lump-sum after expiry veCRV pattern; no early-exit per §4 invariant
Events The minimal six Supply event nice-to-have but totalSupplyAt provides the same data on demand

Notes added to the spec

  • getVotes / getPastVotes deliberately omitted — Governor (per §9) reads through balanceOfAt(user, ts) since ve-weight is timestamp-based, not block-number-based.
  • Delegation reassigns voting weight but not the underlying ve-position; locks remain non-transferable.
  • One-lock-per-address constraint flagged so a future NFT-per-lock proposal would be an additive top-level contract.

Out of scope

  • Other §450 items: §A.2 (FeeRouter), §A.3 (SafetyReserve), §A.4 (DelegatorBuyer), §B.3 (commitEpochReceiptRoot), §B.6 (SafetyReserve redirect), §C.1–§C.3. These land in four follow-up PRs.

Test plan

  • pre-commit run --files adr/026-gauge-boost-tokenomics.md clean
  • Render the new "Contract: VotingEscrow" subsection on GitHub and verify the embedded Solidity code-block fences correctly with comment alignment
  • Verify the §4 narrative still reads coherently — the new block goes after "#### Lock ownership" and shouldn't disrupt the flow into §5

Related

🤖 Generated with Claude Code

Adds a formal `interface IVotingEscrow { ... }` block to ADR 026 §4
"Voting escrow (VotingEscrow)" as a new "#### Contract: VotingEscrow"
subsection. Closes the §A.1 acceptance bullet in #450.

Surface (per planning conversation):

- Lock lifecycle: createLock(amount, unlockTime), increaseAmount(amount),
  increaseUnlockTime(unlockTime) — absolute-timestamp pattern matching
  veCRV; createLock returns void (one-lock-per-address). withdraw() is
  lump-sum after expiry, no early-exit.
- Lock view: locked(account) returns (uint256 amount, uint256 end) —
  bundled tuple, single read for the common query.
- ve-balance: balanceOf, balanceOfAt(account, timestamp), totalSupply,
  totalSupplyAt(timestamp) — historical reads keyed by unix timestamp
  (not block number) since ve-weight decays linearly in time.
- Delegation: OZ Governor Bravo pattern — delegate(address),
  delegateBySig(...), delegates(account) returns (address). Reassigns
  voting weight only; ve-position remains non-transferable.
- Events: LockCreated, LockIncreased, LockExtended, Withdrawn,
  DelegateChanged, DelegateVotesChanged.
- Notes: getVotes / getPastVotes deliberately omitted because Governor
  reads through balanceOfAt(timestamp), not getPastVotes(blockNumber).

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 introduces the IVotingEscrow interface to the gauge boost tokenomics ADR, defining the lifecycle and delegation logic for ve-locked tokens. Feedback suggests correcting the documentation for the locked function to clarify it accepts an account parameter and streamlining the design notes by removing historical narratives and external protocol comparisons to align with documentation standards.

Comment thread adr/026-gauge-boost-tokenomics.md Resolved
Comment thread adr/026-gauge-boost-tokenomics.md Resolved
- Fix locked() comment: "caller's" → "specified account's" (function
  takes an `account` parameter; not necessarily msg.sender).
- Trim Notes subsection: drop historical-narrative framing (NFT-per-lock
  out-of-scope mention, Curve veCRV literature comparison, Bravo-tooling
  marketing) per the read-as-canon rule. Keep the three load-bearing
  facts: one-lock-per-address, getVotes/getPastVotes omitted with the
  timestamp-vs-block-number rationale, and the delegation/non-transfer
  invariant.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@alpergundogdu
alpergundogdu merged commit 3d89495 into main May 7, 2026
9 checks passed
@alpergundogdu
alpergundogdu deleted the adr/450-pr2-votingescrow branch May 7, 2026 14:46
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.

1 participant