feat: add token rate pusher with args#1843
Draft
dry914 wants to merge 9 commits into
Draft
Conversation
Hardhat Unit Tests Coverage SummaryDetailsDiff against masterResults for commit: 18ea278 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
dry914
commented
Jun 2, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces an args-bearing token rate push interface and extends TokenRateNotifier to support two observer “kinds” (legacy no-arg push vs. full rebase-payload push) detected via ERC165.
Changes:
- Added
ITokenRatePusherWithArgsand updatedTokenRateNotifierto register observers with a detected kind and dispatch the appropriatepushTokenRatecall. - Updated
TokenRateNotifierevents to include observer kind and refactored observer storage to a tagged registry. - Added comprehensive Hardhat tests and Solidity mocks covering registration, removal, mixed dispatch, and failure modes.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
contracts/0.8.9/TokenRateNotifier.sol |
Adds observer kind tagging, ERC165-based kind detection, args-bearing dispatch, and refactors observer storage/events accordingly. |
contracts/0.8.9/interfaces/ITokenRatePusherWithArgs.sol |
New interface for observers that consume the full per-rebase payload. |
contracts/0.8.9/interfaces/ITokenRatePusher.sol |
Clarifies legacy/no-arg intent in docs. |
test/0.8.9/tokenRateNotifier.test.ts |
New test suite validating both observer kinds, caps, swap-and-pop, and revert handling paths. |
test/0.8.9/contracts/TokenRatePusherWithArgs__Mock.sol |
Mock implementing args-bearing push and ERC165 reporting. |
test/0.8.9/contracts/TokenRatePusherDualSupport__Mock.sol |
Mock claiming both interfaces to validate priority rule. |
test/0.8.9/contracts/TokenRatePusher__Mock.sol |
Legacy mock implementing no-arg push and revert behaviors. |
test/0.8.9/contracts/NoInterface__Mock.sol |
Mock without supportsInterface to validate rejection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tamtamchik
reviewed
Jun 18, 2026
tamtamchik
left a comment
Member
There was a problem hiding this comment.
Overall great commitment! ❤️
ℹ️ Would avoid Legacy wording, as this is just another type.
failingtwice
previously approved these changes
Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
ITokenRatePusherWithArgsinterface and it's support inTokenRateNotifiercontract.see stonks PR - lidofinance/stonks#29