Add ERC-6372 Contract Clock interface to VestingWallet#6478
Add ERC-6372 Contract Clock interface to VestingWallet#6478Dnreikronos wants to merge 1 commit intoOpenZeppelin:masterfrom
Conversation
🦋 Changeset detectedLatest commit: 4c78000 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThe changes add ERC-6372 (Contract Clock interface) support to the VestingWallet contract. VestingWallet now implements the IERC6372 interface, introducing a 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #6389
Why
VestingWallet uses
block.timestampfor all its vesting logic, but there's no standard way for external tooling or indexers to know that. ERC-6372 is a two-function interface (clock()+CLOCK_MODE()) that answers this question at the contract level. The Governor and Votes contracts in this repo already implement it, VestingWallet justnever got it.
What changed
VestingWalletnow implementsIERC6372clock()returnsTime.timestamp(), same approach asVotes.solwithTime.blockNumber()CLOCK_MODE()returns"mode=timestamp"shouldBehaveLikeERC6372('timestamp')behavior fromERC6372.behavior.jsImpact
VestingWalletCliffinherits the new functions automatically, no changes needed therePR Checklist
npx changeset add)