-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhardhat.config.js
More file actions
157 lines (152 loc) · 4.89 KB
/
hardhat.config.js
File metadata and controls
157 lines (152 loc) · 4.89 KB
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
153
154
155
156
157
const { ethers } = require("ethers");
require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-etherscan");
require("@nomiclabs/hardhat-solhint");
require("@nomiclabs/hardhat-waffle");
require("solidity-coverage");
require("hardhat-gas-reporter");
require("hardhat-abi-exporter");
require("hardhat-contract-sizer");
require("@nomiclabs/hardhat-ethers");
require("hardhat-tracer");
require("@openzeppelin/hardhat-upgrades");
require("@primitivefi/hardhat-dodoc");
require("dotenv").config();
// Add some .env individual variables
const INFURA_API_KEY = process.env.INFURA_API_KEY;
const ALCHEMY_API_URL = process.env.ALCHEMY_API_URL;
const COINMARKETCAP_API_KEY = process.env.COINMARKETCAP_API_KEY;
const ACC_PRIVATE_KEY = process.env.ACC_PRIVATE_KEY;
const REPORT_GAS = process.env.REPORT_GAS || "true";
const GAS_REPORTER_TOKEN = process.env.GAS_REPORTER_TOKEN || "ETH";
const GAS_PRICE_API = process.env.GAS_PRICE_API;
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY || "";
const BSCSCAN_API_KEY = process.env.BSCSCAN_API_KEY || "";
const POLYGONSCAN_API_KEY = process.env.POLYGONSCAN_API_KEY || "";
// Use AlchemyAPI to make fork if its URL specifyed else use the Infura API;
const FORKING_URL =
ALCHEMY_API_URL || `https://mainnet.infura.io/v3/${INFURA_API_KEY}`;
const BLOCK_NUMBER = 15073606;
module.exports = {
defaultNetwork: "hardhat",
solidity: {
compilers: [
{
version: "0.8.17",
settings: {
optimizer: {
enabled: true,
runs: 999999, // max runs for etherscan
},
},
},
],
},
networks: {
hardhat: {
blockGasLimit: 12450000 * 100,
forking: {
url: FORKING_URL,
// specifing blockNumber available only for AlchemyAPI
blockNumber: ALCHEMY_API_URL ? BLOCK_NUMBER : undefined,
},
},
localhost: {
gasMultiplier: 1.2,
},
mainnet: {
url: `https://mainnet.infura.io/v3/${INFURA_API_KEY}`,
accounts: [ACC_PRIVATE_KEY],
},
kovan: {
url: `https://kovan.infura.io/v3/${INFURA_API_KEY}`,
accounts: [ACC_PRIVATE_KEY],
},
rinkeby: {
url: `https://rinkeby.infura.io/v3/${INFURA_API_KEY}`,
accounts: [ACC_PRIVATE_KEY],
},
goerli: {
url: `https://goerli.infura.io/v3/${INFURA_API_KEY}`,
accounts: [ACC_PRIVATE_KEY],
},
sepolia: {
url: `https://sepolia.infura.io/v3/${INFURA_API_KEY}`,
accounts: [ACC_PRIVATE_KEY],
},
polygon_mainnet: {
url: `https://polygon-bor.publicnode.com`,
accounts: [ACC_PRIVATE_KEY],
gasPrice: 35000000000
},
polygon_testnet: {
url: `https://polygon-mumbai-bor.publicnode.com`,
accounts: [ACC_PRIVATE_KEY],
gasPrice: 35000000000
},
bsc_mainnet: {
url: "https://bsc-dataseed.binance.org/",
accounts: [ACC_PRIVATE_KEY],
},
bsc_testnet: {
url: "https://data-seed-prebsc-1-s1.binance.org:8545",
accounts: [ACC_PRIVATE_KEY],
},
coverage: {
url: "http://127.0.0.1:8555",
},
},
mocha: {
timeout: 20000000,
},
gasReporter: {
enabled: REPORT_GAS === "true" ? true : false,
currency: "USD",
coinmarketcap: COINMARKETCAP_API_KEY,
// The next 2 values are by default configured for Ethereum
// Change them if using another chain
// See https://github.com/cgewecke/hardhat-gas-reporter#token-and-gaspriceapi-options-example
token: GAS_REPORTER_TOKEN,
gasPriceApi: GAS_PRICE_API,
},
abiExporter: {
path: "./build/abis",
runOnCompile: true,
clear: true,
spacing: 2,
pretty: true,
},
contractSizer: {
alphaSort: true,
disambiguatePaths: true,
strict: true,
runOnCompile: true,
},
dodoc: {
include: [],
runOnCompile: false,
freshOutput: true,
outputDir: "./docs/contracts",
},
paths: {
sources: "./contracts/",
tests: "./tests/",
artifacts: "./build/artifacts",
cache: "./build/cache",
deployments: "./build/deployments",
},
// For default hardhat verification
etherscan: {
apiKey: {
mainnet: ETHERSCAN_API_KEY,
kovan: ETHERSCAN_API_KEY,
rinkeby: ETHERSCAN_API_KEY,
goerli: ETHERSCAN_API_KEY,
sepolia: ETHERSCAN_API_KEY,
bsc: BSCSCAN_API_KEY,
bscTestnet: BSCSCAN_API_KEY,
polygon: POLYGONSCAN_API_KEY,
polygonMumbai: POLYGONSCAN_API_KEY,
},
},
};