Repository navigation
fix: return false when ERC-6492 verifier ecrecover yields zero address - #5468
Conversation
🦋 Changeset detectedLatest commit: 0a0e72b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb3d236c83
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| import { zeroAddress } from '../../constants/address.js' | ||
| import { concat } from '../../utils/data/concat.js' | ||
| import { pad } from '../../utils/data/pad.js' |
There was a problem hiding this comment.
Import public test helpers from the package entrypoint
The new imports of zeroAddress, concat, and pad bypass the public package entrypoint, contrary to the explicit testing convention in AGENTS.md. All three are exported from viem, so import them from there instead; also update the newly added zeroAddress import in verifyHash.test.ts. This keeps the regression tests aligned with the required public-surface import boundary.
AGENTS.md reference: AGENTS.md:L188-L193
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Switched the new imports in both test files to 'viem' in 73c3060.
There was a problem hiding this comment.
After rebasing, these imports are still from 'viem' in f7f306d, merged with the imports added on main.
|
Published pnpm add viem@pr-5468
pnpm add [email protected] |
73c3060 to
1fd7058
Compare
1fd7058 to
cbc3a8a
Compare
The ERC-6492 signature verifier now returns false when ECDSA recovery yields the zero address, and the embedded deployless bytecode was rebuilt. Amp-Thread-ID: https://ampcode.com/threads/T-01a1c86d-3d0a-763a-844a-6c4c449ad401 Co-authored-by: jxom <[email protected]>
cbc3a8a to
0a0e72b
Compare
…encodePacked` (#683) * fix: return false from the ERC-6492 validator when ecrecover yields the zero address Ports wevm/viem#5468. ecrecover returns the zero address for a malformed signature, so the deployless validator accepted any such signature for the zero address. The bytecode is rebuilt from the updated UniversalSigValidator.sol with solc 0.8.26, 200 optimizer runs, the paris EVM version, and no metadata, which reproduces the previous constant from the previous source. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ddd3-d469-72eb-a88c-673c40859557 Co-authored-by: Amp <[email protected]> Co-authored-by: jxom <[email protected]> * fix: reject odd-length hex for bytes in AbiParameters.encodePacked Ports the encodePacked half of wevm/viem#5466. An odd-length bytes value was concatenated as is, shifting every later value by a nibble. It now throws Hex.InvalidLengthError, matching AbiParameters.encode since #617; viem left-pads instead. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ddd3-d469-72eb-a88c-673c40859557 Co-authored-by: Amp <[email protected]> Co-authored-by: jxom <[email protected]> --------- Co-authored-by: Amp <[email protected]> Co-authored-by: jxom <[email protected]>
…s.encodePacked` and `Address.checksum` (#684) * fix: return false from the ERC-6492 validator when ecrecover yields the zero address Ports wevm/viem#5468. ecrecover returns the zero address for a malformed signature, so the deployless validator accepted any such signature for the zero address. The bytecode is rebuilt from the updated UniversalSigValidator.sol with solc 0.8.26, 200 optimizer runs, the paris EVM version, and no metadata, which reproduces the previous constant from the previous source. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ddd3-d469-72eb-a88c-673c40859557 Co-authored-by: Amp <[email protected]> Co-authored-by: jxom <[email protected]> * fix: reject odd-length hex for bytes in AbiParameters.encodePacked Ports the encodePacked half of wevm/viem#5466. An odd-length bytes value was concatenated as is, shifting every later value by a nibble. It now throws Hex.InvalidLengthError, matching AbiParameters.encode since #617; viem left-pads instead. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ddd3-d469-72eb-a88c-673c40859557 Co-authored-by: Amp <[email protected]> Co-authored-by: jxom <[email protected]> * perf: share the Address.checksum result across address casings Ports wevm/viem#5514. The checksum depends only on the lowercase address, so a result computed for one casing is reused for the others instead of hashing again. main already does this. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ddd3-d469-72eb-a88c-673c40859557 Co-authored-by: Amp <[email protected]> Co-authored-by: jxom <[email protected]> --------- Co-authored-by: Amp <[email protected]> Co-authored-by: jxom <[email protected]>
The ERC-6492 signature verifier now returns
falsewhen ECDSA recovery yields the zero address instead of treating it as a match, andverifyHashnow returnsfalsefor the zero address before calling any verifier. The embedded deployless verifier bytecode was rebuilt (solc 0.8.26, optimizer 200 runs,paris, no metadata, which reproduces the previous constant from the unchanged source). Tests cover the zero address throughverifyHashandverifyMessage, a deployed verifier, and the embedded bytecode directly.