Skip to content

Commit 5e66d7a

Browse files
feat: optimize zksync contract deployment and bytecode handling
1 parent e91581a commit 5e66d7a

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

packages/thirdweb/src/extensions/prebuilts/get-required-transactions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@ export async function getAllDefaultConstructorParamsForImplementation(args: {
210210
client: ThirdwebClient;
211211
}) {
212212
const { chain, client } = args;
213+
const isZkSync = await isZkSyncChain(chain);
214+
if (isZkSync) {
215+
// zksync contracts dont need these implementation constructor params
216+
return {};
217+
}
213218
const [forwarder, weth] = await Promise.all([
214219
computePublishedContractAddress({
215220
chain,

packages/thirdweb/src/transaction/actions/zksync/send-eip712-transaction.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe("sendEip712Transaction", () => {
3030
expect(res.transactionHash.length).toBe(66);
3131
});
3232

33-
it.skip("should deploy a published autofactory contract on zksync", async () => {
33+
it("should deploy a published autofactory contract on zksync", async () => {
3434
const address = await deployPublishedContract({
3535
client: TEST_CLIENT,
3636
chain: zkSyncSepolia, // TODO make zksync fork chain work

packages/thirdweb/src/utils/any-evm/deploy-metadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export async function fetchBytecodeFromCompilerMetadata(options: {
8080
async () => {
8181
const isZksolc = await isZkSyncChain(chain);
8282
const bytecodeUri = isZksolc
83-
? compilerMetadata.compilers?.zksolc[0]?.bytecodeUri
83+
? compilerMetadata.compilers?.zksolc?.[0]?.bytecodeUri
8484
: compilerMetadata.bytecodeUri;
8585

8686
if (!bytecodeUri) {

0 commit comments

Comments
 (0)