-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhardhat.config.js
More file actions
57 lines (52 loc) · 1.22 KB
/
Copy pathhardhat.config.js
File metadata and controls
57 lines (52 loc) · 1.22 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
require("@nomiclabs/hardhat-ethers");
require("@nomicfoundation/hardhat-toolbox");
require("@nomicfoundation/hardhat-chai-matchers");
require("dotenv").config();
/** @type import('hardhat/config').HardhatUserConfig */
const MUMBAI_PRIVATE_KEY = process.env.MUMBAI_PRIVATE_KEY || "";
const POLYGONSCAN_API_KEY = process.env.POLYGONSCAN_API_KEY || "";
const exportNetworks = {
hardhat: {
accounts: {
accountsBalance: "1000000000000000000000000000000000",
}
},
};
if (MUMBAI_PRIVATE_KEY != "") {
exportNetworks["mumbai"] = {
url: "https://polygon-testnet-rpc.allthatnode.com:8545",
accounts: [`${MUMBAI_PRIVATE_KEY}`],
};
}
module.exports = {
solidity: {
compilers: [
{
version: "0.8.9",
settings: {
optimizer: {
enabled: true,
runs: 2,
},
},
},
],
},
defaultNetwork: "hardhat",
networks: exportNetworks,
etherscan: {
apiKey: {
mumbai: POLYGONSCAN_API_KEY,
},
customChains: [
{
network: "mumbai",
chainId: 80001,
urls: {
apiURL: "https://api-testnet.polygonscan.com/api",
browserURL: "https://mumbai.polygonscan.com",
},
},
],
},
};