-
Notifications
You must be signed in to change notification settings - Fork 21
/
hardhat.config.js
130 lines (124 loc) · 2.43 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/* eslint-disable no-undef */
const dotenv = require('dotenv');
const dotenvResult = dotenv.config();
if (dotenvResult.error) {
throw dotenvResult.error;
}
require('hardhat-deploy');
require('@nomiclabs/hardhat-ethers');
require('hardhat-gas-reporter');
require('solidity-coverage');
require('hardhat-abi-exporter');
require('@tenderly/hardhat-tenderly');
require('@nomiclabs/hardhat-etherscan');
require('@primitivefi/hardhat-dodoc');
const {
PROVIDER_HOST,
PROVIDER_PORT,
PROVIDER_URL,
NETWORK,
MNEMONIC,
CMC_KEY,
ETHERSCAN_KEY,
TENDERLY_SLUG,
} = process.env;
// Ref - https://chainid.network/chains.json
const ENV_CHAIN_IDS = {
mainnet: 1,
goerli: 5,
mumbai: 80001,
skale: 132333505628089,
};
module.exports = {
defaultNetwork: 'hardhat',
solidity: {
compilers: [
{
version: '0.8.4',
settings: {
optimizer: {
enabled: true,
runs: 3000,
},
},
},
],
overrides: {
'contracts/Core/BlockManager.sol': {
version: '0.8.4',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
'contracts/Core/StakeManager.sol': {
version: '0.8.4',
settings: {
optimizer: {
enabled: true,
runs: 1300,
},
},
},
},
},
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],
timeout: 300000,
},
skale: {
url: PROVIDER_URL || '',
accounts: { mnemonic: MNEMONIC },
chainId: ENV_CHAIN_IDS[NETWORK],
timeout: 300000,
},
hardhat: {
saveDeployments: false,
},
},
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: TENDERLY_SLUG,
},
mocha: {
timeout: 50000,
},
dodoc: {
runOnCompile: false,
},
namedAccounts: {
deployer: 0,
tokenOwner: 1,
},
paths: {
sources: './contracts',
},
};