-
Notifications
You must be signed in to change notification settings - Fork 16
/
truffle.js
98 lines (85 loc) · 2.95 KB
/
truffle.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
/*
* NB: since truffle-hdwallet-provider 0.0.5 you must wrap HDWallet providers in a
* function when declaring them. Failure to do so will cause commands to hang. ex:
* ```
* mainnet: {
* provider: function() {
* return new HDWalletProvider(mnemonic, 'https://mainnet.infura.io/<infura-key>')
* },
* network_id: '1',
* gas: 4500000,
* gasPrice: 10000000000,
* },
*/
const web3 = require("web3");
const XBR_HDWALLET_SEED = process.env.XBR_HDWALLET_SEED;
var HDWalletProvider = require("truffle-hdwallet-provider");
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
networks: {
geth: {
host: "localhost",
port: 1545,
network_id: "5777"
},
ganache: {
// provider: function() {
// return new HDWalletProvider(XBR_HDWALLET_SEED, "http://localhost:1545")
// },
host: "localhost",
port: 1545,
network_id: "5777",
gas: 10000000,
gasPrice: web3.utils.toWei("8", "gwei")
},
// https://medium.com/coinmonks/5-minute-guide-to-deploying-smart-contracts-with-truffle-and-ropsten-b3e30d5ee1e
ropsten: {
provider: function() {
const XBR_INFURA_ENDPOINT= "https://ropsten.infura.io/v3/40c6959767364c2cb961bd389c738d98";
return new HDWalletProvider(XBR_HDWALLET_SEED, XBR_INFURA_ENDPOINT)
},
network_id: 3,
gas: 10000000,
gasPrice: web3.utils.toWei("50", "gwei")
},
// https://ethereum.stackexchange.com/a/17101/17806
rinkeby: {
provider: function() {
const XBR_INFURA_ENDPOINT= "https://rinkeby.infura.io/v3/40c6959767364c2cb961bd389c738d98";
return new HDWalletProvider(XBR_HDWALLET_SEED, XBR_INFURA_ENDPOINT)
},
network_id: 4,
// https://www.rinkeby.io/#stats
gas: 10000000,
gasPrice: web3.utils.toWei("50", "gwei")
}
},
// https://www.trufflesuite.com/docs/truffle/reference/configuration#solc
// https://github.com/trufflesuite/truffle-compile/issues/7#issuecomment-449629758
compilers: {
solc: {
// https://github.com/ethereum/solidity/tags
version: "0.6.12",
settings: {
optimizer: {
enabled: true,
runs: 200
}
// Can be homestead, tangerineWhistle, spuriousDragon, byzantium, constantinople, petersburg, istanbul or berlin
// evmVersion: "constantinople"
}
}
},
mocha: {
useColors: true
},
plugins: [
'truffle-plugin-verify',
'verify-on-etherscan',
'solidity-coverage'
],
api_keys: {
etherscan: process.env.ETHERSCAN_API_KEY
}
};