-
Notifications
You must be signed in to change notification settings - Fork 2
/
truffle-config.js
91 lines (83 loc) · 2.58 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
const fs = require('fs')
const Web3 = require('web3')
const HDWalletProvider = require("truffle-hdwallet-provider")
ethers = require('ethers')
network = require('./truffle/network')
// SETUP GLOBALS FOR CLI REPL
const utils = require('./truffle/utils')
getMinedTx = utils.getMinedTx
bts = bytesToString = utils.bytesToString
ntb = numberToBytes = utils.numberToBytes
stb = stringToBytes = utils.stringToBytes
contract = utils.Contract
keccak = str => '0x' + ethUtil.keccak(str).hexSlice(0)
selector = signature => keccak(signature).substr(0, 10)
gt = getTx = hash => wallet.provider.getTransaction(hash)
gtr = getTxR = hash => wallet.provider.getTransactionReceipt(hash)
hex = dec => '0x' + dec.toString(16)
dec = hex => parseInt(hex, 16)
fromWei = wei => +ethers.utils.formatEther(wei.toString())
toWei = eth => ethers.utils.parseEther(eth.toString())
network.setNetwork('develop')
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
networks: {
development: {
host: "localhost",
port: 8545,
provider: function () {
network.setNetwork('ganache')
wallet = new ethers.Wallet(network.privateKeys[0], network.provider)
return new HDWalletProvider(network.mnemonic, "http://localhost:8545")
},
network_id: "*", // match any network
gas: 8e6,
gasPrice: 5e9,
skipDryRun: true
},
ropsten: {
provider: function () {
network.setNetwork('ropsten')
wallet = new ethers.Wallet(network.privateKeys[0], network.provider)
return new HDWalletProvider(network.mnemonic, "https://ropsten.infura.io/metamask")
},
network_id: 3,
gas: 8e6,
gasPrice: 5e9
},
kovan: {
provider: function () {
network.setNetwork('kovan')
wallet = new ethers.Wallet(network.privateKeys[0], network.provider)
return new HDWalletProvider(network.mnemonic, "https://kovan.infura.io/metamask")
},
network_id: 42,
gas: 8e6,
gasPrice: 5e9 // 5 gwei
},
testing: {
host: "localhost",
port: 8545,
network_id: "*", // match any network
gas: 8e6,
gasPrice: 5e9
},
coverage: {
host: "localhost",
network_id: "*",
port: 8545, // <-- If you change this, also set the port option in .solcover.js.
gas: 9000000000, // <-- Use this high gas value
gasPrice: 100000 // <-- Use this low gas price
}
},
mocha: {
enableTimeouts: false
},
solc: {
optimizer: {
enabled: true,
runs: 200
}
}
}