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

feat: add low level support for 7702 #1193

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

feat: add low level support for 7702 #1193

wants to merge 1 commit into from

Conversation

moldy530
Copy link
Collaborator

@moldy530 moldy530 commented Dec 6, 2024

Pull Request Checklist


PR-Codex overview

This PR primarily updates the VERSION across multiple files and introduces a new middleware function for signing user operations, along with related type and interface adjustments.

Detailed summary

  • Updated VERSION to "4.6.0" in multiple files.
  • Added signAuthorization method in SmartContractAccount.
  • Introduced default7702UserOpSigner middleware function.
  • Updated UserOperationRequest to include optional authorizationTuple.
  • Enhanced documentation for default7702UserOpSigner.

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

Copy link

vercel bot commented Dec 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
aa-sdk-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2024 4:37am
aa-sdk-ui-demo ❌ Failed (Inspect) Dec 9, 2024 4:37am

Copy link

graphite-app bot commented Dec 6, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “graphite-merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Collaborator Author

moldy530 commented Dec 6, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

const implAddress = await account.getImplementationAddress();
if (
code ===
"0x00000000000000000000000000000000000000000000000001ff00" +
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This isn't right, it should be 0xef0100 ++ address

Copy link
Collaborator

Choose a reason for hiding this comment

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

you could do starts with 0xEF as a check since contracts can never be deployed with the EF byte

} & Omit<CustomSource, "signTransaction" | "address">;
} & Omit<
CustomSource,
"signTransaction" | "address" | "experimental_signAuthorization"
Copy link
Collaborator

Choose a reason for hiding this comment

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

one caveat here: viem by default will use current nonce to sign the 1559 transaction, and use nonce +1 to sign authorization tuple. if we support 4337, UO is not tracked by native nonce, but by EP's nonce tracking. That means we have to override the default nonce viem used current nonce.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

alternatively, I think we can set delegate: true to skip incrementing the nonce

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.

4 participants