Skip to content

fix(erc7739): order the wrapped contents type like the TypedDataSign type - #5583

Merged
jxom merged 4 commits into
mainfrom
fix/erc7739-sorted-contents-type
Nov 18, 2026
Merged

jxom merged 4 commits into
mainfrom
fix/erc7739-sorted-contents-type

Conversation

@jxom

@jxom jxom commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Supersedes #5487 by @erkancamli, keeping their commit, rebased onto main.

Review fixes:

  • Shortened the changeset to one sentence.

  • Removed the TypeScript copy of the ERC-7739 verifier from wrapTypedDataSignature.test.ts and snapshotted the PermitSingle wrapped output inline.

  • Added a PermitSingle verifyTypedData case to actions/signTypedData.test.ts against a Solady account (fails on main, passes with the fix).

  • Raised the viem/account-abstraction size limit to 63.5 kB; the fix adds about 70 bytes (62,989 → 63,058 B).

erkancamli and others added 3 commits November 18, 2026 20:18
…type

wrapTypedDataSignature put the contents struct first in contentsDescription,
but the signed TypedDataSign type sorts it with its dependencies. An
ERC-7739 verifier rebuilds the type from contentsDescription, so a typed
data signature whose nested type sorts before the primary type (for
example Permit2 PermitDetails and PermitSingle) did not verify.

Send the contents type in the sorted order and use explicit mode when the
primary type is not first.

Co-authored-by: jxom <[email protected]>
…dy account

Drop the TypeScript copy of the ERC-7739 verifier from the
wrapTypedDataSignature test and check the PermitSingle case end to end
with verifyTypedData instead.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1f04d-8b26-7139-b887-bc03498c98da
Co-authored-by: jxom <[email protected]>
@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
viem Error Error Nov 18, 2026 8:40pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b463bdb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T20:38:30.055386Z b463bdb New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Published [email protected] under the pr-5583 dist-tag, which follows this pull request until it closes.

pnpm add viem@pr-5583
pnpm add [email protected]

@jxom
jxom merged commit 53184e3 into main Nov 18, 2026
39 of 40 checks passed
@jxom
jxom deleted the fix/erc7739-sorted-contents-type branch November 18, 2026 21:15
@github-actions github-actions Bot mentioned this pull request Nov 18, 2026

This branch had an error being deployed

1 failed deployment
Preview — b463bdbd Deployed Nov 18, 2026 by vercel[bot]
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.

3 participants