-
Notifications
You must be signed in to change notification settings - Fork 3
/
hardhat.config.js
103 lines (100 loc) · 3.2 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
require("@nomicfoundation/hardhat-toolbox");
require("hardhat-deploy");
// require('@nomiclabs/hardhat-waffle');
require("solidity-coverage");
require("hardhat-contract-sizer");
require("hardhat-gas-reporter");
require("@nomiclabs/hardhat-solhint");
require("@nomiclabs/hardhat-ethers");
require("dotenv").config();
// require('@nomiclabs/hardhat-etherscan');
// Replace this private key with your Goerli account private key
// To export your private key from Metamask, open Metamask and
// go to Account Details > Export Private Key
// Beware: NEVER put real Ether into testing accounts
// FROM @levblanc
// All three keys set in .env file, see .env.example
// .env file should be kept in your local and NEVER push to Github
// everyone should have their own .env file
const { ETHERSCAN_API_KEY, GOERLI_RPC_URL, PRIVATE_KEY } = process.env;
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: {
compilers: [
{
version: "0.8.10",
settings: {
optimizer: {
enabled: true,
runs: 1000000
}
}
}
]
},
defaultNetwork: "hardhat",
networks: {
hardhat: {
chainId: 31337,
blockConfirmations: 1
},
localhost: {
chainId: 31337,
blockConfirmations: 1,
url: "http://127.0.0.1:8545"
},
// mumbai: {
// url: "https://rpc.ankr.com/polygon_mumbai",
// chainId: 80001,
// accounts: [process.env.PRIVATE_KEY1, process.env.PRIVATE_KEY2]
// },
goerli: {
chainId: 5,
blockConfirmations: 6,
url: GOERLI_RPC_URL,
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : []
// FROM @levblanc: Put this into .env file, see .env.example
// url:
// 'https://eth-goerli.g.alchemy.com/v2/96b-b2u2vjIAiGGs4wX7n8Ac395pwsr4',
}
},
namedAccounts: {
deployer: {
default: 0
}
},
etherscan: {
// FROM @levblanc: Put this into .env file, see .env.example
// apiKey: 'G2NTBE18UF2M446DS5VV9AEFFSCXIKNV65',
apiKey: ETHERSCAN_API_KEY,
// FROM @levblanc: This config is for those who have a hard time on
// getting thru Etherscan's HTTPS API URL
customChains: [
{
network: "goerli",
chainId: 5,
urls: {
apiURL: "http://api-goerli.etherscan.io/api",
browserURL: "https://goerli.etherscan.io"
}
}
]
},
contractSizer: {
alphaSort: false,
disambiguatePaths: false,
runOnCompile: false,
strict: true
},
gasReporter: {
enabled: true,
currency: "USD",
outputFile: "gas-report.txt",
coinmarketcap: process.env.COINMARKETCAP_APIKEY,
token: "MATIC",
gasPriceApi: `https://api.polygonscan.com/api?module=proxy&action=eth_gasPrice&apiKey=${process.env.POLYGONSCAN_APIKEY}`
}
// mocha: {
// timeout: 100000000,
// },
};