generated from b-street/hardhat-starter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.ts
124 lines (120 loc) · 3.33 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
////////////
// load hardhat features
import "@nomicfoundation/hardhat-toolbox";
import "@nomiclabs/hardhat-solhint";
import "hardhat-contract-sizer";
import "hardhat-deploy";
import "hardhat-docgen";
import "hardhat-interface-generator";
import "hardhat-spdx-license-identifier";
import "hardhat-tracer";
import "hardhat-watcher";
////////////
import "./tasks";
////////////
import { HardhatUserConfig } from "hardhat/config";
import {node_url, accounts} from './utils/network';
import {removeConsoleLog} from "hardhat-preprocessor";
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: {
compilers: [
{
version: "0.8.0",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
{
version: "0.7.5",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
],
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
gasReporter: {
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
currency: "USD",
enabled: process.env.REPORT_GAS === "true",
// outputFile: `gas-${Date.now()}.json`,
// outputFile: "gas.json",
excludeContracts: [
"examples",
"flat",
"mocks",
],
// onlyCalledMethods: true,
// showTimeSpent: true,
},
namedAccounts: {
deployer: {
default: 0, // here this will by default take the first account as deployer
},
tokenOwner: 1,
},
typechain: {
outDir: "types",
target: "ethers-v5",
},
preprocess: {
eachLine: removeConsoleLog((bre) =>
bre.network.name !== "hardhat" && bre.network.name !== "localhost"),
},
paths: {
artifacts: "artifacts",
cache: "cache",
deploy: "deploy",
deployments: "deployments",
imports: "imports",
sources: "contracts",
tests: "tests",
},
networks: {
fuji: {
url: node_url("fuji"),
accounts: accounts('fuji'),
chainId: 43113,
live: true,
saveDeployments: true,
tags: ["staging"],
gasMultiplier: 2,
},
localhost: {
saveDeployments: true,
chainId: 31337,
accounts: accounts('localhost'),
gasPrice: 225000000000,
throwOnTransactionFailures: true,
loggingEnabled: true,
url: 'http://localhost:8545',
},
hardhat: {
saveDeployments: true,
chainId: 31337,
accounts: accounts('hardhat'),
gasPrice: 225000000000,
throwOnTransactionFailures: true,
loggingEnabled: true,
forking: {
url: node_url("fork", {
defaultsTo: node_url("avax"),
required:true
})!!,
enabled: true,
// blockNumber: 2975762
// blockNumber: 13919447
},
},
},
deterministicDeployments: true,
};