Skip to content

Conversation

@jeffsmale90
Copy link
Contributor

@jeffsmale90 jeffsmale90 commented Feb 5, 2025

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.

@jeffsmale90 jeffsmale90 marked this pull request as ready for review February 5, 2025 02:38
@jeffsmale90 jeffsmale90 requested a review from ccharly February 18, 2025 03:43
);
}

if (!isValidHexAddress(contractAddress as Hex)) {
Copy link
Contributor

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).

ccharly
ccharly previously approved these changes Mar 18, 2025
Copy link
Contributor

@ccharly ccharly left a 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!

@jeffsmale90 jeffsmale90 merged commit 0832d49 into main Mar 23, 2025
17 checks passed
@jeffsmale90 jeffsmale90 deleted the feat/eip-7702-validation branch March 23, 2025 19:33
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.

2 participants