Repository navigation
fix: resolve eip712Domain on fresh 7702 EOAs in signQuote - #203
Merged
Merged
Conversation
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.
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>
fichiokaku
force-pushed
the
fix/eip712-domain-7702-fresh-eoa
branch
from
September 1, 2026 13:48
5cdee09 to
6f3fe94
Compare
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 documentation and logic of the
getEip712Domainfunction insrc/sdk/account/toNexusAccount.ts. It addresses issues related to EIP-7702 mode, ensuring correct domain retrieval for smart-account addresses.Detailed summary
chainIdandverifyingContractvalues after delegation.