-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.js
120 lines (111 loc) · 2.47 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
'use strict';
// Configure environment variables.
require('dotenv').config();
// Include Babel so that we may use some newer JavaScript syntax.
require('@babel/register');
// Include Waffle with Ethers as our preferred engine for testing.
require('@nomiclabs/hardhat-waffle');
// Include the detailed gas usage reporter for tests.
require('hardhat-gas-reporter');
// Include the contract size output display.
require('hardhat-contract-sizer');
// Include coverage checking for unit tests.
require('solidity-coverage');
// Include the Etherscan contract verifier.
require('@nomiclabs/hardhat-etherscan');
// Retrieve sensitive node and private key details from environment variables.
const INFURA_PROJECT_ID = process.env.INFURA_PROJECT_ID;
const DEPLOYER_PRIVATE_KEY = process.env.DEPLOYER_PRIVATE_KEY;
// Export a configuration for Hardhat to use when working with our contracts.
module.exports = {
solidity: {
compilers: [
{
version: '0.4.24'
},
{
version: '0.6.6',
settings: {
optimizer: {
enabled: true,
runs: 0
}
}
},
{
version: '0.6.12',
settings: {
optimizer: {
enabled: true
}
}
},
{
version: '0.7.6',
settings: {
optimizer: {
enabled: true,
runs: 0
}
}
},
{
version: '0.8.7',
settings: {
optimizer: {
enabled: true,
runs: 0
}
}
},
{
version: '0.8.8',
settings: {
optimizer: {
enabled: true,
runs: 0
}
}
},
]
},
networks: {
hardhat: {
forking: {
url: `https://eth-mainnet.alchemyapi.io/v2/${process.env.ALCHEMY_KEY}`,
blockNumber: 12883802
}
},
mainnet: {
url: `https://mainnet.infura.io/v3/${INFURA_PROJECT_ID}`,
accounts: [ `0x${DEPLOYER_PRIVATE_KEY}` ]
},
rinkeby: {
url: `https://rinkeby.infura.io/v3/${INFURA_PROJECT_ID}`,
accounts: [ `0x${DEPLOYER_PRIVATE_KEY}` ]
},
ropsten: {
url: `https://ropsten.infura.io/v3/${INFURA_PROJECT_ID}`,
accounts: [ `0x${DEPLOYER_PRIVATE_KEY}` ]
},
kovan: {
url: `https://kovan.infura.io/v3/${INFURA_PROJECT_ID}`,
accounts: [ `0x${DEPLOYER_PRIVATE_KEY}` ]
},
goerli: {
url: `https://goerli.infura.io/v3/${INFURA_PROJECT_ID}`,
accounts: [ `0x${DEPLOYER_PRIVATE_KEY}` ]
}
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY
},
mocha: {
grep: '^(?!.*; using Ganache).*'
},
contractSizer: {
alphaSort: true,
runOnCompile: true,
disambiguatePaths: false,
}
};