@@ -15,7 +15,7 @@ import Web3 from "web3";
15
15
import { CHAINS } from "@pythnetwork/xc-admin-common" ;
16
16
import * as fs from "fs" ;
17
17
18
- const { getDefaultConfig } = require ( "../../target_chains/ethereum/contracts/scripts/contractManagerConfig" ) ;
18
+ import { getDefaultConfig } from "../../target_chains/ethereum/contracts/scripts/contractManagerConfig" ;
19
19
20
20
const parser = yargs ( hideBin ( process . argv ) )
21
21
. usage (
@@ -45,10 +45,13 @@ const parser = yargs(hideBin(process.argv))
45
45
} ,
46
46
} ) ;
47
47
48
- async function memoize ( key : string , fn : ( ) => Promise < any > ) {
49
- const cacheDir = '../../target_chains/ethereum/contracts/cache' ;
48
+ async function memoize (
49
+ key : string ,
50
+ fn : ( ) => Promise < string > ,
51
+ ) : Promise < string > {
52
+ const cacheDir = "../../target_chains/ethereum/contracts/cache" ;
50
53
const path = `${ cacheDir } /${ key } .json` ;
51
-
54
+
52
55
if ( fs . existsSync ( path ) ) {
53
56
return JSON . parse ( fs . readFileSync ( path ) . toString ( ) ) ;
54
57
}
@@ -61,11 +64,14 @@ async function main() {
61
64
const argv = await parser . argv ;
62
65
const privateKey = argv [ "private-key" ] ;
63
66
const network = argv [ "network" ] ;
64
- const setupInfo = require ( argv [ "contract" ] + "/ReceiverSetup.json" ) ;
65
- const implementationInfo = require (
66
- 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"
67
74
) ;
68
- const receiverInfo = require ( argv [ "contract" ] + "/WormholeReceiver.json" ) ;
69
75
70
76
const payloads : Buffer [ ] = [ ] ;
71
77
for ( const chain of Object . values ( DefaultStore . chains ) ) {
0 commit comments