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: enable smart account chain switching between zk/non-zk #5250

Conversation

joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Oct 31, 2024

Problem solved

Fixes CNCT-2148
Fixes #5224


PR-Codex overview

This PR introduces a patch for thirdweb to enhance smart accounts by allowing them to switch between zk and non-zk chains. It modifies the isZkSyncChain function and updates the smartWallet function to incorporate this new chain-switching capability.

Detailed summary

  • Added a patch note for thirdweb to allow chain switching.
  • Modified the isZkSyncChain function to remove the fallback to RPC checks.
  • Updated the smartWallet function to first check if the new chain is a zkSync chain before checking if the factory contract is deployed.

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

Copy link

vercel bot commented Oct 31, 2024

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

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 31, 2024 9:14am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 31, 2024 9:14am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 31, 2024 9:14am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 31, 2024 9:14am

Copy link

changeset-bot bot commented Oct 31, 2024

🦋 Changeset detected

Latest commit: b14c460

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
thirdweb 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

graphite-app bot commented Oct 31, 2024

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

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

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
Member Author

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

Join @joaquim-verges and the rest of your teammates on Graphite Graphite

Copy link

linear bot commented Oct 31, 2024

Copy link
Contributor

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 43 KB (0%) 861 ms (0%) 4.5 s (+46.04% 🔺) 5.3 s
thirdweb (cjs) 102.91 KB (0%) 2.1 s (0%) 7.3 s (+16.9% 🔺) 9.3 s
thirdweb (minimal + tree-shaking) 4.84 KB (0%) 97 ms (0%) 122 ms (-18.39% 🔽) 218 ms
thirdweb/chains (tree-shaking) 498 B (0%) 10 ms (0%) 81 ms (+83.5% 🔺) 91 ms
thirdweb/react (minimal + tree-shaking) 16.98 KB (-2.33% 🔽) 340 ms (-2.33% 🔽) 450 ms (-43.32% 🔽) 789 ms

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

Attention: Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.

Project coverage is 45.36%. Comparing base (7791a99) to head (b14c460).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ackages/thirdweb/src/wallets/smart/smart-wallet.ts 94.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5250      +/-   ##
==========================================
- Coverage   45.43%   45.36%   -0.07%     
==========================================
  Files        1067     1067              
  Lines       55435    55434       -1     
  Branches     4019     3991      -28     
==========================================
- Hits        25185    25147      -38     
- Misses      29558    29596      +38     
+ Partials      692      691       -1     
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 7791a99
packages 40.40% <94.44%> (-0.09%) ⬇️

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
...thirdweb/src/utils/any-evm/zksync/isZkSyncChain.ts 90.00% <100.00%> (+9.23%) ⬆️
...ackages/thirdweb/src/wallets/smart/smart-wallet.ts 77.00% <94.11%> (+1.21%) ⬆️

... and 2 files with indirect coverage changes

@joaquim-verges joaquim-verges merged commit f40d247 into main Oct 31, 2024
31 checks passed
@joaquim-verges joaquim-verges deleted the feat_enable_smart_account_chain_switching_between_zk/non-zk branch October 31, 2024 09:25
@jnsdls jnsdls mentioned this pull request Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unable to switch smart wallet network to ZKsync chain
1 participant