-
Notifications
You must be signed in to change notification settings - Fork 11
/
hardhat.network.ts
60 lines (57 loc) · 1.23 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
import { HardhatUserConfig } from 'hardhat/config';
const mnemonic = process.env.HDWALLET_MNEMONIC;
const networks: HardhatUserConfig['networks'] = {
localhost: {
url: 'http://127.0.0.1:8545',
},
hardhat: {
allowUnlimitedContractSize: true,
gas: 12000000,
blockGasLimit: 0x1fffffffffffff,
accounts: {
mnemonic,
},
},
mainnet: {
chainId: 1,
timeout: 1200000, // 20 minute timeout in ms
url: process.env.MAINNET_RPC_URL,
accounts: {
mnemonic,
},
},
polygon: {
chainId: 137,
url: process.env.POLYGON_RPC_URL,
accounts: {
mnemonic,
},
},
avalanche: {
chainId: 43114,
url: process.env.AVALANCHE_RPC_URL,
blockGasLimit: 100000000000000,
accounts: {
mnemonic,
},
},
optimism: {
chainId: 10,
url: process.env.OPTIMISM_RPC_URL,
accounts: {
mnemonic,
},
},
};
if (!!process.env.FORK_ENABLED) {
networks.hardhat = {
chainId: parseInt(process.env.FORK_CHAIN_ID || '1'),
...networks.hardhat,
};
networks.hardhat.forking = {
enabled: !!process.env.FORK_ENABLED,
url: process.env.FORK_RPC_URL || '',
blockNumber: parseInt(process.env.FORK_BLOCK_NUMBER || '1'),
};
}
export default networks;