-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.networks.ts
68 lines (65 loc) · 1.5 KB
/
hardhat.networks.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
const networks = {};
function register(
name: string,
chainId: number,
url: string | undefined,
privateKey: string | undefined
) {
if (url && privateKey) {
networks[name] = {
url,
chainId,
accounts: [privateKey],
};
console.log(`Network '${name}' registered`);
} else {
console.log(`Network '${name}' not registered`);
}
}
register(
"mainnet",
1,
process.env.MAINNET_RPC_URL,
process.env.MAINNET_PRIVATE_KEY
);
register("bsc", 56, process.env.BSC_RPC_URL, process.env.BSC_PRIVATE_KEY);
register("kovan", 42, process.env.KOVAN_RPC_URL, process.env.KOVAN_PRIVATE_KEY);
register(
"optimistic",
10,
process.env.OPTIMISTIC_RPC_URL,
process.env.OPTIMISTIC_PRIVATE_KEY
);
register(
"kovan-optimistic",
69,
process.env.KOVAN_OPTIMISTIC_RPC_URL,
process.env.KOVAN_OPTIMISTIC_PRIVATE_KEY
);
register(
"matic",
137,
process.env.MATIC_RPC_URL,
process.env.MATIC_PRIVATE_KEY
);
register(
"arbitrum",
42161,
process.env.ARBITRUM_RPC_URL,
process.env.ARBITRUM_PRIVATE_KEY
);
register(
"ropsten",
3,
process.env.ROPSTEN_RPC_URL,
process.env.ROPSTEN_PRIVATE_KEY
);
register(
"rinkeby",
4,
process.env.RINKEBY_RPC_URL,
process.env.RINKEBY_PRIVATE_KEY
);
register("xdai", 100, process.env.XDAI_RPC_URL, process.env.XDAI_PRIVATE_KEY);
register("avax", 43114, process.env.AVAX_RPC_URL, process.env.AVAX_PRIVATE_KEY);
export default networks;