Skip to content

Commit cf8662a

Browse files
committed
Implementation addresses
1 parent d14e0c4 commit cf8662a

File tree

3 files changed

+39
-12
lines changed

3 files changed

+39
-12
lines changed

apps/dashboard/src/components/contract-components/contract-deploy-form/custom-contract.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
} from "thirdweb/deploys";
3535
import { useActiveAccount, useActiveWalletChain } from "thirdweb/react";
3636
import { upload } from "thirdweb/storage";
37+
import { isZkSyncChain } from "thirdweb/utils";
3738
import { FormHelperText, FormLabel, Heading, Text } from "tw-components";
3839
import { useCustomFactoryAbi, useFunctionParamsFromABI } from "../hooks";
3940
import { addContractToMultiChainRegistry } from "../utils";
@@ -426,7 +427,7 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({
426427
}
427428
}
428429

429-
if (metadata.name === "MarketplaceV3") {
430+
if (metadata.name === "MarketplaceV3" && !isZkSyncChain(walletChain)) {
430431
// special case for marketplace
431432
return await deployMarketplaceContract({
432433
account: activeAccount,

packages/thirdweb/src/contract/deployment/utils/bootstrap.ts

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { isZkSyncChain } from "../../../utils/any-evm/zksync/isZkSyncChain.js";
77
import type { ClientAndChainAndAccount } from "../../../utils/types.js";
88
import { type ThirdwebContract, getContract } from "../../contract.js";
99
import { fetchPublishedContractMetadata } from "../publisher.js";
10+
import { ZKSYNC_IMPLEMENTATIONS } from "../zksync/implementations.js";
1011
import { zkDeployCreate2Factory } from "../zksync/zkDeployCreate2Factory.js";
1112
import { zkDeployContractDeterministic } from "../zksync/zkDeployDeterministic.js";
1213
import { getDeployedCloneFactoryContract } from "./clone-factory.js";
@@ -69,18 +70,29 @@ export async function getOrDeployInfraForPublishedContract(
6970
publisher,
7071
version,
7172
});
72-
const implementationContract = await zkDeployContractDeterministic({
73-
chain,
74-
client,
75-
account,
76-
abi: compilerMetadata.abi,
77-
bytecode: await fetchBytecodeFromCompilerMetadata({
78-
compilerMetadata,
79-
client,
73+
74+
const zksyncImplementations = ZKSYNC_IMPLEMENTATIONS[chain.id];
75+
let implementationContract: string | undefined;
76+
77+
if (zksyncImplementations) {
78+
implementationContract = zksyncImplementations[contractId];
79+
}
80+
81+
if (!implementationContract) {
82+
implementationContract = await zkDeployContractDeterministic({
8083
chain,
81-
}),
82-
params: constructorParams,
83-
});
84+
client,
85+
account,
86+
abi: compilerMetadata.abi,
87+
bytecode: await fetchBytecodeFromCompilerMetadata({
88+
compilerMetadata,
89+
client,
90+
chain,
91+
}),
92+
params: constructorParams,
93+
});
94+
}
95+
8496
return {
8597
cloneFactoryContract: getContract({
8698
address: cloneFactoryContract,
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export const ZKSYNC_IMPLEMENTATIONS: Record<number, Record<string, string>> = {
2+
[300]: {
3+
MarketplaceV3: "0x58e0F289C7dD2025eBd0696d913ECC0fdc1CC8bc",
4+
},
5+
[302]: {
6+
MarketplaceV3: "0x8b0DBCf5b7D01eBB0F24525CE8AB72F16CE4F8C8",
7+
},
8+
[324]: {
9+
MarketplaceV3: "0xBc02441a36Bb4029Cd191b20243c2e41B862F118",
10+
},
11+
[11124]: {
12+
MarketplaceV3: "0x090DA3961FDc45b3C1069E28a1566C5FEE229F65",
13+
},
14+
};

0 commit comments

Comments
 (0)