-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhardhat.config.js
More file actions
129 lines (125 loc) · 3.67 KB
/
Copy pathhardhat.config.js
File metadata and controls
129 lines (125 loc) · 3.67 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
require("@nomicfoundation/hardhat-toolbox")
require("./tasks")
require("dotenv").config()
require('hardhat-contract-sizer')
const MAINNET_RPC_URL = process.env.ALCHEMY_MAINNET_RPC_URL
const MUMBAI_RPC_URL =
process.env.MUMBAI_RPC_URL ||
"https://not-loaded!"
const POLYGON_MAINNET_RPC_URL =
process.env.POLYGON_MAINNET_RPC_URL || "https://polygon-mainnet.alchemyapi.io/v2/your-api-key"
const GOERLI_RPC_URL =
process.env.GOERLI_RPC_URL || "https://eth-goerli.alchemyapi.io/v2/your-api-key"
const PRIVATE_KEYS = [process.env.PRIVATE_KEY1,
process.env.PRIVATE_KEY2,
process.env.PRIVATE_KEY3,
process.env.PRIVATE_KEY4,
process.env.PRIVATE_KEY5,
process.env.PRIVATE_KEY6]
// optional
const MNEMONIC = process.env.MNEMONIC || "Your mnemonic"
const FORKING_BLOCK_NUMBER = process.env.FORKING_BLOCK_NUMBER
// Your API key for Etherscan, obtain one at https://etherscan.io/
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY || "Your etherscan API key"
const POLYGONSCAN_API_KEY = process.env.POLYGONSCAN_API_KEY || "Your polygonscan API key"
const REPORT_GAS = process.env.REPORT_GAS || false
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: {
compilers: [
{
version: "0.8.10",
},
{
version: "0.8.7",
},
{
version: "0.7.0",
},
{
version: "0.6.12",
},
{
version: "0.6.6",
},
{
version: "0.4.24",
},
],
},
defaultNetwork: "hardhat",
networks: {
hardhat: {
chainId: 31337,
forking: {
url: MAINNET_RPC_URL,
},
},
localhost: {
chainId: 31337,
},
polygonMumbai: {
//url: MUMBAI_RPC_URL,
url: "https://rpc-mumbai.maticvigil.com",
accounts: PRIVATE_KEYS !== undefined ? PRIVATE_KEYS : [],
chainId: 80001,
//blockConfirmations: 6,
},
goerli: {
url: GOERLI_RPC_URL,
accounts: PRIVATE_KEYS !== undefined ? PRIVATE_KEYS : [],
// accounts: {
// mnemonic: MNEMONIC,
// },
chainId: 5,
},
mainnet: {
url: MAINNET_RPC_URL,
accounts: PRIVATE_KEYS !== undefined ? PRIVATE_KEYS : [],
// accounts: {
// mnemonic: MNEMONIC,
// },
chainId: 1,
},
polygon: {
url: POLYGON_MAINNET_RPC_URL,
accounts: PRIVATE_KEYS !== undefined ? PRIVATE_KEYS : [],
chainId: 137,
}
},
defaultNetwork: "hardhat",
etherscan: {
// yarn hardhat verify --network <NETWORK> <CONTRACT_ADDRESS> <CONSTRUCTOR_PARAMETERS>
apiKey: {
polygonMumbai: POLYGONSCAN_API_KEY,
polygon: POLYGONSCAN_API_KEY,
goerli: ETHERSCAN_API_KEY,
},
},
gasReporter: {
enabled: REPORT_GAS,
currency: "USD",
outputFile: "gas-report.txt",
noColors: true,
// coinmarketcap: process.env.COINMARKETCAP_API_KEY,
},
contractSizer: {
runOnCompile: false,
// only: [
// "APIConsumer",
// "AutomationCounter",
// "NFTFloorPriceConsumerV3",
// "PriceConsumerV3",
// "RandomNumberConsumerV2",
// ],
},
mocha: {
timeout: 200000, // 200 seconds max for running tests
},
settings: {
optimizer: {
enabled: true,
runs: 200
}
},
}