-
-
Couldn't load subscription status.
- Fork 236
Add additional validation to EIP7702 methods #410
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
Conversation
| ); | ||
| } | ||
|
|
||
| if (!isValidHexAddress(contractAddress as Hex)) { |
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.
For the record: This function does verify the address length too.
See: https://github.com/MetaMask/utils/blob/v11.3.0/src/hex.ts#L15-L18 ({40} in hex-format, each bytes is 2-digits/chars long, which makes it a length of 20 bytes).
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.
Code LGTM! I've left 2 small comments for the tests, but the actual logic is good, so up to you if you want to change this or not. 😄 thanks!
Co-authored-by: Charly Chevalier <[email protected]>
Adds validation of the Authorization object, as per EIP-7702 specification https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7702.md
Also renames some tests to align with renamed function names.