forked from sablier-labs/v1-smooth-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
truffle-config.js
74 lines (72 loc) · 1.76 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
require("dotenv").config();
const HDWalletProvider = require("@truffle/hdwallet-provider");
const { ethers } = require("ethers");
/**
* @dev You must create a `.env` file by following `.env.example`.
* @param {string} network The name of the testnet
*/
function createProvider(network) {
if (process.env.CI) {
return {};
}
if (!process.env.MNEMONIC) {
console.log("Please set your MNEMONIC in a .env file");
process.exit(1);
}
if (!process.env.INFURA_API_KEY) {
console.log("Please set your INFURA_API_KEY");
process.exit(1);
}
return () => {
return new HDWalletProvider(process.env.MNEMONIC, `https://${network}.infura.io/v3/` + process.env.INFURA_API_KEY);
};
}
module.exports = {
compilers: {
solc: {
version: "0.5.11",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
},
mocha: {
bail: true,
enableTimeouts: false,
},
networks: {
development: {
host: "127.0.0.1",
gas: 6000000,
gasPrice: ethers.utils.parseUnits("1", "gwei").toString(),
network_id: "*",
port: 8545,
skipDryRun: true,
},
kovan: {
provider: createProvider("kovan"),
gas: 6000000,
gasPrice: ethers.utils.parseUnits("10", "gwei").toString(),
network_id: "42",
skipDryRun: true,
},
rinkeby: {
provider: createProvider("rinkeby"),
gas: 6000000,
gasPrice: ethers.utils.parseUnits("10", "gwei").toString(),
network_id: "4",
skipDryRun: true,
},
ropsten: {
provider: createProvider("ropsten"),
gas: 6000000,
gasPrice: ethers.utils.parseUnits("10", "gwei").toString(),
network_id: "3",
skipDryRun: true,
},
},
plugins: ["solidity-coverage"],
};