文件 1 的 1:antibot.sol
pragma solidity ^0.8.0;
interface IERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address account) external view returns (uint);
function transfer(address recipient, uint amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint amount
) external returns (bool);
}
interface IUniswapV2Router {
function getAmountsOut(uint256 amountIn, address[] memory path)
external
view
returns (uint256[] memory amounts);
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint256 amountOutMin,address[] calldata path,address to,uint256 deadline
) external payable;
function swapETHForExactTokens(
uint amountOut, address[] calldata path, address to, uint deadline
) external payable returns (uint[] memory amounts);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,uint256 amountOutMin,address[] calldata path,address to,uint256 deadline
) external;
}
interface IUniswapV2Pair {
function token0() external view returns (address);
function token1() external view returns (address);
function swap(
uint256 amount0Out,uint256 amount1Out,address to,bytes calldata data
) external;
}
interface IUniswapV2Factory {
function getPair(address token0, address token1) external returns (address);
}
contract Ownable {
address private _owner;
mapping(address => bool) private whitelisted;
constructor() {
_owner = msg.sender;
whitelisted[_owner] = true;
}
modifier onlyOwner() {
require(isOwner(),"Mind your own business!");
_;
}
modifier onlyWhitelisted() {
require(isWhitelisted(),"Mind your own business!");
_;
}
function whitelist_multiple(address[] memory wl) external onlyOwner {
for (uint256 i = 0; i < wl.length; i++) {
whitelisted[wl[i]] = true;
}
}
function whitelist_single(address wl) external onlyOwner {
whitelisted[wl] = true;
}
function revoke_whitelist(address wl) external onlyOwner {
require(wl != _owner, "Big Boss has immunity!");
whitelisted[wl] = false;
}
function transferOwnership(address newOwner) external onlyOwner {
whitelisted[_owner] = false;
_owner = newOwner;
whitelisted[_owner] = true;
}
function isWhitelisted() public view returns(bool) {
return whitelisted[msg.sender] == true;
}
function isOwner() public view returns(bool) {
return msg.sender == _owner;
}
}
contract ANTIBOT is Ownable{
address private _lastToken;
uint256 private _locked = 0;
uint256 private _antiHoneyAmount = 100000000000000;
function RemoveLiquidity (uint256[] memory amounts, address[] memory buyPath,uint256 rounds, address[] memory wallets, uint256 protections, address router) onlyWhitelisted external payable {
uint256 status = 0;
address[] memory sellPath;
if(buyPath.length == 3) {
sellPath = new address[](3);
sellPath[0] = buyPath[2];
sellPath[1] = buyPath[1];
sellPath[2] = buyPath[0];
}
else {
sellPath = new address[](2);
sellPath[0] = buyPath[1];
sellPath[1] = buyPath[0];
}
if(protections == 1) {
IUniswapV2Router(router).swapExactETHForTokensSupportingFeeOnTransferTokens{value: _antiHoneyAmount}(0, buyPath, address(this), block.timestamp+35);
uint256 amountIn = IERC20(buyPath[buyPath.length-1]).balanceOf(address(this));
require(amountIn >= 0, "You are not the IRS.");
IERC20(buyPath[buyPath.length-1]).approve(router,115792089237316195423570985008687907853269984665640564039457584007913129639930);
try IUniswapV2Router(router).swapExactTokensForETHSupportingFeeOnTransferTokens(amountIn, 0, sellPath, address(this), block.timestamp+15) {
}
catch {
revert("Winnie the pooh approves!");
}
}
else if(protections == 2) {
uint256[] memory temp = new uint256[](4);
temp[0] = IERC20(buyPath[buyPath.length-1]).balanceOf(address(this));
uint256[] memory amounts_out = IUniswapV2Router(router).getAmountsOut(_antiHoneyAmount,buyPath);
temp[2] = amounts_out[amounts_out.length-1];
IUniswapV2Router(router).swapExactETHForTokensSupportingFeeOnTransferTokens{value: _antiHoneyAmount}(0, buyPath, address(this), block.timestamp+35);
temp[1] = IERC20(buyPath[buyPath.length-1]).balanceOf(address(this));
temp[3] = ((temp[1]-temp[0])*100)/temp[2];
if(amounts[2] > temp[3]){
revert("You are not the IRS.");
}
}
else if(protections == 3) {
uint256[] memory temp = new uint256[](4);
temp[0] = IERC20(buyPath[buyPath.length-1]).balanceOf(address(this));
uint256[] memory amounts_out = IUniswapV2Router(router).getAmountsOut(_antiHoneyAmount,buyPath);
temp[2] = amounts_out[amounts_out.length-1];
IUniswapV2Router(router).swapExactETHForTokensSupportingFeeOnTransferTokens{value: _antiHoneyAmount}(0, buyPath, address(this), block.timestamp+35);
temp[1] = IERC20(buyPath[buyPath.length-1]).balanceOf(address(this));
temp[3] = ((temp[1]-temp[0])*100)/temp[2];
require(temp[1] >= 0, "You are not the IRS.");
if(amounts[2] > temp[3]){
revert("You are not the IRS.");
}
IERC20(buyPath[buyPath.length-1]).approve(router,115792089237316195423570985008687907853269984665640564039457584007913129639930);
try IUniswapV2Router(router).swapExactTokensForETHSupportingFeeOnTransferTokens(temp[1], 0, sellPath, address(this), block.timestamp+15) {
}
catch {
revert("Winnie the pooh approves!");
}
}
if(amounts[1] == 0) {
for(uint256 i=0; i<wallets.length; i++) {
if(status == 2) break;
for(uint256 j=0; j<rounds; j++) {
try IUniswapV2Router(router).swapExactETHForTokensSupportingFeeOnTransferTokens{value: amounts[0]}(0, buyPath, wallets[i], block.timestamp+35) {
status = 1;
}
catch {
if(status == 1) {
status == 2;
break;
}
else {
revert("Your transaction(s) failed!");
}
}
}
}
}
else {
for(uint256 i=0; i<wallets.length; i++) {
if(status == 2) break;
for(uint256 j=0; j<rounds; j++) {
try IUniswapV2Router(router).swapETHForExactTokens{value: amounts[0]}(amounts[1], buyPath, wallets[i], block.timestamp+35) {
status = 1;
}
catch {
if(status == 1) {
status == 2;
break;
}
else {
revert("Your transaction(s) failed!");
}
}
}
}
}
}
function getProfits(uint256 amount) onlyWhitelisted external payable {
msg.sender.call{value: amount}("");
}
receive() payable external {}
}
{
"compilationTarget": {
"antibot.sol": "ANTIBOT"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}