Skip to content

Commit b7ed7fb

Browse files
Merge pull request #3010 from pyth-network/move-deploy-receiver
chore: moved batch deploy receiver to contract_manager
2 parents c3aa24c + 72f51a4 commit b7ed7fb

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

target_chains/ethereum/contracts/scripts/batchDeployReceivers.ts renamed to contract_manager/scripts/batchDeployReceivers.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Web3 from "web3";
1515
import { CHAINS } from "@pythnetwork/xc-admin-common";
1616
import * as fs from "fs";
1717

18-
const { getDefaultConfig } = require("./contractManagerConfig");
18+
import { getDefaultConfig } from "../../target_chains/ethereum/contracts/scripts/contractManagerConfig";
1919

2020
const parser = yargs(hideBin(process.argv))
2121
.usage(
@@ -45,8 +45,13 @@ const parser = yargs(hideBin(process.argv))
4545
},
4646
});
4747

48-
async function memoize(key: string, fn: () => Promise<any>) {
49-
const path = `./cache/${key}.json`;
48+
async function memoize(
49+
key: string,
50+
fn: () => Promise<string>,
51+
): Promise<string> {
52+
const cacheDir = "../../target_chains/ethereum/contracts/cache";
53+
const path = `${cacheDir}/${key}.json`;
54+
5055
if (fs.existsSync(path)) {
5156
return JSON.parse(fs.readFileSync(path).toString());
5257
}
@@ -59,11 +64,14 @@ async function main() {
5964
const argv = await parser.argv;
6065
const privateKey = argv["private-key"];
6166
const network = argv["network"];
62-
const setupInfo = require(argv["contract"] + "/ReceiverSetup.json");
63-
const implementationInfo = require(
64-
argv["contract"] + "/ReceiverImplementation.json",
67+
68+
const setupInfo = await import(argv["contract"] + "/ReceiverSetup.json");
69+
const implementationInfo = await import(
70+
argv["contract"] + "/ReceiverImplementation.json"
71+
);
72+
const receiverInfo = await import(
73+
argv["contract"] + "/WormholeReceiver.json"
6574
);
66-
const receiverInfo = require(argv["contract"] + "/WormholeReceiver.json");
6775

6876
const payloads: Buffer[] = [];
6977
for (const chain of Object.values(DefaultStore.chains)) {

0 commit comments

Comments
 (0)