-
Notifications
You must be signed in to change notification settings - Fork 619
[SDK] Fix: skip factory entrypoint lookup for ZKsync chains #6116
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] Fix: skip factory entrypoint lookup for ZKsync chains #6116
Conversation
🦋 Changeset detectedLatest commit: 47dc301 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 |
|
@alecananian is attempting to deploy a commit to the thirdweb Team on Vercel. A member of the Team first needs to authorize it. |
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. |
| "gasless" in options ? options.gasless : options.sponsorGas; | ||
|
|
||
| if (await isZkSyncChain(chain)) { | ||
| if (isZksyncChain) { |
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.
might be cleaner to just move this block at the very top
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.
My thinking was the paymaster and entrypoint address configs were still valid for ZKsync chains, but if that's not the case then yes the conditions can be moved around
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.
no entrypoint is only for non-zk chains, so makes sense to check zk chain first
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.
Great! In that case, I've pushed an update that simplifies the ZKsync chain check
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.
Additional details and impacted files@@ Coverage Diff @@
## main #6116 +/- ##
===========================================
- Coverage 56.87% 42.23% -14.65%
===========================================
Files 1153 1153
Lines 63896 63802 -94
Branches 5180 3816 -1364
===========================================
- Hits 36344 26947 -9397
- Misses 26825 36154 +9329
+ Partials 727 701 -26
*This pull request uses carry forward flags. Click here to find out more.
|
When connecting to an ecosystem wallet with smart wallet options configured in the Thirdweb dashboard, there is a lookup made to fetch any missing details for account abstraction, like the entrypoint address. If the default chain on the dashboard is set to a ZKsync chain (e.g., Treasure chain ID 61166), there is an RPC call made to the factory address that always returns
0xbecause the factory doesn't exist and is irrelevant for native account abstraction. This change saves the extraneous RPC call during login.PR-Codex overview
This PR focuses on optimizing the handling of
ZkSyncchains in theconnectSmartAccountfunction by adding a direct check for these chains and simplifying the gas management logic.Detailed summary
ZkSyncchains to skip factory entrypoint lookup.sponsorGasvariable to manage gas settings more effectively.ZkSyncaccount creation when a factory is passed.