Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/early-adults-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Skip factory entrypoint lookup for ZKsync chains
27 changes: 13 additions & 14 deletions packages/thirdweb/src/wallets/smart/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,19 @@

const options = creationOptions;
const chain = connectChain ?? options.chain;
const sponsorGas =
"gasless" in options ? options.gasless : options.sponsorGas;
if (await isZkSyncChain(chain)) {
return [
createZkSyncAccount({
creationOptions,
connectionOptions,
chain,
sponsorGas,
}),
chain,
];
}

Check warning on line 110 in packages/thirdweb/src/wallets/smart/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/wallets/smart/index.ts#L98-L110

Added lines #L98 - L110 were not covered by tests

// if factory is passed, but no entrypoint, try to resolve entrypoint from factory
if (options.factoryAddress && !options.overrides?.entrypointAddress) {
Expand Down Expand Up @@ -125,20 +138,6 @@
const factoryAddress =
options.factoryAddress ??
getDefaultAccountFactory(options.overrides?.entrypointAddress);
const sponsorGas =
"gasless" in options ? options.gasless : options.sponsorGas;

if (await isZkSyncChain(chain)) {
return [
createZkSyncAccount({
creationOptions,
connectionOptions,
chain,
sponsorGas,
}),
chain,
];
}

const factoryContract = getContract({
client: client,
Expand Down
Loading