-
Notifications
You must be signed in to change notification settings - Fork 43
/
hardhat.config.js
54 lines (46 loc) · 1.28 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
require('@nomiclabs/hardhat-waffle');
require('@nomiclabs/hardhat-ethers');
const { internalTask } = require('hardhat/config');
const { TASK_COMPILE_SOLIDITY_GET_COMPILER_INPUT } = require('hardhat/builtin-tasks/task-names');
if (process.env.REPORT_GAS) {
require('hardhat-gas-reporter');
}
if (process.env.REPORT_COVERAGE) {
require('solidity-coverage');
}
internalTask(TASK_COMPILE_SOLIDITY_GET_COMPILER_INPUT, async (args, hre, runSuper) => {
const input = await runSuper();
input.settings.outputSelection['*']['*'].push('storageLayout');
return input;
});
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: {
version: '0.8.11',
settings: {
optimizer: {
enabled: true,
runs: 800,
},
},
},
gasReporter: {
currency: 'USD',
gasPrice: 100,
showTimeSpent: true,
},
plugins: ['solidity-coverage'],
};
// The "ripemd160" algorithm is not available anymore in NodeJS 17+ (because of lib SSL 3).
// The following code replaces it with "sha256" instead.
const crypto = require('crypto');
try {
crypto.createHash('ripemd160');
} catch (e) {
const origCreateHash = crypto.createHash;
crypto.createHash = (alg, opts) => {
return origCreateHash(alg === 'ripemd160' ? 'sha256' : alg, opts);
};
}