File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed
packages/thirdweb/src/wallets/smart Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " thirdweb " : patch
3+ ---
4+
5+ Skip factory entrypoint lookup for ZKsync chains
Original file line number Diff line number Diff line change @@ -95,9 +95,14 @@ export async function connectSmartAccount(
9595
9696 const options = creationOptions ;
9797 const chain = connectChain ?? options . chain ;
98+ const isZksyncChain = await isZkSyncChain ( chain ) ;
9899
99100 // if factory is passed, but no entrypoint, try to resolve entrypoint from factory
100- if ( options . factoryAddress && ! options . overrides ?. entrypointAddress ) {
101+ if (
102+ ! isZksyncChain &&
103+ options . factoryAddress &&
104+ ! options . overrides ?. entrypointAddress
105+ ) {
101106 const entrypointAddress = await getEntrypointFromFactory (
102107 options . factoryAddress ,
103108 client ,
@@ -122,13 +127,10 @@ export async function connectSmartAccount(
122127 } ;
123128 }
124129
125- const factoryAddress =
126- options . factoryAddress ??
127- getDefaultAccountFactory ( options . overrides ?. entrypointAddress ) ;
128130 const sponsorGas =
129131 "gasless" in options ? options . gasless : options . sponsorGas ;
130132
131- if ( await isZkSyncChain ( chain ) ) {
133+ if ( isZksyncChain ) {
132134 return [
133135 createZkSyncAccount ( {
134136 creationOptions,
@@ -140,6 +142,10 @@ export async function connectSmartAccount(
140142 ] ;
141143 }
142144
145+ const factoryAddress =
146+ options . factoryAddress ??
147+ getDefaultAccountFactory ( options . overrides ?. entrypointAddress ) ;
148+
143149 const factoryContract = getContract ( {
144150 client : client ,
145151 address : factoryAddress ,
You can’t perform that action at this time.
0 commit comments