-
Notifications
You must be signed in to change notification settings - Fork 4
/
hardhat.config.js
113 lines (107 loc) · 2.65 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
// hardhat.config.js
require("dotenv/config")
require("@nomiclabs/hardhat-etherscan")
require("@nomiclabs/hardhat-solhint")
// require("@nomiclabs/hardhat-solpp")
require("@tenderly/hardhat-tenderly")
require("@nomiclabs/hardhat-waffle")
require("hardhat-abi-exporter")
require("hardhat-deploy")
require("hardhat-deploy-ethers")
require("hardhat-gas-reporter")
require("hardhat-spdx-license-identifier")
require("hardhat-watcher")
require("solidity-coverage")
const { task } = require("hardhat/config")
// 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 (args, hre) => {
const accounts = await hre.ethers.getSigners()
for (const account of accounts) {
console.log(account.address)
}
})
const { removeConsoleLog } = require("hardhat-preprocessor")
const accounts = {
mnemonic: process.env.MNEMONIC || "test test test test test test test test test test test junk",
accountsBalance: "990000000000000000000",
}
module.exports = {
abiExporter: {
path: "./build/abi",
//clear: true,
flat: true,
// only: [],
// except: []
},
defaultNetwork: "hardhat",
etherscan: {
// Obtain one at https://bscscan.com/
apiKey: process.env.BSCSCAN_API_KEY,
},
gasReporter: {
enabled: process.env.REPORT_GAS ? true : false,
currency: "USD",
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
excludeContracts: ["contracts/mocks/", "contracts/libraries/"],
},
networks: {
mainnet: {
url: `https://bsc-dataseed.binance.org`,
accounts,
gasPrice: 120 * 1000000000,
chainId: 56,
},
hardhat: {
chainId: 31337,
accounts,
},
testnet: {
url: `https://data-seed-prebsc-1-s1.binance.org:8545`,
accounts,
chainId: 97,
live: true,
saveDeployments: true,
},
},
preprocess: {
eachLine: removeConsoleLog((bre) => bre.network.name !== "hardhat" && bre.network.name !== "localhost"),
},
solidity: {
compilers: [
{
version: "0.5.0",
settings: {
optimizer: {
enabled: true,
runs: 5000,
},
},
},
{
version: "0.6.12",
settings: {
optimizer: {
enabled: true,
runs: 5000,
},
},
},
],
},
spdxLicenseIdentifier: {
overwrite: false,
runOnCompile: true,
},
tenderly: {
project: process.env.TENDERLY_PROJECT,
username: process.env.TENDERLY_USERNAME,
},
watcher: {
compile: {
tasks: ["compile"],
files: ["./contracts"],
verbose: true,
},
},
}