This repository has been archived by the owner on Mar 18, 2020. It is now read-only.
forked from compound-finance/compound-protocol
-
Notifications
You must be signed in to change notification settings - Fork 1
/
truffle.js
88 lines (78 loc) · 1.68 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
"use strict";
const Web3 = require("web3");
const fs = require('fs');
const path = require('path');
const networks = {
rinkeby: 4,
kovan: 42,
ropsten: 3,
mainnet: 1,
goerli: 5
};
const infuraNetworks = Object.entries(networks).reduce((networks, [network, networkId]) => {
return {
...networks,
[network]: {
provider: new Web3.providers.HttpProvider(`https://${network}.infura.io/`),
network_id: networkId
}
};
}, {});
let mochaOptions = {
reporter: "mocha-multi-reporters",
reporterOptions: {
configFile: "reporterConfig.json"
}
};
if (process.env.NETWORK === 'coverage') {
mochaOptions = {
enableTimeouts: false,
grep: /@gas/,
invert: true
};
}
const development = {
host: "localhost",
port: 8545,
network_id: "*",
gas: 6700000,
gasPrice: 20000,
}
const coverage = { // See example coverage settings at https://github.com/sc-forks/solidity-coverage
host: "localhost",
network_id: "*",
gas: 0xfffffffffff,
gasPrice: 0x01,
port: 8555
};
const test = {
host: "localhost",
port: 8545,
network_id: "*",
gas: 20000000,
gasPrice: 20000
};
process.env[`development_opts`] = JSON.stringify(development);
process.env[`coverage_opts`] = JSON.stringify(coverage);
process.env[`test_opts`] = JSON.stringify(test);
module.exports = {
networks: {
...infuraNetworks,
development,
coverage,
test
},
compilers: {
solc: {
version: "0.5.8",
settings: {
optimizer: {
enabled: true
}
}
}
},
mocha: mochaOptions,
contracts_build_directory: process.env.CONTRACTS_BUILD_DIRECTORY || undefined,
build_directory: process.env.BUILD_DIRECTORY || undefined
};