-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhardhat.config.js
More file actions
75 lines (74 loc) · 2.07 KB
/
Copy pathhardhat.config.js
File metadata and controls
75 lines (74 loc) · 2.07 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
require("@nomicfoundation/hardhat-toolbox");
require("@openzeppelin/hardhat-upgrades");
require("dotenv").config();
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: {
version: "0.8.27",
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
},
networks: {
hardhat: {
chainId: 31337
},
// Polygon Amoy Testnet (formerly Mumbai replacement)
polygonAmoy: {
url: process.env.POLYGON_AMOY_RPC_URL || "https://rpc-amoy.polygon.technology/",
chainId: 80002,
accounts: process.env.DEPLOYER_PRIVATE_KEY
? [process.env.DEPLOYER_PRIVATE_KEY]
: [],
gasPrice: 35000000000, // 35 Gwei
confirmations: 2,
timeoutBlocks: 200,
skipDryRun: true
},
// Ethereum Sepolia (if you want to also deploy there)
sepolia: {
url: process.env.SEPOLIA_RPC_URL || "https://rpc.sepolia.org",
chainId: 11155111,
accounts: process.env.DEPLOYER_PRIVATE_KEY
? [process.env.DEPLOYER_PRIVATE_KEY]
: [],
},
// Polygon Mainnet (for future production)
polygon: {
url: process.env.POLYGON_RPC_URL || "https://polygon-rpc.com",
chainId: 137,
accounts: process.env.DEPLOYER_PRIVATE_KEY
? [process.env.DEPLOYER_PRIVATE_KEY]
: [],
gasPrice: 100000000000, // 100 Gwei
}
},
etherscan: {
apiKey: {
polygonAmoy: process.env.POLYGONSCAN_API_KEY || "",
polygon: process.env.POLYGONSCAN_API_KEY || "",
sepolia: process.env.ETHERSCAN_API_KEY || ""
},
customChains: [
{
network: "polygonAmoy",
chainId: 80002,
urls: {
apiURL: "https://api-amoy.polygonscan.com/api",
browserURL: "https://amoy.polygonscan.com"
}
}
]
},
// Gas reporter configuration
gasReporter: {
enabled: process.env.REPORT_GAS ? true : false,
currency: "USD",
token: "MATIC",
gasPriceApi: "https://api.polygonscan.com/api?module=proxy&action=eth_gasPrice",
coinmarketcap: process.env.COINMARKETCAP_API_KEY
}
};