Skip to content

Add ERC-6372 Contract Clock interface to VestingWallet#6478

Open
Dnreikronos wants to merge 1 commit intoOpenZeppelin:masterfrom
Dnreikronos:feat/vesting-wallet-erc6372
Open

Add ERC-6372 Contract Clock interface to VestingWallet#6478
Dnreikronos wants to merge 1 commit intoOpenZeppelin:masterfrom
Dnreikronos:feat/vesting-wallet-erc6372

Conversation

@Dnreikronos
Copy link
Copy Markdown

Fixes #6389

Why

VestingWallet uses block.timestamp for 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 just
never got it.

What changed

  • VestingWallet now implements IERC6372
  • clock() returns Time.timestamp(), same approach as Votes.sol with Time.blockNumber()
  • CLOCK_MODE() returns "mode=timestamp"
  • Tests reuse the shared shouldBehaveLikeERC6372('timestamp') behavior from ERC6372.behavior.js
  • Changeset entry added

Impact

  • VestingWalletCliff inherits the new functions automatically, no changes needed there
  • No storage layout changes, no new state variables
  • Two new public view/pure functions added to the ABI
  • Fully backward compatible

PR Checklist

  • Tests
  • Documentation
  • Changeset entry (run npx changeset add)

@Dnreikronos Dnreikronos requested a review from a team as a code owner April 12, 2026 16:15
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 12, 2026

🦋 Changeset detected

Latest commit: 4c78000

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openzeppelin-solidity Minor

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1cc5b64c-82fb-4ddc-b861-6bda89bb1ea7

📥 Commits

Reviewing files that changed from the base of the PR and between 9cfdccd and 4c78000.

📒 Files selected for processing (3)
  • .changeset/warm-walls-glow.md
  • contracts/finance/VestingWallet.sol
  • test/finance/VestingWallet.test.js

Walkthrough

The changes add ERC-6372 (Contract Clock interface) support to the VestingWallet contract. VestingWallet now implements the IERC6372 interface, introducing a clock() function that returns the current timestamp and a CLOCK_MODE() function that returns "mode=timestamp". A changeset entry documents this as a minor release. The test suite is extended with a new ERC-6372 clock test block that validates the contract's timestamp-based clock behavior.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add ERC-6372 Contract Clock interface to VestingWallet' directly and clearly summarizes the main change in the pull request.
Description check ✅ Passed The description is well-detailed and clearly related to the changeset, explaining the why, what changed, and impact of implementing ERC-6372 in VestingWallet.
Linked Issues check ✅ Passed The pull request fully implements the requirements from issue #6389: adds IERC6372 interface to VestingWallet with clock() and CLOCK_MODE() functions returning timestamp-based values.
Out of Scope Changes check ✅ Passed All changes are directly within scope: VestingWallet interface implementation, test additions, and changeset entry all relate to adding ERC-6372 support.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

Add ERC-6372: Contract Clock interface to VestingWallet

1 participant