-
Notifications
You must be signed in to change notification settings - Fork 3
/
truffle.js
128 lines (120 loc) · 3.54 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
var HDWalletProvider = require("@truffle/hdwallet-provider");
const privateKeys = [process.env.WALLET_KEY];
module.exports = {
networks: {
// Useful for testing. The `development` name is special - truffle uses it by default
// if it's defined here and no other network is specified at the command line.
// You should run a client (like ganache-cli, geth or parity) in a separate terminal
// tab if you use this network and you must also set the `host`, `port` and `network_id`
// options below to some value.
//
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none),
gas: 120000000,
gasPrice: 1, // To cancel out gasPrice in tests.
},
main: {
provider: () =>
new HDWalletProvider({
privateKeys: privateKeys,
providerOrUrl: `wss://mainnet.infura.io/ws/v3/${process.env.INFURA_PROJECT_ID}`,
chainId: 1,
}),
networkCheckTimeout: 999999,
network_id: 1,
gasPrice: 80000000000, // 80 gwei
gas: 4000000,
},
sepolia: {
provider: function() {
return new HDWalletProvider({
privateKeys: privateKeys,
providerOrUrl: `https://sepolia.infura.io/v3/${process.env.INFURA_PROJECT_ID}`,
chainId: 11155111,
});
},
networkCheckTimeout: 99999999,
network_id: 11155111,
skipDryRun: true,
},
sokol: {
provider: () =>
new HDWalletProvider({
privateKeys: privateKeys,
providerOrUrl: "https://sokol.poa.network",
chainId: 77,
}),
network_id: 77,
skipDryRun: true,
networkCheckTimeout: 99999999,
gas: 5000000,
gasPrice: 1000000000,
},
xdai: {
provider: () =>
new HDWalletProvider({
privateKeys: privateKeys,
providerOrUrl: "https://rpc.xdaichain.com",
chainId: 100,
}),
network_id: 100,
networkCheckTimeout: 2000000,
gas: 5000000,
gasPrice: 20000000000, // 20 gwei
},
polygon: {
provider: () =>
new HDWalletProvider({
privateKeys: privateKeys,
providerOrUrl: "https://matic-mainnet.chainstacklabs.com",
chainId: 137,
}),
network_id: 137,
networkCheckTimeout: 2000000,
gas: 5000000,
gasPrice: 20000000000, // 20 gwei
},
mumbai: {
provider: () =>
new HDWalletProvider({
privateKeys: privateKeys,
providerOrUrl: "https://polygon-mumbai.g.alchemy.com/v2/PX_3q-P-AbxWKn8qiTvF5A6TFSMfQ4jz",
chainId: 80001,
}),
network_id: 80001,
networkCheckTimeout: 2000000,
gas: 5000000,
gasPrice: 20000000000, // 20 gwei
},
},
// Set default mocha options here, use special reporters etc.
mocha: {
// timeout: 100000
reporter: "eth-gas-reporter",
reporterOptions: { gasPrice: 1, currency: "usd" },
},
// Configure your compilers
compilers: {
solc: {
version: ">=0.7 <0.8.0", // Fetch exact version from solc-bin (default: truffle's version)
docker: false,
settings: {
// See the solidity docs for advice about optimization and evmVersion
optimizer: {
enabled: true,
runs: 20000,
},
evmVersion: "byzantium",
},
},
},
plugins: ["truffle-plugin-verify"],
api_keys: {
etherscan: process.env.ETHERSCAN,
},
etherscan: {
apiKey: process.env.ETHERSCAN
}
};