Skip to content

fix(typedData): only reject struct names that are Solidity types - #5305

Closed
pucedoteth wants to merge 1 commit into
wevm:mainfrom
pucedoteth:fix-typed-data-struct-name-prefix
Closed

pucedoteth wants to merge 1 commit into
wevm:mainfrom
pucedoteth:fix-typed-data-struct-name-prefix

Conversation

@pucedoteth

Copy link
Copy Markdown
Contributor

validateTypedData treated any struct name starting with int, uint or bytes as a Solidity type, so a valid struct such as intent, interval or bytesInfo made validateTypedData and hashTypedData throw Struct type "intent" is invalid. Match the whole name against the integer and bytes type regexes instead.

Claude-Session: https://claude.ai/code/session_01L75E8Ap183JW1mDfv8arqR

validateTypedData treated any struct name starting with `int`, `uint` or
`bytes` as a Solidity type, so a valid struct such as `intent`, `interval`
or `bytesInfo` made validateTypedData and hashTypedData throw
`Struct type "intent" is invalid.` Match the whole name against the
integer and bytes type regexes instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01L75E8Ap183JW1mDfv8arqR
@vercel

vercel Bot commented Oct 26, 2026

Copy link
Copy Markdown

@pucedoteth is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b6938bd

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

@pkg-pr-new

pkg-pr-new Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/viem@5305

commit: b6938bd

jxom commented Oct 26, 2026

Copy link
Copy Markdown
Member

Thanks for the fix. #5308 replaces this PR. The anchored regexes accept intent and bytesInfo, but they also accept struct names such as uint256[], which the prefix check rejected. With types: { Message: [{ name: 'a', type: 'uint256[]' }], 'uint256[]': [{ name: 'x', type: 'uint256' }] }, hashTypedData returns the same hash as a real uint256[] message, so #2888 comes back. #5308 validates every key of types once instead, and keeps the intent and bytesInfo fix.


Generated by Claude Code

@jxom jxom closed this Oct 26, 2026
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