forked from saturn-network/airdrop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtruffle-config.js
42 lines (39 loc) · 1020 Bytes
/
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
const web3 = require('ethers')
const ProviderEngine = require("web3-provider-engine");
const RpcProvider = require("web3-provider-engine/subproviders/rpc.js");
// 7535 for Ganache
// Use 8545 for ganache-cli
const rpcurl = "http://localhost:7545"
const provider = new ProviderEngine();
const solcVersion = require('./compiler.json').solcVersion
provider.addProvider(new RpcProvider({ rpcUrl: rpcurl }));
provider.start(err => {
if (err !== undefined) {
console.log(err);
process.exit(1);
}
});
/**
* HACK: Truffle providers should have `send` function, while `ProviderEngine` creates providers with `sendAsync`,
* but it can be easily fixed by assigning `sendAsync` to `send`.
*/
provider.send = provider.sendAsync.bind(provider);
module.exports = {
networks: {
development: {
provider,
network_id: "*"
}
},
compilers: {
solc: {
version: solcVersion,
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
}
}
};