-
Notifications
You must be signed in to change notification settings - Fork 77
/
truffle-config.js
101 lines (98 loc) · 2.27 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
require("dotenv").config();
const HDWalletProvider = require("@truffle/hdwallet-provider");
// Create a `.env` file by following `.env.example`
const mnemonic = process.env.MNEMONIC;
if (!mnemonic) {
console.log("Please set your MNEMONIC in a .env file");
process.exit(1);
}
function createProvider(network) {
if (process.env.CI) {
return {};
}
if (!process.env.INFURA_API_KEY) {
console.log("Please set your INFURA_API_KEY");
process.exit(1);
}
return () => {
return new HDWalletProvider(mnemonic, "wss://" + network + ".infura.io/ws/v3/" + process.env.INFURA_API_KEY);
};
}
module.exports = {
compilers: {
solc: {
version: "0.5.17",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
},
mocha: {
bail: true,
enableTimeouts: false,
},
networks: {
arbitrum: {
provider: createProvider("arbitrum-mainnet"),
network_id: "42161",
networkCheckTimeout: 1000000,
skipDryRun: true,
timeoutBlocks: 500,
},
avalanche: {
provider: () => new HDWalletProvider(mnemonic, "https://api.avax.network/ext/bc/C/rpc"),
gas: "6000000",
network_id: "43114",
networkCheckTimeout: 1000000,
skipDryRun: true,
timeoutBlocks: 500,
},
development: {
host: "127.0.0.1",
gas: "6000000",
network_id: "*",
port: "8545",
skipDryRun: true,
},
goerli: {
provider: createProvider("goerli"),
gas: "6000000",
network_id: "5",
skipDryRun: true,
},
mainnet: {
provider: createProvider("mainnet"),
network_id: "1",
skipDryRun: true,
},
kovan: {
provider: createProvider("kovan"),
gas: "6000000",
network_id: "42",
skipDryRun: true,
},
optimism: {
provider: createProvider("optimism-mainnet"),
network_id: "10",
networkCheckTimeout: 1000000,
skipDryRun: true,
timeoutBlocks: 500,
},
rinkeby: {
provider: createProvider("rinkeby"),
gas: "6000000",
network_id: "4",
skipDryRun: true,
},
ropsten: {
provider: createProvider("ropsten"),
gas: "6000000",
network_id: "3",
skipDryRun: true,
},
},
plugins: ["solidity-coverage"],
};