-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathhardhat.config.ts
128 lines (123 loc) · 3.31 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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import { config as dotEnvConfig } from "dotenv";
dotEnvConfig();
import { HardhatUserConfig } from "hardhat/types";
import "@nomiclabs/hardhat-waffle";
import "@typechain/hardhat";
import "@nomiclabs/hardhat-etherscan";
import "@openzeppelin/hardhat-upgrades";
import "hardhat-deploy";
import "hardhat-deploy-ethers";
import "hardhat-tracer";
import "hardhat-contract-sizer";
import "hardhat-gas-reporter";
import "@solv/v2-hardhat-plugins/ozUpgrade";
import "@solv/v2-hardhat-plugins/gasNowPrice";
import "@solv/v2-hardhat-plugins/otherDeployments";
import "hardhat-gas-reporter";
import "solidity-coverage";
import "hardhat-log-remover";
const DEPLOYER_PRIVATE_KEY =
process.env.RINKEBY_PRIVATE_KEY! ||
"0000000000000000000000000000000000000000000000000000000000000000";
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY || "";
const COINMARKETCAP_API_KEY = process.env.COINMARKETCAP_API_KEY || "";
const config: HardhatUserConfig = {
defaultNetwork: "hardhat",
solidity: {
compilers: [
{
version: "0.7.6",
settings: {
optimizer: {
enabled: true,
runs: 1,
},
},
},
],
},
namedAccounts: {
deployer: 0,
},
networks: {
hardhat: {},
localhost: {},
development: {
url: `http://47.88.20.217:8545`,
accounts: [DEPLOYER_PRIVATE_KEY],
},
testnet: {
url: `http://47.88.20.217:8545`,
accounts: [DEPLOYER_PRIVATE_KEY],
},
labs: {
url: `http://47.88.20.217:8545`,
accounts: [DEPLOYER_PRIVATE_KEY],
},
mainnet: {
url: `http://172.21.121.12:8545`,
accounts: [DEPLOYER_PRIVATE_KEY],
},
bsctest: {
url: `https://data-seed-prebsc-1-s1.binance.org:8545`,
accounts: [DEPLOYER_PRIVATE_KEY],
live: true,
saveDeployments: true,
},
bscstage: {
url: "https://bsc-dataseed.binance.org/",
chainId: 56,
accounts: [DEPLOYER_PRIVATE_KEY],
live: true,
saveDeployments: true,
},
bsc: {
url: "https://bsc-dataseed.binance.org/",
chainId: 56,
accounts: [DEPLOYER_PRIVATE_KEY],
live: true,
saveDeployments: true,
},
mumbai: {
url: "https://rpc-mumbai.maticvigil.com",
accounts: [DEPLOYER_PRIVATE_KEY],
},
polygon: {
url: "https://rpc-mainnet.maticvigil.com",
accounts: [DEPLOYER_PRIVATE_KEY],
},
coverage: {
url: "http://127.0.0.1:8555", // Coverage launches its own ganache-cli client
},
},
paths: {
sources: "./contracts",
tests: "./test",
cache: "./cache",
artifacts: "./artifacts",
},
mocha: {
timeout: 2000000,
},
etherscan: {
// Your API key for Etherscan
// Obtain one at https://etherscan.io/
apiKey: ETHERSCAN_API_KEY,
},
gasReporter: {
currency: "USD",
gasPrice: 40,
coinmarketcap: COINMARKETCAP_API_KEY,
},
external: process.env.HARDHAT_FORK
? {
deployments: {
// process.env.HARDHAT_FORK will specify the network that the fork is made from.
// these lines allow it to fetch the deployments from the network being forked from both for node and deploy task
hardhat: ["deployments/" + process.env.HARDHAT_FORK],
localhost: ["deployments/" + process.env.HARDHAT_FORK],
},
}
: undefined,
};
export default config;