-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathhardhat.config.ts
96 lines (90 loc) · 2.15 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
import { resolve } from "path";
require("dotenv").config();
import { HardhatUserConfig } from "hardhat/config";
import { NetworkUserConfig } from "hardhat/types";
import "@nomiclabs/hardhat-waffle";
import "@nomiclabs/hardhat-etherscan";
import "@nomiclabs/hardhat-truffle5";
import "@openzeppelin/hardhat-upgrades";
import "hardhat-typechain";
import "solidity-coverage";
import "hardhat-contract-sizer";
//if (!process.env.MNEMONICS) throw new Error("MNEMONICS missing from .env file");
if (!process.env.MUMBAI_PRIVKEY)
throw new Error("RINKEBY_PRIVKEY missing from .env file");
if (!process.env.MAINNET_PRIVKEY)
throw new Error("MAINNET_PRIVKEY missing from .env file");
//const mnemonics = process.env.MNEMONICS;
const config = {
defaultNetwork: "hardhat",
networks: {
mumbai: {
chainId: 80001,
url: `https://polygon-mumbai.g.alchemy.com/v2/${process.env.ALCHEMY_KEY}`,
accounts: [process.env.MUMBAI_PRIVKEY],
},
matic: {
chainId: 137,
url: "https://polygon-rpc.com",
accounts: [process.env.MAINNET_PRIVKEY],
gasPrice: 20e10,
},
bsctest: {
accounts: [process.env.MUMBAI_PRIVKEY || ""],
chainId: 97,
url: "https://data-seed-prebsc-1-s1.binance.org:8545",
timeout: 99999,
gasPrice: 20e9,
gas: 35e5,
},
bsc: {
accounts: [process.env.MAINNET_PRIVKEY || ""],
chainId: 56,
url: "https://bsc-dataseed1.ninicoin.io/",
timeout: 999999,
gasPrice: 20e9,
gas: 35e5,
},
},
etherscan: {
apiKey: process.env.POLYSCAN_API
},
paths: {
artifacts: "./artifacts",
cache: "./cache",
sources: "./contracts",
tests: "./tests",
},
solidity: {
compilers: [
{
version: "0.6.6",
},
{
version: "0.6.12",
},
{
version: "0.7.4",
settings: {},
},
{
version: "0.8.0",
settings: {},
},
],
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
mocha: {
timeout: 2000000000,
},
typechain: {
outDir: "types/contracts",
target: "truffle-v5",
}
};
export default config;