-
Notifications
You must be signed in to change notification settings - Fork 2
/
hardhat.config.ts
152 lines (147 loc) · 3.19 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
import dotenv from "dotenv";
import { HardhatUserConfig } from "hardhat/types";
import "@nomiclabs/hardhat-ethers";
import "@nomiclabs/hardhat-etherscan";
import "@nomiclabs/hardhat-waffle";
import "@typechain/hardhat";
import "hardhat-deploy";
import "hardhat-gas-reporter";
import "solidity-coverage";
import "hardhat-dependency-compiler";
import "hardhat-contract-sizer";
dotenv.config();
const infuraKey = process.env.INFURA_API_KEY;
const accounts = process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [];
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.8.17",
settings: {
optimizer: {
enabled: true,
runs: 200,
details: {
yul: true
}
},
// viaIR: true
},
},
{
version: "0.8.15",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
{
version: "0.6.6",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
{
version: "0.5.16",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
{
version: "0.4.24",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
}
]
},
defaultNetwork: "hardhat",
networks: {
hardhat: {
blockGasLimit: 30000000, //default 30 000 000
gasPrice: 100000000000, //100 Gwei,
gas: 9000000,
chainId: 100, //set GNOSIS ID
forking: {
enabled: true,
url: "https://rpc.gnosischain.com/",
},
live: false,
saveDeployments: true,
tags: ["test", "local"],
// loggingEnabled: true,
},
localhost: {
url: "http://localhost:8545",
gasPrice: 20000000000, //20 Gwei,
loggingEnabled: true
},
mainnet: {
live: true,
saveDeployments: true,
url: `https://mainnet.infura.io/v3/${infuraKey}`,
accounts,
},
gnosis: {
live: true,
saveDeployments: true,
url: "https://rpc.gnosischain.com/",
accounts,
},
rinkeby: {
live: false,
saveDeployments: true,
url: `https://rinkeby.infura.io/v3/${infuraKey}`,
accounts,
},
goerli: {
live: false,
saveDeployments: true,
url: `https://goerli.infura.io/v3/${infuraKey}`,
accounts,
},
},
typechain: {
outDir: "typechain",
target: "ethers-v5",
},
paths: {
artifacts: "build/artifacts",
cache: "build/cache",
deploy: "deploy",
deployments: "deployments",
sources: "contracts",
},
// namedAccounts are used if no config is found for given network in deploy/deployment.config.ts
namedAccounts: {
deployer: {
default: 0,
},
account1: 1,
account2: 2,
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
gasReporter: {
currency: "USD",
enabled: process.env.GAS_REPORT_ENABLED === "true",
},
dependencyCompiler: {
paths: [
'./contracts/test',
]
}
};
export default config;