This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.networks.ts
69 lines (59 loc) · 1.76 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
69
import { NetworksUserConfig } from "hardhat/types";
const networks : NetworksUserConfig = {
hardhat: {
forking: {
url: process.env.ETH_INFURA_RPC_URL! || "",
},
},
};
if (process.env.ETH_INFURA_RPC_URL && process.env.MAINNET_PRIVATE_KEY) {
networks.mainnet = {
url: process.env.ETH_INFURA_RPC_URL,
chainId: 1,
gasPrice: 30000000000,
accounts: [process.env.MAINNET_PRIVATE_KEY],
};
}
if (process.env.BSC_RPC_URL && process.env.BSC_PRIVATE_KEY) {
networks.bsc = {
url: process.env.BSC_RPC_URL,
chainId: 56,
gasPrice: 10000000000,
accounts: [process.env.BSC_PRIVATE_KEY],
};
}
if (process.env.KOVAN_RPC_URL && process.env.KOVAN_PRIVATE_KEY) {
networks.kovan = {
url: process.env.KOVAN_RPC_URL,
chainId: 42,
gasPrice: 1000000000,
accounts: [process.env.KOVAN_PRIVATE_KEY],
};
}
if (process.env.MATIC_RPC_URL && process.env.MATIC_PRIVATE_KEY) {
networks.matic = {
url: process.env.MATIC_RPC_URL,
chainId: 137,
gasPrice: 1000000000,
accounts: [process.env.MATIC_PRIVATE_KEY],
};
}
if (process.env.KOVAN_OPTIMISTIC_RPC_URL && process.env.KOVAN_OPTIMISTIC_PRIVATE_KEY) {
networks['kovan-optimistic'] = {
url: process.env.KOVAN_OPTIMISTIC_RPC_URL,
chainId: 69,
gasPrice: 15000000,
accounts: [process.env.KOVAN_OPTIMISTIC_PRIVATE_KEY],
ovm: true,
};
}
if (process.env.OPTIMISTIC_RPC_URL && process.env.OPTIMISTIC_PRIVATE_KEY) {
networks.optimistic = {
url: process.env.OPTIMISTIC_RPC_URL,
chainId: 10,
gasPrice: 15000000,
accounts: [process.env.OPTIMISTIC_PRIVATE_KEY],
ovm: true,
};
}
export default networks;