Skip to content

fix(0.x): port recent viem fixes to TypedData, transaction envelopes, and AbiItem - #561

Merged
jxom merged 3 commits into
0.xfrom
jxom/vigilant-wozniak-jc79tl-0.x
Nov 1, 2026
Merged

jxom merged 3 commits into
0.xfrom
jxom/vigilant-wozniak-jc79tl-0.x

Conversation

@jxom

@jxom jxom commented Nov 1, 2026

Copy link
Copy Markdown
Member

0.x counterpart of #560. It ports wevm/viem#5308, #5370, #5318, #5319, and #5339.

  • TypedData: TypedData.assert and TypedData.validate now reject invalid struct names and field types. Adds TypedData.InvalidTypeError.
  • Transaction envelopes: a tip above a zero maxFeePerGas now throws TransactionEnvelope.TipAboveFeeCapError in assert and deserialize for EIP-1559, EIP-4844, EIP-7702 and Tempo envelopes.
  • AbiItem.fromAbi: indistinguishable overloads now throw AbiItem.AmbiguityError.
TypedData.assert({ types: { M: [{ name: 'a', type: 'uint7' }] }, primaryType: 'M', message: { a: 1n } })
// throws TypedData.InvalidTypeError

The conflicts with 0.x's different deserialize and abiItem code were resolved by hand. Object.prototype.hasOwnProperty.call replaces Object.hasOwn because 0.x targets ES2021.

Validation: pnpm check:types passes. The offline suites for each changed module pass. Tests that need anvil did not run in the authoring environment.


Generated by Claude Code

Ports wevm/viem#5308 and wevm/viem#5370. A struct name must contain
only letters, digits, `_` and `$`, and must not be a Solidity type. A
field type must be a struct in `types` or an EIP-712 atomic or dynamic
type, so `uint`, `uint7` and `bytes0` throw the new
`TypedData.InvalidTypeError`. Every struct is checked, including structs
referenced only as array elements. `findTypeDependencies` strips only the
array suffix, so struct names with `$` are encoded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01D3nmWgFaNg3t1E6VyYCzXq
Ports wevm/viem#5318 and wevm/viem#5319. `TxEnvelopeEip1559.assert` and
`TxEnvelopeTempo.assert` compared fees only when both were truthy, so a
zero `maxFeePerGas` skipped the check. `deserialize` for EIP-1559,
EIP-4844, EIP-7702, and Tempo envelopes reads an empty `maxFeePerGas` as
zero when a tip is set. `TipAboveFeeCapError` and `FeeCapTooHighError`
now show zero values.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01D3nmWgFaNg3t1E6VyYCzXq
Ports wevm/viem#5339. Distinct types that both match an argument, such
as `bytes32` and `bytes` or `uint256` and `int256`, and arrays of the
same element type with different shapes now throw
`AbiItem.AmbiguityError` instead of resolving to the last match. An
integer overload matches only a value in its range, and a fixed bytes
overload matches only a value of its size.

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

vercel Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
ox Ready Ready Preview Nov 1, 2026 10:28pm UTC

Request Review

@chatgpt-codex-connector

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

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T22:24:23.382974Z 879eb4c PR opened
ℹ️ 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 1, 2026

Copy link
Copy Markdown
Contributor

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

pnpm add ox@pr-561
pnpm add [email protected]

@jxom
jxom merged commit f9e8a6e into 0.x Nov 1, 2026
14 checks passed
@jxom
jxom deleted the jxom/vigilant-wozniak-jc79tl-0.x branch November 1, 2026 22:44
@github-actions github-actions Bot mentioned this pull request Nov 1, 2026

This branch was successfully deployed

1 active deployment
Preview — 879eb4cb Deployed Nov 1, 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.

2 participants