-
Notifications
You must be signed in to change notification settings - Fork 6
/
truffle-config.js
116 lines (113 loc) · 3.35 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
106
107
108
109
110
111
112
113
114
115
116
const path = require("path");
const HDWalletProvider = require("truffle-hdwallet-provider");
require('dotenv').config();
const GAS = 3000000;
const GASPRICE = 5;
const SKIP_DRY_RUN = false;
module.exports = {
contracts_build_directory: path.join(__dirname, "client/src/contracts"),
networks: {
ropsten: {
provider: function() {
return new HDWalletProvider(process.env.PRIVATEKEY, "https://ropsten.infura.io/v3/" + process.env.INFURAKEY)
},
network_id: 3,
gas: GAS,
gasPrice: 1000000000 * GASPRICE,
skipDryRun: SKIP_DRY_RUN
},
kovan: {
provider: function() {
return new HDWalletProvider(process.env.PRIVATEKEY, "https://kovan.infura.io/v3/" + process.env.INFURAKEY)
},
network_id: 42,
gas: GAS,
gasPrice: 1000000000 * GASPRICE,
skipDryRun: SKIP_DRY_RUN
},
rinkeby: {
provider: function() {
return new HDWalletProvider(process.env.PRIVATEKEY, "https://rinkeby.infura.io/v3/" + process.env.INFURAKEY)
},
network_id: 4,
gas: GAS,
gasPrice: 1000000000 * GASPRICE,
skipDryRun: SKIP_DRY_RUN
},
goerli: {
provider: function() {
return new HDWalletProvider(process.env.PRIVATEKEY, "https://goerli.infura.io/v3/" + process.env.INFURAKEY)
},
network_id: 5,
gas: GAS,
gasPrice: 1000000000 * GASPRICE,
skipDryRun: SKIP_DRY_RUN
},
main: {
provider: function() {
return new HDWalletProvider(process.env.PRIVATEKEY, "https://mainnet.infura.io/v3/" + process.env.INFURAKEY)
},
network_id: 1,
gas: GAS,
gasPrice: 1000000000 * GASPRICE
},
development: {
host: '127.0.0.1',
port: 7545,
network_id: '*'
},
// Binance Smart Chain
bsc: {
provider: function() {
return new HDWalletProvider(process.env.PRIVATEKEY, 'https://bsc-dataseed.binance.org/')
},
network_id: 56,
kipDryRun: SKIP_DRY_RUN
},
bsc_test: {
provider: function() {
return new HDWalletProvider(process.env.PRIVATEKEY, 'https://data-seed-prebsc-1-s1.binance.org:8545/')
},
network_id: 97,
kipDryRun: SKIP_DRY_RUN
},
// xDai
xdai: {
provider: function() {
return new HDWalletProvider(process.env.PRIVATEKEY, 'https://dai.poa.network')
},
network_id: 100,
gas: GAS,
gasPrice: 1000000000 * GASPRICE,
kipDryRun: SKIP_DRY_RUN
},
// polygon (matic)
matic: {
provider: () => new HDWalletProvider(process.env.PRIVATEKEY, `https://rpc-mainnet.maticvigil.com/`),
network_id: 137,
confirmations: 2,
timeoutBlocks: 200,
skipDryRun: true
},
mumbai: {
provider: () => new HDWalletProvider(process.env.PRIVATEKEY, `https://rpc-mumbai.maticvigil.com/`),
network_id: 80001,
confirmations: 2,
timeoutBlocks: 200,
skipDryRun: true
}
},
compilers: {
solc: {
version: "pragma", // Fetch exact version from solc-bin (default: truffle's version)
// docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
// settings: { // See the solidity docs for advice about optimization and evmVersion
// optimizer: {
// enabled: false,
// runs: 200
// },
// evmVersion: "byzantium"
// }
}
}
};