Skip to content

Commit

Permalink
fix: deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
ameeshaagrawal committed Jun 18, 2024
1 parent 3e3ac88 commit f3916b9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
27 changes: 21 additions & 6 deletions scripts/deploy/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,31 @@ import prompts from "prompts";

const main = async () => {
try {
const chainSlugs = Object.keys(ChainSlug);
const chain = ChainSlug[chainSlugs[chainSlugs.length - 1]];
const response = await prompts([
{
name: "chainType",
type: "select",
message: "Select chains network type",
choices: [
{
title: "Mainnet",
value: "mainnet",
},
{
title: "Testnet",
value: "testnet",
},
],
},
]);

const isMainnet = MainnetIds.includes(chain);
const chainOptions = isMainnet ? MainnetIds : TestnetIds;
const chainOptions =
response.chainType === "mainnet" ? MainnetIds : TestnetIds;
let choices = chainOptions.map((chain) => ({
title: chain.toString(),
value: chain,
}));
choices = choices.filter((c) => c.value !== chain);

const configResponse = await prompts([
{
name: "chains",
Expand All @@ -31,7 +46,7 @@ const main = async () => {
},
]);

const chains = [...configResponse.chains, chain];
const chains = [...configResponse.chains];
let addresses: DeploymentAddresses = await deployForChains(chains);

if (chains.length === 0) {
Expand Down
3 changes: 3 additions & 0 deletions scripts/deploy/scripts/configureSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ export const configureExecutionManager = async (
signature,
dstChainSlug: siblingSlug,
nonce: nextNonce++,
gasPrice: 0,
perByteCost: 0,
overhead: 0,
fees: msgValueMaxThreshold(siblingSlug),
functionSelector: "0xa1885700", // setMsgValueMaxThreshold
};
Expand Down
1 change: 0 additions & 1 deletion scripts/deploy/scripts/deploySocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ export const deploySocket = async (
let capacitor = await simulatorContract.capacitor();
if (capacitor == constants.AddressZero) {
const tx = await simulatorContract.setup(
counter.address,
switchboardSimulator.address,
simulatorUtils.address,
{
Expand Down

0 comments on commit f3916b9

Please sign in to comment.