Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: erc6492 verification #2552

Merged
merged 9 commits into from
Jul 30, 2024
Merged

Conversation

wilsoncusack
Copy link
Contributor

@wilsoncusack wilsoncusack commented Jul 29, 2024

DeploylessUniversalSigValidator.sol behavior does not currently match the spec, in that it does not call the factory if the account is already deployed.

According to the EIP, for the signer

... If the contract is deployed but not ready to verify using ERC-1271, wrap the signature as follows: concat(abi.encode((prepareTo, prepareData, originalERC1271Signature), (address, bytes, bytes)), magicBytes); prepareTo and prepareData must contain the necessary transaction that will make the contract ready to verify using ERC-1271 (e.g. a call to migrate or update)

and the verifier should call this "factory" with the calldata if the magic bytes are present

check if the signature ends with magic bytes, in which case do an eth_call to a multicall contract that will call the factory first with the factoryCalldata and deploy the contract if it isn’t already deployed; Then, call contract.isValidSignature as usual with the unwrapped signature

This PR currently just attempting to creating a broken test demonstrating the issue.


PR-Codex overview

Summary

Fixes ERC6492 verification and prepares for user operation gas estimation.

Detailed summary

  • Fixed ERC6492 verification in verifyHash.ts
  • Updated gas limits in estimateUserOperationGas.test.ts
  • Refactored code structure in verifyHash.test.ts
  • Added functionality for user operation in verifyHash.test.ts
  • Updated ABI and addresses in verifyHash.test.ts

The following files were skipped due to too many changes: src/constants/contracts.ts, src/account-abstraction/actions/bundler/prepareUserOperation.test.ts

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

changeset-bot bot commented Jul 29, 2024

🦋 Changeset detected

Latest commit: fcde677

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

Copy link

vercel bot commented Jul 29, 2024

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

A member of the Team first needs to authorize it.

@wilsoncusack wilsoncusack marked this pull request as draft July 29, 2024 15:43
@jxom jxom changed the title WIP: breaking test for erc6492 verification fix: erc6492 verification Jul 30, 2024
@jxom jxom marked this pull request as ready for review July 30, 2024 21:56
@jxom jxom merged commit 84e7d30 into wevm:main Jul 30, 2024
19 of 32 checks passed
@github-actions github-actions bot mentioned this pull request Jul 30, 2024
@tmm tmm mentioned this pull request Dec 21, 2024
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