Skip to content

Commit 1b6f24f

Browse files
authored
Update deploy script (#473)
* sequential txns esp when deploying dynamic * update
1 parent 308422b commit 1b6f24f

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

scripts/deploy-prebuilt-deterministic/bootstrap-on-a-chain.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,14 @@ async function main() {
123123

124124
console.log(`-- Deploying ${publishedContractName} at ${resolvedImplementationAddress}`);
125125
// send each transaction directly to Create2 factory
126-
await Promise.all(
127-
transactionsforDirectDeploy.map(tx => {
128-
return deployContractDeterministic(signer, tx, {});
129-
}),
130-
);
126+
// process txns one at a time
127+
for (const tx of transactionsforDirectDeploy) {
128+
try {
129+
await deployContractDeterministic(signer, tx, {});
130+
} catch (e) {
131+
console.debug(`Error deploying contract at ${tx.predictedAddress}`, (e as any)?.message);
132+
}
133+
}
131134
console.log();
132135
} catch (e) {
133136
console.log("Error while deploying: ", e);

scripts/deploy-prebuilt-deterministic/deploy-deterministic-std-chains.ts

+9-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { apiMap, chainIdApiKey, chainIdToName } from "./constants";
1818
////// To run this script: `npx ts-node scripts/deploy-prebuilt-deterministic/deploy-deterministic-std-chains.ts` //////
1919
///// MAKE SURE TO PUT IN THE RIGHT CONTRACT NAME HERE AFTER PUBLISHING IT /////
2020
//// THE CONTRACT SHOULD BE PUBLISHED WITH THE NEW PUBLISH FLOW ////
21-
const publishedContractName = "OpenEditionERC721";
21+
const publishedContractName = "TokenERC20";
2222
const publisherKey: string = process.env.THIRDWEB_PUBLISHER_PRIVATE_KEY as string;
2323
const deployerKey: string = process.env.PRIVATE_KEY as string;
2424

@@ -112,11 +112,14 @@ async function main() {
112112

113113
console.log(`-- Deploying ${publishedContractName} at ${resolvedImplementationAddress}`);
114114
// send each transaction directly to Create2 factory
115-
await Promise.all(
116-
transactionsforDirectDeploy.map(tx => {
117-
return deployContractDeterministic(signer, tx, {});
118-
}),
119-
);
115+
// process txns one at a time
116+
for (const tx of transactionsforDirectDeploy) {
117+
try {
118+
await deployContractDeterministic(signer, tx, {});
119+
} catch (e) {
120+
console.debug(`Error deploying contract at ${tx.predictedAddress}`, (e as any)?.message);
121+
}
122+
}
120123
console.log();
121124
} catch (e) {
122125
console.log("Error while deploying: ", e);

0 commit comments

Comments
 (0)