Skip to content

ERC-6492 signature validation#38

Open
bobo-k2 wants to merge 3 commits intomasterfrom
erc-6492-validation
Open

ERC-6492 signature validation#38
bobo-k2 wants to merge 3 commits intomasterfrom
erc-6492-validation

Conversation

@bobo-k2
Copy link
Copy Markdown
Collaborator

@bobo-k2 bobo-k2 commented Apr 3, 2026

Summary

Adds ERC-6492 signature validation support to the testapp's verifySignMsg helper.

ERC-6492 signatures are produced by undeployed smart contract wallets (e.g. a fresh SCW that has not yet been deployed on-chain). The standard isValidSignature contract call would fail for these accounts because no contract exists yet.

What changed (examples/testapp/src/components/RpcMethods/method/signMessageMethods.ts):

  • Import viem helpers: encodeAbiParameters, erc6492SignatureValidatorByteCode, isErc6492Signature, parseAbiParameters.
  • In verifySignMsg, detect ERC-6492 signatures with isErc6492Signature before falling back to the existing EIP-1271 path.
  • When an ERC-6492 signature is detected, encode (address signer, bytes32 hash, bytes wrappedSignature) and simulate the Universal Signature Validator bytecode via publicClient.call. The validator deploys the account and calls isValidSignature in a single read-only eth_call — nothing is deployed on-chain.
  • Parse the bool result from the returned ABI-encoded data and return a human-readable verification message.
  • Add authorizationList: undefined to the fallback readContract call to silence a viem type warning.

How did you test your changes?

  • Tested manually in the testapp by connecting a fresh (undeployed) SCW account, signing a typed-data message, and running verifySignMsg. The ERC-6492 path returns "SigUtil Successfully verified signer as <address> (ERC-6492)".
image
  • Verified that standard EIP-1271 signatures for deployed accounts still go through the existing readContract path without regression.
image

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds ERC-6492 signature validation support to the testapp’s verifySignMsg helper so signatures from undeployed smart contract wallets can be verified via Universal Signature Validator simulation (eth_call) before falling back to the existing EIP-1271 on-chain isValidSignature path.

Changes:

  • Detect ERC-6492 signatures using isErc6492Signature and validate them via publicClient.call with erc6492SignatureValidatorByteCode.
  • ABI-encode the validator call payload and return ERC-6492-specific success/failure UI messages.
  • Add authorizationList: undefined to the EIP-1271 readContract call to silence a viem type warning.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bobo-k2 bobo-k2 requested a review from Copilot April 3, 2026 10:49
@bobo-k2 bobo-k2 changed the title ERC-6492 validation ERC-6492 signature validation Apr 3, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@b-d-m-p b-d-m-p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean implementation! The ERC-6492 detection and validator flow looks good. Just a couple minor suggestions.

@bobo-k2 bobo-k2 requested a review from b-d-m-p April 6, 2026 07:12
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