forked from Azuro-protocol/Azuro-v2-public
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.js
139 lines (126 loc) · 3.32 KB
/
hardhat.config.js
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
require("@nomicfoundation/hardhat-chai-matchers");
require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-etherscan");
require("@nomiclabs/hardhat-ganache");
require("@openzeppelin/hardhat-upgrades");
require("@openzeppelin/hardhat-defender");
require("hardhat-change-network");
require("hardhat-contract-sizer");
require("hardhat-docgen");
require("hardhat-gas-reporter");
require("solidity-coverage");
require("dotenv").config();
const GNOSIS_RPC = process.env.GNOSIS_RPC || "";
const GNOSIS_PRIVATE_KEY = process.env.GNOSIS_PRIVATE_KEY || "";
const GNOSISSCAN_API_KEY = process.env.GNOSISSCAN_API_KEY || "";
const POLYGON_PRIVATE_KEY = process.env.POLYGON_PRIVATE_KEY || "";
const MUMBAI_PRIVATE_KEY = process.env.MUMBAI_PRIVATE_KEY || "";
const POLYGONSCAN_API_KEY = process.env.POLYGONSCAN_API_KEY || "";
const DEFENDER_TEAM_API_KEY = process.env.DEFENDER_TEAM_API_KEY || "";
const DEFENDER_TEAM_API_SECRET_KEY = process.env.DEFENDER_TEAM_API_SECRET_KEY || "";
// This is a sample Hardhat task. To learn how to create your own go to
// https://hardhat.org/guides/create-task.html
task("accounts", "Prints the list of accounts", async () => {
const accounts = await ethers.getSigners();
for (const account of accounts) {
console.log(account.address);
}
});
// You need to export an object to set up your config
// Go to https://hardhat.org/config/ to learn more
/**
* @type import('hardhat/config').HardhatUserConfig
*/
const exportNetworks = {
hardhat: {
accounts: {
accountsBalance: "1000000000000000000000000000000000",
},
forking: {
enabled: process.env.FORKING === "YES",
url: GNOSIS_RPC,
live: false,
},
},
};
if (GNOSIS_PRIVATE_KEY != "") {
exportNetworks["gnosis"] = {
url: GNOSIS_RPC,
accounts: [`${GNOSIS_PRIVATE_KEY}`],
};
}
if (MUMBAI_PRIVATE_KEY != "") {
exportNetworks["mumbai"] = {
url: "https://polygon-testnet-rpc.allthatnode.com:8545",
accounts: [`${MUMBAI_PRIVATE_KEY}`],
};
}
if (POLYGON_PRIVATE_KEY != "") {
exportNetworks["polygon"] = {
url: "https://polygon.llamarpc.com",
accounts: [`${POLYGON_PRIVATE_KEY}`],
};
}
module.exports = {
solidity: {
compilers: [
{
version: "0.8.16",
settings: {
optimizer: {
enabled: true,
runs: 2,
},
},
},
],
},
defaultNetwork: "hardhat",
networks: exportNetworks,
defender: {
apiKey: DEFENDER_TEAM_API_KEY,
apiSecret: DEFENDER_TEAM_API_SECRET_KEY,
},
etherscan: {
apiKey: {
gnosis: GNOSISSCAN_API_KEY,
mumbai: POLYGONSCAN_API_KEY,
polygon: POLYGONSCAN_API_KEY,
},
customChains: [
{
network: "gnosis",
chainId: 100,
urls: {
apiURL: "https://api.gnosisscan.io/api",
browserURL: "https://gnosisscan.io/",
},
},
{
network: "mumbai",
chainId: 80001,
urls: {
apiURL: "https://api-testnet.polygonscan.com/api",
browserURL: "https://mumbai.polygonscan.com",
},
},
],
},
contractSizer: {
alphaSort: true,
runOnCompile: true,
disambiguatePaths: false,
},
gasReporter: {
enabled: true,
currency: "USD",
},
docgen: {
path: "./docs",
clear: true,
runOnCompile: true,
},
mocha: {
timeout: 100000000,
},
};