Skip to content

Commit 9d5828e

Browse files
authored
[SDK] Fix: skip factory entrypoint lookup for ZKsync chains (#6116)
1 parent b191658 commit 9d5828e

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

.changeset/early-adults-travel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Skip factory entrypoint lookup for ZKsync chains

packages/thirdweb/src/wallets/smart/index.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,19 @@ export async function connectSmartAccount(
8080

8181
const options = creationOptions;
8282
const chain = connectChain ?? options.chain;
83+
const sponsorGas =
84+
"gasless" in options ? options.gasless : options.sponsorGas;
85+
if (await isZkSyncChain(chain)) {
86+
return [
87+
createZkSyncAccount({
88+
creationOptions,
89+
connectionOptions,
90+
chain,
91+
sponsorGas,
92+
}),
93+
chain,
94+
];
95+
}
8396

8497
// if factory is passed, but no entrypoint, try to resolve entrypoint from factory
8598
if (options.factoryAddress && !options.overrides?.entrypointAddress) {
@@ -110,20 +123,6 @@ export async function connectSmartAccount(
110123
const factoryAddress =
111124
options.factoryAddress ??
112125
getDefaultAccountFactory(options.overrides?.entrypointAddress);
113-
const sponsorGas =
114-
"gasless" in options ? options.gasless : options.sponsorGas;
115-
116-
if (await isZkSyncChain(chain)) {
117-
return [
118-
createZkSyncAccount({
119-
creationOptions,
120-
connectionOptions,
121-
chain,
122-
sponsorGas,
123-
}),
124-
chain,
125-
];
126-
}
127126

128127
const factoryContract = getContract({
129128
client: client,

0 commit comments

Comments
 (0)