-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtruffle-config.js
More file actions
45 lines (40 loc) · 1.18 KB
/
truffle-config.js
File metadata and controls
45 lines (40 loc) · 1.18 KB
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
function createNetwork(name) {
var os = require('os');
var json = require(os.homedir() + "/.ethereum/" + name + ".json");
var gasPrice = json.gasPrice != null ? json.gasPrice : 2000000000;
return {
provider: () => createProvider(json.address, json.key, json.url, gasPrice),
from: json.address,
gas: 1000000,
gasPrice: gasPrice,
network_id: json.network_id
};
}
function createProvider(address, key, url, gasPrice) {
console.log("creating provider for address: " + address + " gasPrice: " + gasPrice);
var HDWalletProvider = require("truffle-hdwallet-provider");
return new HDWalletProvider(key, url);
}
module.exports = {
networks: {
ropsten: createNetwork("ropsten"),
mainnet: createNetwork("mainnet"),
ops: createNetwork("ops"),
},
mocha: {
// timeout: 100000
},
// Configure your compilers
compilers: {
solc: {
version: "0.5.6", // Fetch exact version from solc-bin (default: truffle's version)
settings: { // See the solidity docs for advice about optimization and evmVersion
optimizer: {
enabled: true,
runs: 200
},
evmVersion: "byzantium"
}
}
}
}