-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
84 lines (79 loc) · 2.02 KB
/
hardhat.config.ts
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
import dotenv from "dotenv";
import glob from "glob";
import path from "path";
import "@nomicfoundation/hardhat-toolbox";
import "@nomiclabs/hardhat-ethers";
import "@nomiclabs/hardhat-solhint";
import "@openzeppelin/hardhat-upgrades";
import "@typechain/hardhat";
import "hardhat-gas-reporter";
import "hardhat-contract-sizer";
import "@graphprotocol/hardhat-graph";
dotenv.config();
/**
* We can't load the task files that require typechain when it hasn't been created yet.
* Otherwise an error will be thrown.
* We use the SKIP_LOAD env var to require it when everything has been created.
* See the logic in the compile script present in package.json to fully understand the logic beneath.
*/
if (!process.env.SKIP_LOAD) {
glob.sync("./tasks/**/*.ts").forEach(function (file) {
require(path.resolve(file));
});
}
const {
POLYGON_MUMBAI_RPC_PROVIDER,
POLYGON_MAINNET_RPC_PROVIDER,
POLYGONSCAN_API_KEY,
COINMARKETCAP_API_KEY,
REPORT_GAS,
DEPLOYER_WALLET_PRIVATE_KEY,
} = process.env;
const config = {
networks: {
mumbai: {
url: POLYGON_MUMBAI_RPC_PROVIDER,
accounts: [DEPLOYER_WALLET_PRIVATE_KEY!],
},
matic: {
url: POLYGON_MAINNET_RPC_PROVIDER,
accounts: [DEPLOYER_WALLET_PRIVATE_KEY!],
},
localhost: {
url: "http://localhost:8545",
},
hardhat: {
// To prevent collision with proxy because admin address = accounts[1] in local deployments
from: "0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199",
allowUnlimitedContractSize: true,
},
},
solidity: {
version: "0.8.16",
settings: {
optimizer: {
enabled: true,
runs: 365,
},
},
},
gasReporter: {
enabled: REPORT_GAS ? true : false,
currency: "USD",
gasPrice: 21,
outputFile: "gas_report.txt",
noColors: true,
token: "MATIC",
coinmarketcap: COINMARKETCAP_API_KEY,
},
etherscan: {
apiKey: POLYGONSCAN_API_KEY,
},
subgraph: {
name: "amplifrens",
},
paths: {
subgraph: "./subgraph",
},
};
export default config;