-
Notifications
You must be signed in to change notification settings - Fork 621
[SDK] Handle entrypoint resolution inside createAndSignUserOp #6615
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
[SDK] Handle entrypoint resolution inside createAndSignUserOp #6615
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
packages/thirdweb/src/wallets/smart/smart-wallet-integration-v07.test.ts
Outdated
Show resolved
Hide resolved
size-limit report 📦
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6615 +/- ##
==========================================
+ Coverage 54.91% 54.97% +0.05%
==========================================
Files 885 885
Lines 55581 55594 +13
Branches 3791 3794 +3
==========================================
+ Hits 30522 30562 +40
+ Misses 24964 24937 -27
Partials 95 95
🚀 New features to boost your workflow:
|
8abd5ff to
9244d30
Compare
🦋 Changeset detectedLatest commit: 9244d30 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
| waitForDeployment?: boolean; | ||
| isDeployedOverride?: boolean; | ||
| }) { | ||
| // if factory is passed, but no entrypoint, try to resolve entrypoint from factory | ||
| if ( | ||
| options.smartWalletOptions.factoryAddress && | ||
| !options.smartWalletOptions.overrides?.entrypointAddress | ||
| ) { | ||
| const entrypointAddress = await getEntrypointFromFactory( | ||
| options.smartWalletOptions.factoryAddress, | ||
| options.client, | ||
| options.smartWalletOptions.chain, | ||
| ); | ||
| if (entrypointAddress) { | ||
| options.smartWalletOptions.overrides = { | ||
| ...options.smartWalletOptions.overrides, | ||
| entrypointAddress, | ||
| }; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function needs to check if the smart wallet account is deployed before creating the user operation. After resolving the entrypoint, it should check the deployment status and set the appropriate flags. Add code to check if the account is deployed using isContractDeployed or a similar function, and set the isDeployedOverride parameter accordingly if not explicitly provided.
Spotted by Diamond (based on CI logs)
Is this helpful? React 👍 or 👎 to let us know.

PR-Codex overview
This PR focuses on enhancing the
createAndSignUserOpfunction to handle entrypoint resolution when a factory address is provided but no entrypoint is specified. Additionally, it introduces a test for preparing a user operation.Detailed summary
smart-wallet-integration-v07.test.ts.createAndSignUserOpinuserop.tsto resolve the entrypoint from the factory if not explicitly provided.