forked from 0xcuriousapple/contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.js
104 lines (98 loc) · 1.97 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* eslint-disable no-undef */
const dotenv = require('dotenv');
const dotenvResult = dotenv.config();
if (dotenvResult.error) {
throw dotenvResult.error;
}
require('@nomiclabs/hardhat-ethers');
require('@nomiclabs/hardhat-truffle5');
require('hardhat-gas-reporter');
require('solidity-coverage');
require('hardhat-abi-exporter');
require('@tenderly/hardhat-tenderly');
require('@nomiclabs/hardhat-etherscan');
const {
PROVIDER_HOST,
PROVIDER_PORT,
PROVIDER_URL,
NETWORK,
MNEMONIC,
CMC_KEY,
ETHERSCAN_KEY,
} = process.env;
// Ref - https://chainid.network/chains.json
const ENV_CHAIN_IDS = {
mainnet: 1,
goerli: 5,
mumbai: 80001,
};
module.exports = {
defaultNetwork: 'hardhat',
solidity: {
compilers: [
{
version: '0.8.4',
settings: {
optimizer: {
enabled: true,
runs: 100000,
},
},
},
],
overrides: {
'contracts/Core/StakeManager.sol': {
version: '0.8.4',
settings: {
optimizer: {
enabled: true,
runs: 50000,
},
},
},
'contracts/Core/BlockManager.sol': {
version: '0.8.4',
settings: {
optimizer: {
enabled: true,
runs: 30000,
},
},
},
},
},
networks: {
local: {
url: `http://${PROVIDER_HOST}:${PROVIDER_PORT}`,
chainId: 31337,
logger: console,
mining: {
auto: true,
interval: 2000,
},
},
mumbai: {
url: PROVIDER_URL || '',
accounts: { mnemonic: MNEMONIC },
chainId: ENV_CHAIN_IDS[NETWORK],
},
},
etherscan: {
apiKey: ETHERSCAN_KEY,
},
gasReporter: {
noColors: true, // Colors on terminal corrupts the output.
coinmarketcap: CMC_KEY,
currency: 'USD',
},
abiExporter: {
path: './abi',
clear: true,
flat: true,
spacing: 2,
},
tenderly: {
username: 'razor',
project: 'razor-network',
},
};