Skip to content

Update deploy script #547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 19, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { DEFAULT_CHAINS, apiMap, chainIdApiKey } from "./constants";
////// To run this script: `npx ts-node scripts/deploy-prebuilt-deterministic/deploy-deterministic-std-chains.ts` //////
///// MAKE SURE TO PUT IN THE RIGHT CONTRACT NAME HERE AFTER PUBLISHING IT /////
//// THE CONTRACT SHOULD BE PUBLISHED WITH THE NEW PUBLISH FLOW ////
const publishedContractName = "AccountExtension";
const publishedContractName = "MarketplaceV3";
const publisherAddress: string = "deployer.thirdweb.eth";
const deployerKey: string = process.env.PRIVATE_KEY as string;
const secretKey: string = process.env.THIRDWEB_SECRET_KEY as string;
Expand Down Expand Up @@ -47,7 +47,14 @@ async function main() {
// const chainId = (await sdk.getProvider().getNetwork()).chainId;

try {
const implAddr = await getThirdwebContractAddress(publishedContractName, chain.chainId, sdk.storage);
const implAddr = await getThirdwebContractAddress(
publishedContractName,
chain.chainId,
sdk.storage,
"latest",
sdk.options.clientId,
sdk.options.secretKey,
);
if (implAddr) {
console.log(`implementation ${implAddr} already deployed on chainId: ${chain.slug}`);
console.log();
Expand Down Expand Up @@ -76,6 +83,8 @@ async function main() {
sdk.getProvider(),
sdk.storage,
create2FactoryAddress,
sdk.options.clientId,
sdk.options.secretKey,
);
if (await isContractDeployed(cloneFactoryAddress, sdk.getProvider())) {
console.log(`-- TWCloneFactory already present at ${cloneFactoryAddress}`);
Expand All @@ -87,6 +96,8 @@ async function main() {
sdk.storage,
sdk.getProvider(),
create2FactoryAddress,
sdk.options.clientId,
sdk.options.secretKey,
);

const implementationAddress = deploymentInfo.find(i => i.type === "implementation")?.transaction
Expand Down