feat(lint): add incorrect ERC20 interface lint#14428
Merged
mablr merged 7 commits intofoundry-rs:masterfrom Apr 24, 2026
Merged
feat(lint): add incorrect ERC20 interface lint#14428mablr merged 7 commits intofoundry-rs:masterfrom
mablr merged 7 commits intofoundry-rs:masterfrom
Conversation
mablr
reviewed
Apr 23, 2026
Collaborator
mablr
left a comment
There was a problem hiding this comment.
lgtm, just a smol nit on tests
Collaborator
|
|
Collaborator
Author
yea we need foundry-rs/book#1795 1st |
Expanding IERC20 with full function signatures caused solc compilation failures (Error 4822: Overriding function return types differ) because IERC20Incorrect inherits from IERC20 and overrides with incompatible return types. Revert to the empty-base pattern used by IncorrectERC721Interface. Amp-Thread-ID: https://ampcode.com/threads/T-019dbb72-89c7-740d-b6cf-b87a1509d3e3 Co-authored-by: Amp <amp@ampcode.com>
7c5ed2b to
8035434
Compare
mablr
reviewed
Apr 23, 2026
Comment on lines
+34
to
+44
| // SHOULD PASS: Interface named IERC20 with correct function signatures | ||
| interface IERC20NamedCorrect { | ||
| function transfer(address to, uint256 value) external returns (bool); | ||
| function balanceOf(address account) external view returns (uint256); | ||
| } | ||
|
|
||
| // SHOULD PASS: Contract that is NOT named ERC20 and does not inherit from one | ||
| interface INotERC20 { | ||
| function transfer(address to, uint256 value) external returns (uint256); | ||
| function balanceOf(address account) external view returns (bool); | ||
| } |
Collaborator
There was a problem hiding this comment.
These two take the same path: not ERC20/IERC20
IERC20NamedCorrect should be renamed IERC20 ?
Collaborator
Author
i changed this back for consistency with the ERC721 one, but we can follow-up with this if really needed (?) the goal was to not need 2 files, i believe this approach is correct as well @mablr |
mablr
approved these changes
Apr 24, 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.
Summary
Testing
Context
#14381