-
Notifications
You must be signed in to change notification settings - Fork 4
/
truffle-config.js
105 lines (104 loc) · 3.91 KB
/
truffle-config.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
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
102
103
104
105
require('dotenv').config();
const HDWalletProvider = require('@truffle/hdwallet-provider');
const gasLimit = process.env['GAS_LIMIT'];
const gasPrice = process.env['GAS_PRICE'];
const privateKey = process.env['PRIVATE_KEY'];
const ankrProjectId = process.env['ANKR_PROJECT_ID'];
const ankrApikeyBscmain = process.env['ANKR_APIKEY_BSCMAIN'];
const ankrApikeyBsctest = process.env['ANKR_APIKEY_BSCTEST'];
const ankrApikeyMaticmain = process.env['ANKR_APIKEY_MATICMAIN'];
const ankrApikeyMatictest = process.env['ANKR_APIKEY_MATICTEST'];
const infuraProjectId = process.env['INFURA_PROJECT_ID'];
module.exports = {
compilers: {
solc: {
version: '0.6.12',
optimizer: {
enabled: false,
runs: 200,
},
},
},
networks: {
mainnet: {
network_id: 1,
gasPrice,
networkCheckTimeout: 10000, // fixes truffle bug
provider: () => new HDWalletProvider(privateKey, 'wss://mainnet.infura.io/ws/v3/' + infuraProjectId),
skipDryRun: false,
},
ropsten: {
network_id: 3,
networkCheckTimeout: 10000, // fixes truffle bug
provider: () => new HDWalletProvider(privateKey, 'wss://ropsten.infura.io/ws/v3/' + infuraProjectId),
skipDryRun: true,
},
rinkeby: {
network_id: 4,
networkCheckTimeout: 10000, // fixes truffle bug
provider: () => new HDWalletProvider(privateKey, 'wss://rinkeby.infura.io/ws/v3/' + infuraProjectId),
skipDryRun: true,
},
kovan: {
network_id: 42,
networkCheckTimeout: 10000, // fixes truffle bug
provider: () => new HDWalletProvider(privateKey, 'wss://kovan.infura.io/ws/v3/' + infuraProjectId),
skipDryRun: true,
},
goerli: {
network_id: 5,
networkCheckTimeout: 10000, // fixes truffle bug
provider: () => new HDWalletProvider(privateKey, 'wss://goerli.infura.io/ws/v3/' + infuraProjectId),
skipDryRun: true,
},
bscmain: {
network_id: 56,
gasPrice,
networkCheckTimeout: 10000, // fixes truffle bug
provider: () => new HDWalletProvider(privateKey, 'wss://bsc-ws-node.nariox.org:443'),
// provider: () => new HDWalletProvider(privateKey, 'wss://apis.ankr.com/wss/' + ankrApikeyBscmain + '/' + ankrProjectId + '/binance/full/main'),
skipDryRun: false,
},
bsctest: {
network_id: 97,
networkCheckTimeout: 10000, // fixes truffle bug
provider: () => new HDWalletProvider(privateKey, 'wss://apis.ankr.com/wss/' + ankrApikeyBsctest + '/' + ankrProjectId + '/binance/full/test'),
skipDryRun: true,
},
maticmain: {
network_id: 137,
gasPrice,
networkCheckTimeout: 10000, // fixes truffle bug
provider: () => new HDWalletProvider(privateKey, 'wss://ws-matic-mainnet.chainstacklabs.com/'),
// provider: () => new HDWalletProvider(privateKey, 'wss://apis.ankr.com/wss/' + ankrApikeyMaticmain + '/' + ankrProjectId + '/polygon/full/main'),
skipDryRun: false,
},
matictest: {
network_id: 80001,
networkCheckTimeout: 10000, // fixes truffle bug
provider: () => new HDWalletProvider(privateKey, 'wss://ws-matic-mumbai.chainstacklabs.com/'),
// provider: () => new HDWalletProvider(privateKey, 'wss://apis.ankr.com/wss/' + ankrApikeyMatictest + '/' + ankrProjectId + '/polygon/full/test'),
skipDryRun: true,
},
avaxmain: {
network_id: 1, // chain id: 43114
gasPrice,
networkCheckTimeout: 10000, // fixes truffle bug
provider: () => new HDWalletProvider(privateKey, 'https://api.avax.network/ext/bc/C/rpc'),
skipDryRun: false,
},
avaxtest: {
network_id: 1, // chain id: 43113
networkCheckTimeout: 10000, // fixes truffle bug
provider: () => new HDWalletProvider(privateKey, 'https://api.avax-test.network/ext/bc/C/rpc'),
skipDryRun: true,
},
development: {
network_id: '*',
gas: gasLimit,
host: 'localhost',
port: 8545,
skipDryRun: true,
},
},
};