-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhardhat.config.js
More file actions
55 lines (50 loc) · 1.25 KB
/
Copy pathhardhat.config.js
File metadata and controls
55 lines (50 loc) · 1.25 KB
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
const fs = require('fs');
const path = require('path');
require('@nomiclabs/hardhat-truffle5');
require('@nomiclabs/hardhat-solhint');
require('solidity-coverage');
require('hardhat-gas-reporter');
let secret = {
mnemonic: 'test test test test test test test test test test test junk',
infuraKey: '',
};
try {
// Secret file format is:
// { mnemonic: '', infuraKey, '', endpoints: { <networkname>: 'http://endpoint' } }
const secretFile = path.join(__dirname, '.secret.json');
if (fs.existsSync(secretFile)) {
secret = JSON.parse(fs.readFileSync(secretFile));
}
} catch (warning) {
console.warn('No secret configuration found!', warning);
}
const enableGasReport = !!process.env.ENABLE_GAS_REPORT;
module.exports = {
solidity: {
version: '0.8.1',
settings: {
optimizer: {
enabled: enableGasReport,
runs: 10000,
},
},
},
networks: {
hardhat: {
blockGasLimit: 10000000,
},
goerli: {
url: 'https://goerli.infura.io/v3/' + secret.infuraKey,
chainId: 5,
gas: 'auto',
accounts: {
mnemonic: secret.mnemonic,
},
},
},
gasReporter: {
enable: enableGasReport,
currency: 'CHF',
outputFile: process.env.CI ? 'gas-report.txt' : undefined,
},
};