Skip to content

Commit fc59e79

Browse files
committed
remove hardcoded clone factory address
1 parent 2b98cc3 commit fc59e79

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/cross-chain/page.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import { fetchPublishedContractsFromDeploy } from "components/contract-component
22
import { notFound, redirect } from "next/navigation";
33
import { getContractEvents, prepareEvent } from "thirdweb";
44
import { defineChain, getChainMetadata, localhost } from "thirdweb/chains";
5-
import { type FetchDeployMetadataResult, getContract } from "thirdweb/contract";
5+
import {
6+
type FetchDeployMetadataResult,
7+
getContract,
8+
getDeployedCloneFactoryContract,
9+
} from "thirdweb/contract";
610
import { getInstalledModules } from "thirdweb/modules";
711
import { eth_getCode, getRpcClient } from "thirdweb/rpc";
812
import { getContractPageParamsInfo } from "../_utils/getContractFromParams";
@@ -114,12 +118,15 @@ export default async function Page(props: {
114118
"event ProxyDeployed(address indexed implementation, address proxy, address indexed deployer, bytes data)",
115119
});
116120

117-
const twCloneFactoryContract = getContract({
118-
address: "0xB83db4b940e4796aA1f53DBFC824B9B1865835D5",
121+
const twCloneFactoryContract = await getDeployedCloneFactoryContract({
119122
chain: contract.chain,
120123
client: contract.client,
121124
});
122125

126+
if (!twCloneFactoryContract) {
127+
throw new Error("Factory not found");
128+
}
129+
123130
const events = await getContractEvents({
124131
contract: twCloneFactoryContract,
125132
events: [ProxyDeployedEvent],

packages/thirdweb/src/exports/contract.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ export { prepareAutoFactoryDeployTransaction } from "../contract/deployment/depl
4343
export { prepareMethod } from "../utils/abi/prepare-method.js";
4444

4545
export { getCompilerMetadata } from "../contract/actions/get-compiler-metadata.js";
46+
export { getDeployedCloneFactoryContract } from "../contract/deployment/utils/clone-factory.js";

packages/thirdweb/src/extensions/prebuilts/deploy-published.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ export async function deployContractfromDeployMetadata(
231231
implementationAddress: implementationContract.address,
232232
initializeData,
233233
salt,
234+
isCrosschain,
234235
});
235236
}
236237

0 commit comments

Comments
 (0)