-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.ts
93 lines (84 loc) · 2.49 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
import * as dotenv from "dotenv";
import { HardhatUserConfig } from "hardhat/config";
import "@nomiclabs/hardhat-etherscan";
import "@nomiclabs/hardhat-waffle";
import "@typechain/hardhat";
import "hardhat-gas-reporter";
import "hardhat-deploy";
import "./tasks/polygonscan";
import "./tasks/preprocess";
dotenv.config();
// You need to export an object to set up your config
// Go to https://hardhat.org/config/ to learn more
const GAS_PRICE = parseFloat(process.env.GAS_PRICE || "1");
const REPORT_GAS = process.env.REPORT_GAS;
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY ?? "";
const MAINNET_API_URL = process.env.MAINNET_API_URL ?? "";
const BLOCK_NUMBER = parseInt(process.env.BLOCK_NUMBER ?? "0");
const config: HardhatUserConfig = {
defaultNetwork: "hardhat",
solidity: {
compilers: [
{
version: "0.8.17",
settings: {
optimizer: {
enabled: true,
runs: 2000,
details: {
peephole: true,
inliner: true,
jumpdestRemover: true,
orderLiterals: true,
deduplicate: true,
cse: true,
constantOptimizer: true,
yul: true,
yulDetails: {
stackAllocation: true,
},
},
},
},
},
],
},
networks: {
hardhat: {
chainId: 137,
forking: {
url: MAINNET_API_URL,
blockNumber: BLOCK_NUMBER,
},
mining: {
auto: true,
interval: 2000,
},
accounts: {
count: 2,
},
},
matic: {
timeout: 1000000,
chainId: 137,
url: "http://localhost:1248",
gasPrice: GAS_PRICE * 10 ** 9,
},
},
gasReporter: {
enabled: REPORT_GAS !== undefined,
currency: "USD",
},
etherscan: {
apiKey: ETHERSCAN_API_KEY,
},
namedAccounts: {
deployer: {
default: 0, // this will by default take the first account as deployer
},
tester: {
default: 1,
},
},
};
export default config;