-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhardhat.config.cjs
More file actions
34 lines (31 loc) · 1.04 KB
/
Copy pathhardhat.config.cjs
File metadata and controls
34 lines (31 loc) · 1.04 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
require("@nomicfoundation/hardhat-toolbox");
require("dotenv").config();
let myPrivateKey = process.env.PRIVATE_KEY || "";
if (myPrivateKey && !myPrivateKey.startsWith("0x")) {
myPrivateKey = "0x" + myPrivateKey;
}
myPrivateKey = myPrivateKey.trim();
console.log("=========================================");
console.log("🟢 Config Check: Private Key loaded!");
console.log("🟢 Config Check: Connecting to BSC Node 2...");
console.log("=========================================\n");
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: {
version: "0.8.20",
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
},
networks: {
bscTestnet: {
url: "https://data-seed-prebsc-2-s1.binance.org:8545", // Backup Binance Node
chainId: 97,
accounts: myPrivateKey.length === 66 ? [myPrivateKey] : [],
timeout: 120000 // Force it to wait up to 2 minutes for a response
}
}
};