forked from OpenZeppelin/openzeppelin-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.js
51 lines (45 loc) · 1.02 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
/// ENVVAR
// - ENABLE_GAS_REPORT
// - CI
// - COMPILE_MODE
const fs = require('fs');
const path = require('path');
const argv = require('yargs/yargs')()
.env('')
.boolean('enableGasReport')
.boolean('ci')
.string('compileMode')
.argv;
require('@nomiclabs/hardhat-truffle5');
require('solidity-coverage');
if (argv.enableGasReport) {
require('hardhat-gas-reporter');
}
for (const f of fs.readdirSync(path.join(__dirname, 'hardhat'))) {
require(path.join(__dirname, 'hardhat', f));
}
const withOptimizations = argv.enableGasReport || argv.compileMode === 'production';
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: {
version: '0.8.3',
settings: {
optimizer: {
enabled: withOptimizations,
runs: 200,
},
},
},
networks: {
hardhat: {
blockGasLimit: 10000000,
allowUnlimitedContractSize: !withOptimizations,
},
},
gasReporter: {
currency: 'USD',
outputFile: argv.ci ? 'gas-report.txt' : undefined,
},
};