-
Notifications
You must be signed in to change notification settings - Fork 8
/
hardhat.config.js
73 lines (68 loc) · 1.59 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
require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-etherscan");
require("dotenv").config();
// Keys
const PRIVATE_KEY = process.env.PRIVATE_KEY;
const RINKEBY_KEY = process.env.RINKEBY_KEY;
const GOERLI_KEY = process.env.GOERLI_KEY;
const MUMBAI_KEY = process.env.GOERLI_KEY;
const POLYGON_KEY = process.env.POLYGON_KEY;
// URLs
const MAINNET_URL = process.env.MAINNET_URL || "";
const RINKEBY_URL = process.env.RINKEBY_URL || "";
const GOERLI_URL = process.env.GOERLI_URL || "";
const MUMBAI_URL = process.env.MUMBAI_URL || "";
const POLYGON_URL = process.env.POLYGON_URL || "";
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: {
version: "0.8.7",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
networks: {
hardhat: {
accounts: [
{
privateKey: PRIVATE_KEY,
balance: "10000000000000000000000000000000",
},
],
},
rinkeby: {
url: `${RINKEBY_URL}`,
accounts: RINKEBY_KEY !== undefined ? [RINKEBY_KEY] : [],
},
goerli: {
url: GOERLI_URL,
accounts: GOERLI_KEY !== undefined ? [GOERLI_KEY] : [],
},
mumbai: {
url: MUMBAI_URL,
accounts: MUMBAI_KEY !== undefined ? [MUMBAI_KEY] : [],
},
polygon: {
url: POLYGON_URL,
accounts: POLYGON_KEY !== undefined ? [POLYGON_KEY] : [],
},
mainnet: {
url: MAINNET_URL,
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
},
},
etherscan: {
// Your API key for Etherscan
// Obtain one at https://etherscan.io/
apiKey: process.env.POLYGONSCAN_API_KEY
},
paths: {
sources: "./src",
cache: "hh-cache",
},
};