generated from pooltogether/pooltogether-contracts-template
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathhardhat.network.ts
96 lines (87 loc) · 2.12 KB
/
hardhat.network.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 { HardhatUserConfig } from 'hardhat/config';
import { FORK_START_BLOCK_NUMBER } from './Constants';
const alchemyUrl = process.env.ALCHEMY_URL;
const infuraApiKey = process.env.INFURA_API_KEY;
const mnemonic = process.env.HDWALLET_MNEMONIC;
const networks: HardhatUserConfig['networks'] = {
coverage: {
url: 'http://127.0.0.1:8555',
blockGasLimit: 200000000,
allowUnlimitedContractSize: true,
},
localhost: {
chainId: 1,
url: 'http://127.0.0.1:8545',
allowUnlimitedContractSize: true,
},
};
if (alchemyUrl && Boolean(process.env.FORK_ENABLED) && mnemonic) {
networks.hardhat = {
allowUnlimitedContractSize: true,
chainId: 1,
forking: {
url: alchemyUrl,
blockNumber: FORK_START_BLOCK_NUMBER,
},
accounts: {
mnemonic,
},
};
} else {
networks.hardhat = {
allowUnlimitedContractSize: true,
};
}
if (mnemonic) {
networks.xdai = {
chainId: 100,
url: 'https://rpc.xdaichain.com/',
accounts: {
mnemonic,
},
};
networks.poaSokol = {
chainId: 77,
url: 'https://sokol.poa.network',
accounts: {
mnemonic,
},
};
networks.matic = {
chainId: 137,
url: 'https://rpc-mainnet.maticvigil.com',
accounts: {
mnemonic,
},
};
networks.mumbai = {
chainId: 80001,
url: 'https://rpc-mumbai.maticvigil.com',
accounts: {
mnemonic,
},
};
}
if (infuraApiKey && mnemonic) {
networks.kovan = {
url: `https://kovan.infura.io/v3/${infuraApiKey}`,
accounts: {
mnemonic,
},
};
networks.ropsten = {
url: `https://ropsten.infura.io/v3/${infuraApiKey}`,
accounts: {
mnemonic,
},
};
networks.rinkeby = {
url: `https://rinkeby.infura.io/v3/${infuraApiKey}`,
accounts: {
mnemonic,
},
};
} else {
console.warn('No infura or hdwallet available for testnets');
}
export default networks;