-
Notifications
You must be signed in to change notification settings - Fork 2
/
hardhat.config.ts
78 lines (66 loc) · 1.64 KB
/
hardhat.config.ts
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
import { task, subtask, HardhatUserConfig } from 'hardhat/config';
import '@nomiclabs/hardhat-waffle';
import '@nomiclabs/hardhat-ethers';
import '@nomiclabs/hardhat-solhint';
import 'hardhat-gas-reporter';
import 'solidity-coverage';
const mnemonic: string = 'test test test test test test test test test test test junk';
const { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } = require('hardhat/builtin-tasks/task-names');
subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction(async (_, __, runSuper) => {
const paths = await runSuper();
return paths.filter((p: any) => !p.endsWith('.t.sol'));
});
task('accounts', 'Prints the list of accounts', async (taskArgs, hre) => {
const accounts = await hre.ethers.getSigners();
for (const account of accounts) {
console.log('address: ' + (await account.getAddress()));
}
});
const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
gasReporter: {
currency: 'USD',
gasPrice: 30,
},
networks: {
localhost: {
url: 'http://localhost:8545',
},
hardhat: {
accounts: {
mnemonic,
path: "m/44'/1'/0'/0",
},
},
coverage: {
url: 'http://localhost:8555',
},
},
solidity: {
compilers: [
{
version: '0.8.16',
settings: {
viaIR: false,
optimizer: {
enabled: true,
runs: 42069,
details: {
yul: true,
},
},
},
},
],
},
paths: {
sources: './contracts',
tests: './test',
cache: './hh-cache',
artifacts: './artifacts',
},
mocha: {
timeout: 0,
},
};
export default config;