-
Notifications
You must be signed in to change notification settings - Fork 842
/
hardhat.config.js
45 lines (39 loc) · 954 Bytes
/
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
require('@nomiclabs/hardhat-waffle');
require('@nomiclabs/hardhat-ethers');
if (process.env.REPORT_GAS) {
require('hardhat-gas-reporter');
}
if (process.env.REPORT_COVERAGE) {
require('solidity-coverage');
}
/**
* @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);
};
}