generated from andreitoma8/HardHat-TypeScript-Template
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathhardhat.config.ts
90 lines (85 loc) · 2.7 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
import "@nomicfoundation/hardhat-chai-matchers";
import "@nomiclabs/hardhat-ethers";
import "@nomiclabs/hardhat-etherscan";
import "@typechain/hardhat";
import "hardhat-contract-sizer";
import "hardhat-gas-reporter";
import "solidity-coverage";
import { HardhatUserConfig, task } from "hardhat/config";
import * as dotenv from "dotenv";
dotenv.config();
const NETWORK_GAS_PRICE: Partial<Record<string, number>> = {
// "mainnet": ethers.utils.parseUnits("10", "gwei").toNumber(),
// "sepolia": ethers.utils.parseUnits("10", "gwei").toNumber(),
};
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.8.16",
settings: {
optimizer: {
enabled: true,
runs: 800,
details: {
yul: true,
},
},
},
},
{
version: "0.6.0",
},
],
},
networks: {
hardhat: {
initialBaseFeePerGas: 0,
chainId: 31337,
blockGasLimit: 30000000,
forking: {
url: process.env.ETH_MAINNET_URL || "",
// The Hardhat network will by default fork from the latest mainnet block
// To pin the block number, specify it below
// You will need access to a node with archival data for this to work!
// blockNumber: 14743877,
// If you want to do some forking, set `enabled` to true
enabled: false,
},
},
localhost: {
url: "http://127.0.0.1:8545",
},
sepolia: {
chainId: 11155111,
url: process.env.ETH_SEPOLIA_URL || "",
accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
gasPrice: NETWORK_GAS_PRICE["sepolia"] || "auto",
},
main: {
chainId: 1,
url: process.env.ETH_MAINNET_URL || "",
accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
gasPrice: NETWORK_GAS_PRICE["mainnet"] || "auto",
},
},
gasReporter: {
enabled: process.env.REPORT_GAS !== undefined,
currency: "USD",
},
contractSizer: {
alphaSort: true,
runOnCompile: true,
disambiguatePaths: false,
strict: true,
only: [],
except: [],
},
etherscan: {
apiKey: {
mainnet: process.env.ETHERSCAN_API_KEY || "",
sepolia: process.env.ETHERSCAN_API_KEY || "",
},
},
};
export default config;