Repository navigation
fix: keep the EIP-7702 initCode marker in UserOperation.toPacked - #594
Merged
Merged
Conversation
Backports #574 to 0.x. `toInitCode` replaced the `0x7702` factory with the authorization's delegate address, so `toPacked` produced an initCode that EntryPoint 0.8 does not recognise as EIP-7702 and rejects with "AA10 sender already constructed". `toInitCode` and `toPacked` now take a `forHash` option: by default the init code is the padded `0x7702` marker followed by `factoryData`; with `forHash` it is the delegate form the EntryPoint hashes. `toTypedData` (and so `hash`) packs with `forHash`, so hashes are unchanged. Co-authored-by: ecamli <107792368+erkancamli@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1bc8e-ad8f-7187-b41f-f8092b65ad6b Co-authored-by: jxom <jake@tempo.xyz>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 8, 2026
Contributor
|
Published pnpm add ox@pr-594
pnpm add ox@0.0.0-pr-594-15b3812 |
Merged
This branch was successfully deployed
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.
Backports #593 (the
mainfix for #574) to0.x(credit @erkancamli).UserOperation.toInitCodereplaced a0x7702factory with the authorization's delegate address, sotoPackedproduced aninitCodethat EntryPoint 0.8 does not recognise as EIP-7702 and rejects withAA10 sender already constructed; the delegate belongs only in the hashed form.toInitCodeandtoPackednow takeforHash: by defaultinitCodeis the padded0x7702marker followed byfactoryData, and withforHashthe delegate form. On0.x,toPackedhad no options andtoTypedDatapacked without them, so this addstoPacked.Optionsand hastoTypedData(and sohash) pack withforHash: true; hashes are unchanged.Behavior change: the default output of
toInitCodeandtoPackedfor EIP-7702 operations is now the marker form; callers hashingtoInitCodethemselves need{ forHash: true }.Validation:
UserOperation.hashfor 0.8 matches the v0.8.0 EntryPoint'sgetUserOpHash(forge), and the packed markerinitCodepasseshandleOps.pnpm test --project core src/erc4337(51 passed; the new default-form tests fail on0.x),pnpm check:types,biome check.