forked from d4rk4444/linea-mainnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
364 lines (335 loc) · 13.9 KB
/
index.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
import { info,
timeout,
shuffle,
parseFile,
generateRandomAmount,
privateToAddress,
log,
pathData } from './src/other.js';
import { bridgeETHToEthereum, bridgeETHToLinea, claimETHMainnet } from './function/bridge.js';
import { wrapETH } from './function/DEX.js';
import { addLPETHWithTokenSync, deleteLPETHWithTokenSync, swapETHToTokenSync, swapTokenToETHSync } from './function/syncSwap.js';
import { swapETHToTokenLineaSwap, swapTokenToETHLineaSwap } from './function/lineaSwap.js';
import { swapETHToTokenEcho, swapTokenToETHEcho } from './function/echoDEX.js';
import { swapETHToTokenHorizon, swapTokenToETHHorizon } from './function/horizon.js';
import { swapETHToTokenIzumi, swapTokenToETHIzumi } from './function/izumi.js';
import { mintDomenName } from './function/lineans.js';
import { mintOwltoLineaGalaxyNFT } from './function/galaxy.js';
import { getBalanceLinea } from './function/other.js';
import { clearBridgeInfo } from './src/bridge.js';
import { randomSwapETHToTokenAll, randomSwapTokenToETHAll } from './function/random.js';
import { getStatsTable } from './function/stats.js';
import { bridgeMetamask } from './function/metamask.js';
import readline from 'readline-sync';
import * as dotenv from 'dotenv';
dotenv.config();
(async() => {
const wallet = parseFile('private.txt');
if (process.env.Random_Wallet_List == 'true') {
shuffle(wallet);
}
const mainStage = [
'Bridge',
'DEX',
'SyncSwap',
'LineaSwap',
'EchoDEX',
'Horizon',
'Izumi',
'LineaName',
'Random',
'Other',
'VOYAGE',
];
const stageBridge = [
'Bridge ETH Ethereum -> Linea',
'Bridge ETH Linea -> Ethereum [Manual Claiming]',
'Claim ETH Ethereum',
'Clear History Bridge File',
];
const stageDEX = [
'Wrap ETH',
];
const stageSync = [
'Swap ETH -> ceBUSD',
'Swap ceBUSD -> ETH',
'Swap ETH -> ceBNB',
'Swap ceBNB -> ETH',
'Swap ETH -> ceMATIC',
'Swap ceMATIC -> ETH',
'Swap ETH -> ceAVAX',
'Swap ceAVAX -> ETH',
'Random ETH -> ceBUSD/ceBNB/ceMATIC/ceAVAX',
'Swap All Tokens -> ETH',
'Add LP ETH/BUSD',
'Delete LP ETH/BUSD',
];
const stageLineaSwap = [
'Swap ETH -> ceBUSD',
'Swap ceBUSD -> ETH',
'Swap ETH -> ceBNB',
'Swap ceBNB -> ETH',
'Swap ETH -> ceMATIC',
'Swap ceMATIC -> ETH',
'Swap ETH -> ceAVAX',
'Swap ceAVAX -> ETH',
'Random ETH -> ceBUSD/ceBNB/ceMATIC/ceAVAX',
'Swap All Tokens -> ETH',
];
const stageEchoDEX = [
'Swap ETH -> ceBUSD',
'Swap ceBUSD -> ETH',
'Swap ETH -> ceMATIC',
'Swap ceMATIC -> ETH',
'Random ETH -> ceBUSD/ceMATIC',
'Swap All Tokens -> ETH',
];
const stageHorizon = [
'Swap ETH -> ceBUSD',
'Swap ceBUSD -> ETH',
'Swap ETH -> ceBNB',
'Swap ceBNB -> ETH',
'Random ETH -> ceBUSD/ceBNB',
'Swap All Tokens -> ETH',
];
const stageIzumi = [
'Swap ETH -> ceBUSD',
'Swap ceBUSD -> ETH',
'Swap ETH -> izumiUSD',
'Swap izumiUSD -> ETH',
'Random ETH -> ceBUSD/izumiUSD',
'Swap All Tokens -> ETH',
];
const stageLineans = [
'Mint Domen Name 0.0027ETH',
];
const stageRandom = [
'Random Swap ETH -> Token',
'Random Swap Token -> ETH',
'Random Swap ALL Tokens -> ETH',
];
const stageOther = [
'View Wallets Stats',
'Check Balance Linea',
'Mint Owlto x Linea Bridger',
'Activities in projects where they have not been done',
];
const stageVoyager = [
'MM Bridge OP -> Linea',
];
const index = readline.keyInSelect(mainStage, 'Choose stage!');
let index1;
let index2;
let index3;
let index4;
let index5;
let index6;
let index7;
let index8;
let index9;
let index10;
let index11;
if (index == -1) { process.exit() };
log('info', `Start ${mainStage[index]}`, 'green');
if (index == 0) {
index1 = readline.keyInSelect(stageBridge, 'Choose stage!');
if (index1 == -1) { process.exit() };
log('info', `Start ${stageBridge[index1]}`, 'green');
} else if (index == 1) {
index2 = readline.keyInSelect(stageDEX, 'Choose stage!');
if (index2 == -1) { process.exit() };
log('info', `Start ${stageDEX[index2]}`, 'green');
} else if (index == 2) {
index3 = readline.keyInSelect(stageSync, 'Choose stage!');
if (index3 == -1) { process.exit() };
log('info', `Start ${stageSync[index3]}`, 'green');
} else if (index == 3) {
index4 = readline.keyInSelect(stageLineaSwap, 'Choose stage!');
if (index4 == -1) { process.exit() };
log('info', `Start ${stageLineaSwap[index4]}`, 'green');
} else if (index == 4) {
index5 = readline.keyInSelect(stageEchoDEX, 'Choose stage!');
if (index5 == -1) { process.exit() };
log('info', `Start ${stageEchoDEX[index5]}`, 'green');
} else if (index == 5) {
index6 = readline.keyInSelect(stageHorizon, 'Choose stage!');
if (index6 == -1) { process.exit() };
log('info', `Start ${stageHorizon[index6]}`, 'green');
} else if (index == 6) {
index7 = readline.keyInSelect(stageIzumi, 'Choose stage!');
if (index7 == -1) { process.exit() };
log('info', `Start ${stageIzumi[index7]}`, 'green');
} else if (index == 7) {
index8 = readline.keyInSelect(stageLineans, 'Choose stage!');
if (index8 == -1) { process.exit() };
log('info', `Start ${stageLineans[index8]}`, 'green');
} else if (index == 8) {
index9 = readline.keyInSelect(stageRandom, 'Choose stage!');
if (index9 == -1) { process.exit() };
log('info', `Start ${stageRandom[index9]}`, 'green');
} else if (index == 9) {
index10 = readline.keyInSelect(stageOther, 'Choose stage!');
if (index10 == -1) { process.exit() };
log('info', `Start ${stageOther[index10]}`, 'green');
} else if (index == 10) {
index11 = readline.keyInSelect(stageVoyager, 'Choose stage!');
if (index11 == -1) { process.exit() };
log('info', `Start ${stageVoyager[index11]}`, 'green');
}
for (let i = 0; i < wallet.length; i++) {
let pauseWalletTime = generateRandomAmount(process.env.TIMEOUT_WALLET_SEC_MIN * 1000, process.env.TIMEOUT_WALLET_SEC_MAX * 1000, 0);
try {
log('info', `Wallet ${i+1}: ${privateToAddress(wallet[i])}`, 'blue');
} catch (err) { throw new Error('Error: Add Private Keys!') };
try {
if (index1 == 0) { //BRIDGE STAGE
await bridgeETHToLinea(wallet[i]);
} else if (index1 == 1) {
await bridgeETHToEthereum(wallet[i]);
} else if (index1 == 2) {
await claimETHMainnet('historyBridge.json', wallet[i]);
} else if (index1 == 3) {
clearBridgeInfo('historyBridge.json');
}
if (index2 == 0) { //DEX STAGE
await wrapETH(info.rpcLinea, wallet[i]);
}
if (index3 == 0) { //SYNC STAGE
await swapETHToTokenSync(info.ceBUSD, wallet[i]);
} else if (index3 == 1) {
await swapTokenToETHSync(info.ceBUSD, wallet[i]);
} else if (index3 == 2) {
await swapETHToTokenSync(info.ceBNB, wallet[i]);
} else if (index3 == 3) {
await swapTokenToETHSync(info.ceBNB, wallet[i]);
} else if (index3 == 4) {
await swapETHToTokenSync(info.ceMATIC, wallet[i]);
} else if (index3 == 5) {
await swapTokenToETHSync(info.ceMATIC, wallet[i]);
} else if (index3 == 6) {
await swapETHToTokenSync(info.ceAVAX, wallet[i]);
} else if (index3 == 7) {
await swapTokenToETHSync(info.ceAVAX, wallet[i]);
} else if (index3 == 8) {
const arrTokens = pathData.Sync;
await swapETHToTokenSync(arrTokens[generateRandomAmount(0, arrTokens.length - 1), 0], wallet[i]);
} else if (index3 == 9) {
const arrTokens = pathData.Sync;
for (let n = 0; n < arrTokens.length; n++) {
await swapTokenToETHSync(arrTokens[n], wallet[i]);
}
} else if (index3 == 10) {
await addLPETHWithTokenSync(info.ceBUSD, wallet[i]);
} else if (index3 == 11) {
await deleteLPETHWithTokenSync(info.ceBUSD, wallet[i]);
}
if (index4 == 0) { //LINEASWAP STAGE
await swapETHToTokenLineaSwap(info.ceBUSD, wallet[i]);
} else if (index4 == 1) {
await swapTokenToETHLineaSwap(info.ceBUSD, wallet[i]);
} else if (index4 == 2) {
await swapETHToTokenLineaSwap(info.ceBNB, wallet[i]);
} else if (index4 == 3) {
await swapTokenToETHLineaSwap(info.ceBNB, wallet[i]);
} else if (index4 == 4) {
await swapETHToTokenLineaSwap(info.ceMATIC, wallet[i]);
} else if (index4 == 5) {
await swapTokenToETHLineaSwap(info.ceMATIC, wallet[i]);
} else if (index4 == 6) {
await swapETHToTokenLineaSwap(info.ceAVAX, wallet[i]);
} else if (index4 == 7) {
await swapTokenToETHLineaSwap(info.ceAVAX, wallet[i]);
} else if (index4 == 8) {
const arrTokens = pathData.LineaSwap;
await swapETHToTokenLineaSwap(arrTokens[generateRandomAmount(0, arrTokens.length - 1), 0], wallet[i]);
} else if (index4 == 9) {
const arrTokens = pathData.LineaSwap;
for (let n = 0; n < arrTokens.length; n++) {
await swapTokenToETHLineaSwap(arrTokens[n], wallet[i]);
}
}
if (index5 == 0) { //ECHODEX STAGE
await swapETHToTokenEcho(info.ceBUSD, wallet[i]);
} else if (index5 == 1) {
await swapTokenToETHEcho(info.ceBUSD, wallet[i]);
} else if (index5 == 2) {
await swapETHToTokenEcho(info.ceMATIC, wallet[i]);
} else if (index5 == 3) {
await swapTokenToETHEcho(info.ceMATIC, wallet[i]);
} else if (index5 == 4) {
const arrTokens = pathData.Echo;
await swapETHToTokenEcho(arrTokens[generateRandomAmount(0, arrTokens.length - 1), 0], wallet[i]);
} else if (index5 == 5) {
const arrTokens = pathData.Echo;
for (let i = 0; i < arrTokens.length; i++) {
await swapTokenToETHEcho(arrTokens[i], wallet[i]);
}
}
if (index6 == 0) { //HORIZON STAGE
await swapETHToTokenHorizon(info.ceBUSD, wallet[i]);
} else if (index6 == 1) {
await swapTokenToETHHorizon(info.ceBUSD, wallet[i]);
} else if (index6 == 2) {
await swapETHToTokenHorizon(info.ceBNB, wallet[i]);
} else if (index6 == 3) {
await swapTokenToETHHorizon(info.ceBNB, wallet[i]);
} else if (index6 == 4) {
const arrTokens = pathData.Horizon;
await swapETHToTokenHorizon(arrTokens[generateRandomAmount(0, arrTokens.length - 1), 0], wallet[i]);
} else if (index6 == 5) {
const arrTokens = pathData.Horizon;
for (let n = 0; n < arrTokens.length; n++) {
await swapTokenToETHHorizon(arrTokens[n], wallet[i]);
}
}
if (index7 == 0) { //IZUMI STAGE
await swapETHToTokenIzumi(info.ceBUSD, wallet[i]);
} else if (index7 == 1) {
await swapTokenToETHIzumi(info.ceBUSD, wallet[i]);
} else if (index7 == 2) {
await swapETHToTokenIzumi(info.izumiUSD, wallet[i]);
} else if (index7 == 3) {
await swapTokenToETHIzumi(info.izumiUSD, wallet[i]);
} else if (index7 == 4) {
const arrTokens = pathData.Izumi;
await swapETHToTokenIzumi(arrTokens[generateRandomAmount(0, arrTokens.length - 1), 0], wallet[i]);
} else if (index7 == 5) {
const arrTokens = pathData.Izumi;
for (let n = 0; n < arrTokens.length; n++) {
await swapTokenToETHIzumi(arrTokens[n], wallet[i]);
}
}
if (index8 == 0) { //LINEANS STAGE
await mintDomenName(wallet[i]);
}
if (index9 == 0) { //RANDOM STAGE
await randomSwapETHToTokenAll(info.dexList, wallet[i]);
} else if (index9 == 1) {
await randomSwapTokenToETHAll(false, wallet[i]);
} else if (index9 == 2) {
await randomSwapTokenToETHAll(true, wallet[i]);
}
if (index10 == 0) { //OTHER STAGE
await getStatsTable(false, wallet);
return;
} else if (index10 == 1) {
pauseWalletTime = 0;
await getBalanceLinea(wallet);
return;
} else if (index10 == 2) {
await mintOwltoLineaGalaxyNFT(wallet[i]);
} else if (index10 == 3) {
await getStatsTable(true, [wallet[i]]);
}
if (index11 == 0) { //VOYAGER STAGE
await bridgeMetamask('Optimism', wallet[i]);
}
if (i + 1 != wallet.length) {
await timeout(pauseWalletTime);
}
} catch (error) {
log('error', error, 'red');
}
}
log('info', 'Process End!', 'bgMagentaBright');
})();