-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhardhat.config.js
97 lines (89 loc) · 2.63 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
const {requirePath} = require("require-or-mock");
const path = require("path");
const fs = require("fs");
// if missed, it sets up a mock
requirePath(
".env",
`INFURA_API_KEY=f3fe188888888c249d91c2224c27b784
FOR_TESTNET=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
FOR_MAINNET=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
BNB_MAINNET=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
`
);
requirePath("export/deployed.json", "{}");
require("dotenv").config();
require("@secrez/cryptoenv").parse(() => process.env.NODE_ENV !== "test");
require("@nomiclabs/hardhat-waffle");
require("@nomiclabs/hardhat-etherscan");
require("@openzeppelin/hardhat-upgrades");
require("hardhat-contract-sizer");
require("solidity-coverage");
// if (fs.existsSync(path.resolve(__dirname, "../../NPM/hardhat-sourcify"))) {
// // I made a PR to hardhat-sourcify to make it work with pnpm
// // While we wait for a merge and an update, this is a workaround
// require("../../NPM/hardhat-sourcify");
// }
if (process.env.GAS_REPORT === "yes") {
require("hardhat-gas-reporter");
}
// 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
*/
module.exports = {
solidity: {
version: "0.8.17",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
networks: {
hardhat: {
blockGasLimit: 10000000,
},
localhost: {
url: "http://localhost:8545",
chainId: 1337,
},
ethereum: {
url: `https://mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: [process.env.FOR_MAINNET],
chainId: 1,
},
goerli: {
url: `https://goerli.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: [process.env.FOR_TESTNET],
chainId: 5,
},
fuji: {
url: "https://api.avax-test.network/ext/bc/C/rpc",
gasPrice: 225000000000,
chainId: 43113,
accounts: [process.env.FOR_TESTNET],
},
alfajores: {
url: "https://alfajores-forno.celo-testnet.org",
accounts: [process.env.FOR_TESTNET],
chainId: 44787,
},
},
etherscan: {
apiKey: process.env.BSCSCAN_KEY,
},
gasReporter: {
currency: "USD",
// coinmarketcap: env.coinMarketCapAPIKey
},
};