-
Notifications
You must be signed in to change notification settings - Fork 6
/
truffle.js
62 lines (58 loc) · 1.51 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
const Ganache = require('ganache-core');
const HDWalletProvider = require('@truffle/hdwallet-provider');
const web3 = require('web3');
function getProvider(rpc) {
return function() {
const provider = new web3.providers.WebsocketProvider(rpc);
return new HDWalletProvider(process.env.DEPLOYMENT_KEY, provider);
};
}
const config = {
networks: {
local: {
host: '127.0.0.1',
port: 8545,
network_id: '*'
},
kovan: {
gasPrice: 1000 * 1000 * 1000,
gasLimit: 10 * 1000 * 1000,
provider: getProvider('wss://wss-rpc.kovan.galtproject.io'),
// provider: getProvider('https://kovan.poa.network'),
// provider: getProvider('wss://kovan.infura.io/ws/v3/83ea24ff57c3420abe37f03312bbafc1'),
websockets: true,
skipDryRun: true,
network_id: '42'
},
test: {
// https://github.com/trufflesuite/ganache-core#usage
provider: Ganache.provider({
unlocked_accounts: [0, 1, 2, 3, 4, 5],
total_accounts: 30,
debug: true,
vmErrorsOnRPCResponse: true,
default_balance_ether: 5000000,
// 7 800 000
gasLimit: 0x7704c0
}),
skipDryRun: true,
network_id: '*'
}
},
compilers: {
solc: {
version: process.env.SOLC || 'native',
settings: {
optimizer: {
enabled: true,
runs: 200
}
},
evmVersion: 'petersburg'
}
}
};
if (process.env.SOLIDITY_COVERAGE === 'yes') {
delete config.networks.test;
}
module.exports = config;