forked from renproject/gateway-sol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
127 lines (120 loc) · 3.55 KB
/
hardhat.config.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import { config as dotEnvConfig } from "dotenv";
dotEnvConfig();
import { HardhatUserConfig } from "hardhat/types";
import "@nomiclabs/hardhat-etherscan";
import "@nomiclabs/hardhat-waffle";
import "@typechain/hardhat";
import "hardhat-deploy";
// TODO: reenable solidity-coverage when it works
// import "solidity-coverage";
const INFURA_KEY = process.env.INFURA_KEY || "";
const MNEMONIC_TESTNET = process.env.MNEMONIC_TESTNET;
const MNEMONIC_MAINNET = process.env.MNEMONIC_MAINNET;
// Explorer keys
const ETHERSCAN_KEY = process.env.ETHERSCAN_KEY;
const BSCSCAN_KEY = process.env.BSCSCAN_KEY;
const POLYGONSCAN_KEY = process.env.POLYGONSCAN_KEY;
const FTMSCAN_KEY = process.env.FTMSCAN_KEY;
if (!MNEMONIC_TESTNET && !MNEMONIC_MAINNET) {
throw new Error(`Must set mnemonic.`);
}
const config: HardhatUserConfig = {
defaultNetwork: "hardhat",
solidity: {
compilers: [
{
version: "0.5.17",
settings: {
optimizer: {
enabled: true,
runs: 200
}
},
},
],
},
networks: {
hardhat: {},
ethereumMainnet: {
url: `https://mainnet.infura.io/v3/${INFURA_KEY}`,
accounts: {
mnemonic: MNEMONIC_MAINNET,
},
},
ethereumMainnetVDot3: {
url: `https://mainnet.infura.io/v3/${INFURA_KEY}`,
accounts: {
mnemonic: MNEMONIC_MAINNET,
},
},
ethereumTestnet: {
url: `https://kovan.infura.io/v3/${INFURA_KEY}`,
accounts: {
mnemonic: MNEMONIC_TESTNET,
},
},
ethereumDevnet: {
url: `https://kovan.infura.io/v3/${INFURA_KEY}`,
accounts: {
mnemonic: MNEMONIC_TESTNET,
},
},
bscTestnet: {
url: `https://data-seed-prebsc-1-s1.binance.org:8545`,
accounts: {
mnemonic: MNEMONIC_TESTNET,
},
},
bscMainnet: {
url: `https://bsc-dataseed1.binance.org/`,
accounts: {
mnemonic: MNEMONIC_MAINNET,
},
},
polygonTestnet: {
url: `https://rpc-mumbai.maticvigil.com/`,
accounts: {
mnemonic: MNEMONIC_TESTNET,
},
},
polygonMainnet: {
url: `https://rpc-mainnet.maticvigil.com`,
accounts: {
mnemonic: MNEMONIC_MAINNET,
},
},
fantomTestnet: {
url: `https://rpc.testnet.fantom.network/`,
accounts: {
mnemonic: MNEMONIC_TESTNET,
},
},
fantomMainnet: {
url: `https://rpcapi.fantom.network`,
accounts: {
mnemonic: MNEMONIC_MAINNET,
},
},
avalancheTestnet: {
url: `https://api.avax-test.network/ext/bc/C/rpc`,
accounts: {
mnemonic: MNEMONIC_TESTNET,
},
},
avalancheMainnet: {
url: `https://api.avax.network/ext/bc/C/rpc`,
accounts: {
mnemonic: MNEMONIC_MAINNET,
},
},
coverage: {
url: "http://127.0.0.1:8555", // Coverage launches its own ganache-cli client
},
},
etherscan: {
// Your API key for Etherscan
// Obtain one at https://etherscan.io/
apiKey: POLYGONSCAN_KEY,
},
};
export default config;