-
Notifications
You must be signed in to change notification settings - Fork 2
/
hardhat.networks.ts
101 lines (88 loc) · 1.99 KB
/
hardhat.networks.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
import * as dotenv from "dotenv";
import { NetworksUserConfig } from "hardhat/types";
import "solidity-coverage";
dotenv.config();
// require("dotenv").config({ path: require("find-config")("./.env") });
const FORK_BLOCK_NUMBER: number | undefined = process.env.FORK_BLOCK_NUMBER ? parseInt(process.env.FORK_BLOCK_NUMBER) : 12406069;
export const networks: NetworksUserConfig = {
coverage: {
url: "http://127.0.0.1:8555",
chainId: 1, // tbd
blockGasLimit: 200000000,
allowUnlimitedContractSize: true,
},
localhost: {
chainId: 1,
url: "http://127.0.0.1:8545",
allowUnlimitedContractSize: true,
},
ropsten: {
chainId: 3,
url: `https://ropsten.infura.io/v3/${process.env.INFURA_KEY}`,
accounts: {
mnemonic: process.env.MNEMONIC,
},
allowUnlimitedContractSize: true,
},
kovan: {
chainId: 42,
url: `https://kovan.infura.io/v3/${process.env.INFURA_KEY}`,
blockGasLimit: 200000000,
accounts: {
mnemonic: process.env.MNEMONIC,
},
},
rinkeby: {
chainId: 4,
url: `https://rinkeby.infura.io/v3/${process.env.INFURA_KEY}`,
blockGasLimit: 200000000,
accounts: {
mnemonic: process.env.MNEMONIC,
},
},
mainnet: {
chainId: 1,
// url: process.env.ALCHEMY_URL,
url: `https://mainnet.infura.io/v3/${process.env.INFURA_KEY}`,
accounts: {
mnemonic: process.env.MNEMONIC,
},
},
matic: {
chainId: 137,
url: process.env.MATIC_MAINNET_URL,
accounts: {
mnemonic: process.env.MNEMONIC,
},
},
matic_mumbai: {
chainId: 80001,
url: process.env.MATIC_MUMBAI_URL,
accounts: {
mnemonic: process.env.MNEMONIC,
},
},
arbitrum_testnet: {
chainId: 421611,
url: process.env.ARBITRUM_TESTNET_URL,
accounts: {
mnemonic: process.env.MNEMONIC,
},
},
};
if (process.env.ALCHEMY_URL) {
networks.hardhat = {
chainId: 1,
forking: {
url: process.env.ALCHEMY_URL,
blockNumber: FORK_BLOCK_NUMBER,
},
// accounts: {
// mnemonic: process.env.MNEMONIC
// }
};
} else {
networks.hardhat = {
allowUnlimitedContractSize: true,
};
}