Skip to content

Commit ec7cd70

Browse files
committed
use new clone factory, cleanup
1 parent 96e8b4e commit ec7cd70

File tree

5 files changed

+8
-16
lines changed

5 files changed

+8
-16
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe.runIf(process.env.TW_SECRET_KEY)("bootstrap", () => {
4040
const cloneFactory = await getDeployedInfraContract({
4141
chain: ANVIL_CHAIN,
4242
client: TEST_CLIENT,
43-
contractId: "TWCloneFactory",
43+
contractId: "TWCloneFactoryV2",
4444
constructorParams: {
4545
_trustedForwarder: forwarder.address,
4646
},

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,8 @@ export async function deployCloneFactory(options: ClientAndChainAndAccount) {
165165
// clone factory
166166
return getOrDeployInfraContract({
167167
...options,
168-
contractId: "TWCloneFactory",
168+
contractId: "TWCloneFactoryV2",
169169
constructorParams: { _trustedForwarder: forwarder.address },
170-
publisher: "0x6453a486d52e0EB6E79Ec4491038E2522a926936", // TODO: use default publisher
171170
});
172171
}
173172

@@ -219,10 +218,7 @@ export async function getOrDeployInfraContract(
219218
const contractMetadata = await fetchPublishedContractMetadata({
220219
client: options.client,
221220
contractId: options.contractId,
222-
publisher:
223-
options.contractId === "TWCloneFactory"
224-
? "0x6453a486d52e0EB6E79Ec4491038E2522a926936" // TODO: use default publisher
225-
: options.publisher,
221+
publisher: options.publisher,
226222
version: options.version,
227223
});
228224
return getOrDeployInfraContractFromMetadata({

packages/thirdweb/src/contract/deployment/utils/clone-factory.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ export async function getDeployedCloneFactoryContract(args: ClientAndChain) {
2121
// check if clone factory is deployed
2222
const cloneFactory = await getDeployedInfraContract({
2323
...args,
24-
contractId: "TWCloneFactory",
24+
contractId: "TWCloneFactoryV2",
2525
constructorParams: { _trustedForwarder: forwarder.address },
26-
publisher: "0x6453a486d52e0EB6E79Ec4491038E2522a926936", // TODO: use default publisher
2726
});
2827
if (!cloneFactory) {
2928
return null;

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export type InfraContractId =
1515
| "WETH9"
1616
| "Forwarder"
1717
| "ForwarderEOAOnly"
18-
| "TWCloneFactory"
18+
| "TWCloneFactoryV2"
1919
| (string & {});
2020

2121
type GetDeployedInfraParams = Prettify<
@@ -46,10 +46,7 @@ export async function getDeployedInfraContract(
4646
const contractMetadata = await fetchPublishedContractMetadata({
4747
client: options.client,
4848
contractId: options.contractId,
49-
publisher:
50-
options.contractId === "TWCloneFactory"
51-
? "0x6453a486d52e0EB6E79Ec4491038E2522a926936" // TODO: use default publisher
52-
: options.publisher,
49+
publisher: options.publisher,
5350
version: options.version,
5451
});
5552
return getDeployedInfraContractFromMetadata({

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export async function getRequiredTransactions(
7676
: getDeployedInfraContract({
7777
chain,
7878
client,
79-
contractId: "TWCloneFactory",
79+
contractId: "TWCloneFactoryV2",
8080
constructorParams: {
8181
_trustedForwarder: await computePublishedContractAddress({
8282
chain,
@@ -87,7 +87,7 @@ export async function getRequiredTransactions(
8787
}).then((c) =>
8888
c
8989
? null
90-
: ({ type: "infra", contractId: "TWCloneFactory" } as const),
90+
: ({ type: "infra", contractId: "TWCloneFactoryV2" } as const),
9191
),
9292
// TODO (deploy): add WETH contract check for implementations that need it (check implementation constructor params)
9393
getTransactionsForImplementation({

0 commit comments

Comments
 (0)