forked from pooltogether/loot-box
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buidler.networks.js
67 lines (59 loc) · 1.55 KB
/
buidler.networks.js
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
const ethers = require('ethers')
const networks = {
buidlerevm: {
blockGasLimit: 200000000,
allowUnlimitedContractSize: true,
chainId: 31337
},
coverage: {
url: 'http://127.0.0.1:8555',
blockGasLimit: 200000000,
allowUnlimitedContractSize: true
},
localhost: {
url: 'http://127.0.0.1:8545',
blockGasLimit: 200000000,
allowUnlimitedContractSize: true,
chainId: 31337
}
}
if (process.env.USE_BUIDLER_EVM_ACCOUNTS) {
networks.buidlerevm.accounts = process.env.USE_BUIDLER_EVM_ACCOUNTS.split(/\s+/).map(privateKey => ({
privateKey,
balance: ethers.utils.parseEther('10000000').toHexString()
}))
}
if (process.env.HDWALLET_MNEMONIC) {
networks.fork = {
url: 'http://127.0.0.1:8545'
}
}
if (process.env.INFURA_API_KEY && process.env.HDWALLET_MNEMONIC) {
networks.kovan = {
url: `https://kovan.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: {
mnemonic: process.env.HDWALLET_MNEMONIC
}
}
networks.ropsten = {
url: `https://ropsten.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: {
mnemonic: process.env.HDWALLET_MNEMONIC
}
}
networks.rinkeby = {
url: `https://rinkeby.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: {
mnemonic: process.env.HDWALLET_MNEMONIC
}
}
networks.mainnet = {
url: `https://mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: {
mnemonic: process.env.HDWALLET_MNEMONIC
}
}
} else {
console.warn('No infura or hdwallet available for testnets')
}
module.exports = networks