-
Notifications
You must be signed in to change notification settings - Fork 12
/
hardhat.config.js
66 lines (61 loc) · 1.87 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
55
56
57
58
59
60
61
62
63
64
65
66
require("dotenv").config();
require("@nomicfoundation/hardhat-toolbox");
require("hardhat-gas-reporter");
const {
TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS,
} = require("hardhat/builtin-tasks/task-names");
const path = require("path");
subtask(
TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS,
async (_, { config }, runSuper) => {
const paths = await runSuper();
return paths.filter((solidityFilePath) => {
const relativePath = path.relative(
config.paths.sources,
solidityFilePath
);
if (
relativePath.includes("node_modules") ||
relativePath.startsWith("lib") ||
relativePath.startsWith(".deps") ||
relativePath.startsWith("test/foundry")
) {
return false;
} else if (process.env.WHITELIST_PATH) {
return (
relativePath === process.env.WHITELIST_PATH ||
solidityFilePath === process.env.WHITELIST_PATH
);
} else {
console.log(relativePath);
return true;
}
});
}
);
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: {
version: "0.8.20",
settings: {
optimizer: {
enabled: true,
runs: 1000,
},
},
},
paths: {
sources: "./",
tests: "./test",
cache: "./cache",
artifacts: "./artifacts",
},
gasReporter: {
enabled: process.env.REPORT_GAS === "true" ? true : false,
//outputFile: "gas-report.txt",
noColors: true,
currency: "USD",
//coinmarketcap: process.env.COINMARKET_API_KEY,
//gasPrice: 50,
},
};