-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhardhat.config.ts
71 lines (67 loc) · 1.83 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
import * as dotenv from "dotenv";
import { HardhatUserConfig, task, types } from "hardhat/config";
import "hardhat-deploy";
import "@nomiclabs/hardhat-etherscan";
import "@nomiclabs/hardhat-waffle";
import "@nomiclabs/hardhat-ethers";
import "@typechain/hardhat";
import "hardhat-gas-reporter";
import "solidity-coverage";
import { node_url, accounts, addForkConfiguration } from "./src/network";
import { utils } from "ethers";
dotenv.config();
const config: HardhatUserConfig = {
solidity: {
version: "0.8.16",
settings: {
optimizer: {
enabled: true,
runs: 10000,
},
},
},
defaultNetwork: "hardhat",
namedAccounts: {
deployer: 0,
},
networks: addForkConfiguration({
hardhat: {
initialBaseFeePerGas: 0, // to fix : https://github.com/sc-forks/solidity-coverage/issues/652, see https://github.com/sc-forks/solidity-coverage/issues/652#issuecomment-896330136
accounts: accounts("hardhat"),
tags: ["local"],
forking: {
enabled: true,
url: node_url("mainnet"),
},
},
sepolia: {
url: node_url("sepolia"),
accounts: accounts("sepolia"),
deploy: ["deploy/testnet/"],
},
mainnet: {
url: node_url("mainnet"),
accounts: accounts("mainnet"),
gasPrice: utils.parseUnits("9", "gwei").toNumber(),
deploy: ["deploy/mainnet/"],
},
}),
gasReporter: {
enabled: process.env.REPORT_GAS !== undefined,
gasPrice: 8,
currency: "USD",
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
},
etherscan: {
apiKey: {
mainnet: process.env.ETHERSCAN_API_KEY_MAINNET || "",
goerli: process.env.ETHERSCAN_API_KEY_GOERLI || "",
sepolia: process.env.ETHERSCAN_API_KEY_SEPOLIA || "",
},
},
typechain: {
outDir: "src/contracts",
target: "ethers-v5",
},
};
export default config;