-
Notifications
You must be signed in to change notification settings - Fork 39
Validate fromToken and toToken on construction
#322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 133
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 358
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 124
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 1197
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 659
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 1665
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 74
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 74
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 74
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 782
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 119
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 111
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 2432
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 961
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 358
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 74
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 74
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 134
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 2852
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 4039
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 198
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 76
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 74
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 148
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 74
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 74
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 990
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 1458
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 687
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 2113
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 74
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 639
🏁 Script executed:
# Check remappings to understand the OpenZeppelin import paths cat remappings.txtRepository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 154
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 142
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 2573
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 74
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 804
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 169
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 169
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 74
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 117
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 2815
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 198
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 676
🏁 Script executed:
# Look at what ERC7984Mock actually implements cat contracts/mocks/token/ERC7984Mock.solRepository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 3259
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 626
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 150
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 1016
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 1264
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 208
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 617
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 124
🏁 Script executed:
# Check what interface ID IERC7984ERC20Wrapper declares cat contracts/interfaces/IERC7984ERC20Wrapper.solRepository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 1220
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 4040
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 1217
🏁 Script executed:
Repository: OpenZeppelin/openzeppelin-confidential-contracts
Length of output: 74
🌐 Web query:
ERC165Checker OpenZeppelin Contracts documentation💡 Result:
ERC165Checkeris an OpenZeppelin Contracts library for querying whether an address (contract) supports an interface via ERC-165 (IERC165). It returnstrue/false(it does not revert if unsupported). [1]Docs (v5.x API – Utilities → Introspection / ERC165Checker): [1]
Import:
[1]
Key functions:
supportsERC165(address account) -> boolsupportsInterface(address account, bytes4 interfaceId) -> boolgetSupportedInterfaces(address account, bytes4[] interfaceIds) -> bool[]supportsAllInterfaces(address account, bytes4[] interfaceIds) -> boolsupportsERC165InterfaceUnchecked(address account, bytes4 interfaceId) -> bool[1]
Use an ERC165-safe probe for
fromToken_and considertoToken_validation.Line 104 calls
supportsInterfacedirectly on an arbitrary constructor argument. IffromToken_is a plain ERC20 or non-ERC165 contract, that call reverts beforerequirecan emitInvalidFromToken(), leaving a gap in error handling.Suggested fix
Tests currently only validate rejection of
ERC7984Mock(which supports ERC165). Add regression tests with plain$ERC20Mockandethers.ZeroAddressto ensure safe handling of non-ERC165 inputs. Also verify whethertoToken_requires similar validation.📝 Committable suggestion
🤖 Prompt for AI Agents