forked from enjinstarter/enjinstarter-tge-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.js
85 lines (72 loc) · 2.08 KB
/
hardhat.config.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
74
75
76
77
78
79
80
81
82
83
84
85
require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-etherscan");
require("@nomiclabs/hardhat-truffle5");
require("hardhat-gas-reporter");
require("solidity-coverage");
const coinmarketcapApiKey = process.env.COINMARKETCAP_API_KEY;
const etherscanApiKey = process.env.ETHERSCAN_API_KEY;
const infuraProjectId = process.env.INFURA_PROJECT_ID;
const kovanPrivateKey = process.env.KOVAN_PRIVATE_KEY;
const ropstenPrivateKey = process.env.ROPSTEN_PRIVATE_KEY;
const mainnetPrivateKey = process.env.MAINNET_PRIVATE_KEY;
// You need to export an object to set up your config
// Go to https://hardhat.org/config/ to learn more
/**
* @type import('hardhat/config').HardhatUserConfig
*/
const config = {
solidity: {
version: "0.7.6",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
mocha: {
timeout: 120000,
},
etherscan: {
apiKey: etherscanApiKey,
},
gasReporter: {
currency: "USD",
coinmarketcap: coinmarketcapApiKey,
outputFile: "gas-usage.txt",
noColors: true,
},
};
if (!config.networks) {
config.networks = {};
}
config.networks["hardhat"] = {
initialBaseFeePerGas: 0,
accounts: {
count: 210,
},
};
if (kovanPrivateKey) {
config.networks["kovan"] = {
url: `https://kovan.infura.io/v3/${infuraProjectId}`,
accounts: [`0x${kovanPrivateKey}`],
gasPrice: 2000000000, // For testnet only, 2 Gwei
};
}
if (ropstenPrivateKey) {
// const alchemyApiKey = process.env.ROPSTEN_ALCHEMY_API_KEY;
config.networks["ropsten"] = {
url: `https://ropsten.infura.io/v3/${infuraProjectId}`, // https://eth-ropsten.alchemyapi.io/v2/${alchemyApiKey}
accounts: [`0x${ropstenPrivateKey}`],
gasPrice: 2000000000, // For testnet only, 2 Gwei
};
}
if (mainnetPrivateKey) {
// const alchemyApiKey = process.env.MAINNET_ALCHEMY_API_KEY;
config.networks["mainnet"] = {
url: `https://mainnet.infura.io/v3/${infuraProjectId}`, // https://eth-mainnet.alchemyapi.io/v2/${alchemyApiKey}
accounts: [`0x${mainnetPrivateKey}`],
gasPrice: 60000000000, // 60 Gwei
};
}
module.exports = config;