fix: resolve eip712Domain on fresh 7702 EOAs in signQuote#203
Open
fichiokaku wants to merge 1 commit into
Open
fix: resolve eip712Domain on fresh 7702 EOAs in signQuote#203fichiokaku wants to merge 1 commit into
fichiokaku wants to merge 1 commit into
Conversation
In EIP-7702 mode the account address is the EOA itself, but the SDK still passes factoryAddress + factoryData to viem's getEip712Domain. When the EOA has no code yet, viem falls back to a deployless call that asserts the factory deploys at the expected address — which is impossible because the factory deploys at a CREATE2 address by definition different from the EOA — and reverts with CounterfactualDeploymentFailedError. This broke signQuote on V2_2_1+ for any 7702 user that called signQuote before delegation landed. Detect the 7702 case (account address == signer address) and read the EIP-712 domain directly from the implementation contract, substituting chainId and verifyingContract with the values the EOA will return post-delegation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
size-limit report 📦
|
vr16x
approved these changes
May 1, 2026
vr16x
left a comment
Collaborator
There was a problem hiding this comment.
The changes look good, but it would be great if you could generate a test case for this.
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.
In EIP-7702 mode the account address is the EOA itself, but the SDK still passes factoryAddress + factoryData to viem's getEip712Domain. When the EOA has no code yet, viem falls back to a deployless call that asserts the factory deploys at the expected address — which is impossible because the factory deploys at a CREATE2 address by definition different from the EOA — and reverts with CounterfactualDeploymentFailedError. This broke signQuote on V2_2_1+ for any 7702 user that called signQuote before delegation landed.
Detect the 7702 case (account address == signer address) and read the EIP-712 domain directly from the implementation contract, substituting chainId and verifyingContract with the values the EOA will return post-delegation.
PR-Codex overview
This PR enhances the
getEip712Domainfunction to handle EIP-7702 mode correctly. It ensures that the EIP-712 domain is fetched directly from the implementation contract when the smart-account address is the EOA, preventing issues with address mismatches during delegation.Detailed summary
signer.address._eip712Domainassignment to include the correctchainIdandverifyingContractvalues after delegation.