-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.js
104 lines (100 loc) · 2.58 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
require("hardhat-spdx-license-identifier");
require("@tenderly/hardhat-tenderly"); // https://hardhat.org/plugins/tenderly-hardhat-tenderly.html
require("solidity-coverage");
require("@openzeppelin/hardhat-upgrades");
require("hardhat-deploy");
require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-etherscan");
require("@nomiclabs/hardhat-waffle");
require("hardhat-docgen");
require("hardhat-gas-reporter");
let config;
try {
config = require("./secretsManager.js");
} catch (e) {
console.error(
"You are using the example secrets manager, please copy this file if you want to use it"
);
config = require("./secretsManager.example.js");
}
const {
mnemonic,
arrayPvtKeys,
etherscanApiKey,
polygonscanApiKey,
mumbaiProviderUrl,
polygonProviderUrl,
} = config;
let runCoverage =
!process.env.DONT_RUN_REPORT_SUMMARY ||
process.env.DONT_RUN_REPORT_SUMMARY.toUpperCase() != "TRUE";
if (runCoverage) {
require("hardhat-abi-exporter");
// require("hardhat-gas-reporter");
}
module.exports = {
// This is a sample solc configuration that specifies which version of solc to use
solidity: {
version: "0.8.3",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
defaultNetwork: "hardhat",
networks: {
ganache: {
url: "http://localhost:8545",
},
polygon: {
chainId: 137,
// "https://matic-mainnet-full-rpc.bwarelabs.com/",
// "https://rpc-mainnet.matic.network",
// "https://matic-mainnet.chainstacklabs.com",
url: polygonProviderUrl || "https://polygon-rpc.com/",
accounts: { mnemonic },
gasPrice: 60000000000, // 60 gwei
// gas: 10000000, // <- defaults to 'auto'
},
mumbai: {
chainId: 80001,
url: mumbaiProviderUrl || "https://rpc-mumbai.maticvigil.com/v1",
accounts: { mnemonic },
gasPrice: 3000000000, // 3 gwei
// gas: 15000000,
},
},
paths: {},
namedAccounts: {
deployer: 0,
admin: 1,
user1: 2,
user2: 3,
user3: 4,
user4: 5,
},
gasReporter: {
// Disabled by default for faster running of tests
enabled: true,
currency: "USD",
gasPrice: 80,
coinmarketcap: "9aacee3e-7c04-4978-8f93-63198c0fbfef",
},
spdxLicenseIdentifier: {
// Set these to true if you ever want to change the licence on all of the contracts (by changing it in package.json)
overwrite: false,
runOnCompile: false,
},
abiExporter: {
path: "./abis",
clear: true,
flat: true,
// only: [":NFT721$"],
spacing: 2,
},
etherscan: {
apiKey: polygonscanApiKey,
},
};