forked from 1inch/spot-price-aggregator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.networks.js
73 lines (65 loc) · 1.89 KB
/
hardhat.networks.js
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
70
71
72
73
const networks = {
hardhat: {
forking: {
url: process.env.MAINNET_RPC_URL,
},
},
};
if (process.env.MAINNET_RPC_URL && process.env.MAINNET_PRIVATE_KEY) {
networks.mainnet = {
url: process.env.MAINNET_RPC_URL,
chainId: 1,
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,
};
}
if (process.env.ARBITRUM_RPC_URL && process.env.ARBITRUM_PRIVATE_KEY) {
networks.arbitrum = {
url: process.env.ARBITRUM_RPC_URL,
chainId: 42161,
gasPrice: 1e9,
accounts: [process.env.ARBITRUM_PRIVATE_KEY],
};
}
module.exports = networks;