creation_sourcecode: {"Address.sol":{"content":"// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.7;\r\n\r\nlibrary Address {\r\n    function isContract(address account) internal view returns (bool) {\r\n        return account.code.length \u003e 0;\r\n    }\r\n\r\n    function sendValue(address payable recipient, uint256 amount) internal {\r\n        require(address(this).balance \u003e= 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\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\r\n        return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\r\n    }\r\n\r\n    function functionCall(\r\n        address target,\r\n        bytes memory data,\r\n        string memory errorMessage\r\n    ) internal returns (bytes memory) {\r\n        return functionCallWithValue(target, data, 0, errorMessage);\r\n    }\r\n\r\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\r\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\r\n    }\r\n\r\n    function functionCallWithValue(\r\n        address target,\r\n        bytes memory data,\r\n        uint256 value,\r\n        string memory errorMessage\r\n    ) internal returns (bytes memory) {\r\n        require(address(this).balance \u003e= value, \"Address: insufficient balance for call\");\r\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\r\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\r\n    }\r\n\r\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\r\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\r\n    }\r\n\r\n    function functionStaticCall(\r\n        address target,\r\n        bytes memory data,\r\n        string memory errorMessage\r\n    ) internal view returns (bytes memory) {\r\n        (bool success, bytes memory returndata) = target.staticcall(data);\r\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\r\n    }\r\n\r\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\r\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\r\n    }\r\n\r\n    function functionDelegateCall(\r\n        address target,\r\n        bytes memory data,\r\n        string memory errorMessage\r\n    ) internal returns (bytes memory) {\r\n        (bool success, bytes memory returndata) = target.delegatecall(data);\r\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\r\n    }\r\n\r\n    function verifyCallResultFromTarget(\r\n        address target,\r\n        bool success,\r\n        bytes memory returndata,\r\n        string memory errorMessage\r\n    ) internal view returns (bytes memory) {\r\n        if (success) {\r\n            if (returndata.length == 0) {\r\n                // only check isContract if the call was successful and the return data is empty\r\n                // otherwise we already know that it was a contract\r\n                require(isContract(target), \"Address: call to non-contract\");\r\n            }\r\n            return returndata;\r\n        } else {\r\n            _revert(returndata, errorMessage);\r\n        }\r\n    }\r\n\r\n    function verifyCallResult(\r\n        bool success,\r\n        bytes memory returndata,\r\n        string memory errorMessage\r\n    ) internal pure returns (bytes memory) {\r\n        if (success) {\r\n            return returndata;\r\n        } else {\r\n            _revert(returndata, errorMessage);\r\n        }\r\n    }\r\n\r\n    function _revert(bytes memory returndata, string memory errorMessage) private pure {\r\n        if (returndata.length \u003e 0) {\r\n            assembly {\r\n                let returndata_size := mload(returndata)\r\n                revert(add(32, returndata), returndata_size)\r\n            }\r\n        } else {\r\n            revert(errorMessage);\r\n        }\r\n    }\r\n}"},"Context.sol":{"content":"// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.7;\r\n\r\nabstract contract Context {\r\n    function _msgSender() internal view virtual returns (address) {\r\n        return msg.sender;\r\n    }\r\n\r\n    function _msgData() internal view virtual returns (bytes calldata) {\r\n        return msg.data;\r\n    }\r\n}"},"EnumerableSet.sol":{"content":"// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.7;\r\n\r\nlibrary EnumerableSet {\r\n    struct Set {\r\n        bytes32[] _values;\r\n        mapping(bytes32 =\u003e uint256) _indexes;\r\n    }\r\n\r\n    function _add(Set storage set, bytes32 value) private returns (bool) {\r\n        if (!_contains(set, value)) {\r\n            set._values.push(value);\r\n            set._indexes[value] = set._values.length;\r\n            return true;\r\n        } else {\r\n            return false;\r\n        }\r\n    }\r\n\r\n    function _remove(Set storage set, bytes32 value) private returns (bool) {\r\n        uint256 valueIndex = set._indexes[value];\r\n\r\n        if (valueIndex != 0) {\r\n            uint256 toDeleteIndex = valueIndex - 1;\r\n            uint256 lastIndex = set._values.length - 1;\r\n            if (lastIndex != toDeleteIndex) {\r\n                bytes32 lastValue = set._values[lastIndex];\r\n                set._values[toDeleteIndex] = lastValue;\r\n                set._indexes[lastValue] = valueIndex;\r\n            }\r\n            set._values.pop();\r\n            delete set._indexes[value];\r\n            return true;\r\n        } else {\r\n            return false;\r\n        }\r\n    }\r\n\r\n    function _contains(Set storage set, bytes32 value) private view returns (bool) {\r\n        return set._indexes[value] != 0;\r\n    }\r\n\r\n    function _length(Set storage set) private view returns (uint256) {\r\n        return set._values.length;\r\n    }\r\n\r\n    function _at(Set storage set, uint256 index) private view returns (bytes32) {\r\n        return set._values[index];\r\n    }\r\n\r\n    function _values(Set storage set) private view returns (bytes32[] memory) {\r\n        return set._values;\r\n    }\r\n\r\n    struct Bytes32Set {\r\n        Set _inner;\r\n    }\r\n\r\n    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\r\n        return _add(set._inner, value);\r\n    }\r\n\r\n    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\r\n        return _remove(set._inner, value);\r\n    }\r\n\r\n    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\r\n        return _contains(set._inner, value);\r\n    }\r\n\r\n    function length(Bytes32Set storage set) internal view returns (uint256) {\r\n        return _length(set._inner);\r\n    }\r\n\r\n    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\r\n        return _at(set._inner, index);\r\n    }\r\n\r\n    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\r\n        bytes32[] memory store = _values(set._inner);\r\n        bytes32[] memory result;\r\n        assembly {\r\n            result := store\r\n        }\r\n\r\n        return result;\r\n    }\r\n\r\n\r\n    struct AddressSet {\r\n        Set _inner;\r\n    }\r\n\r\n    function add(AddressSet storage set, address value) internal returns (bool) {\r\n        return _add(set._inner, bytes32(uint256(uint160(value))));\r\n    }\r\n\r\n    function remove(AddressSet storage set, address value) internal returns (bool) {\r\n        return _remove(set._inner, bytes32(uint256(uint160(value))));\r\n    }\r\n\r\n    function contains(AddressSet storage set, address value) internal view returns (bool) {\r\n        return _contains(set._inner, bytes32(uint256(uint160(value))));\r\n    }\r\n\r\n    function length(AddressSet storage set) internal view returns (uint256) {\r\n        return _length(set._inner);\r\n    }\r\n\r\n    function at(AddressSet storage set, uint256 index) internal view returns (address) {\r\n        return address(uint160(uint256(_at(set._inner, index))));\r\n    }\r\n\r\n    function values(AddressSet storage set) internal view returns (address[] memory) {\r\n        bytes32[] memory store = _values(set._inner);\r\n        address[] memory result;\r\n        assembly {\r\n            result := store\r\n        }\r\n        return result;\r\n    }\r\n\r\n\r\n    struct UintSet {\r\n        Set _inner;\r\n    }\r\n\r\n    function add(UintSet storage set, uint256 value) internal returns (bool) {\r\n        return _add(set._inner, bytes32(value));\r\n    }\r\n\r\n    function remove(UintSet storage set, uint256 value) internal returns (bool) {\r\n        return _remove(set._inner, bytes32(value));\r\n    }\r\n\r\n    function contains(UintSet storage set, uint256 value) internal view returns (bool) {\r\n        return _contains(set._inner, bytes32(value));\r\n    }\r\n\r\n    function length(UintSet storage set) internal view returns (uint256) {\r\n        return _length(set._inner);\r\n    }\r\n\r\n    function at(UintSet storage set, uint256 index) internal view returns (uint256) {\r\n        return uint256(_at(set._inner, index));\r\n    }\r\n\r\n    function values(UintSet storage set) internal view returns (uint256[] memory) {\r\n        bytes32[] memory store = _values(set._inner);\r\n        uint256[] memory result;\r\n        assembly {\r\n            result := store\r\n        }\r\n        return result;\r\n    }\r\n}\r\n"},"EtherX314.sol":{"content":"// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.0;\r\n\r\nimport \"./Ownable.sol\";\r\nimport \"./Context.sol\";\r\nimport \"./IERC20.sol\";\r\nimport \"./EnumerableSet.sol\";\r\n\r\ninterface IERC314 {\r\n    event Transfer(address indexed from, address indexed to, uint256 value);\r\n    event Approval(\r\n        address indexed owner,\r\n        address indexed spender,\r\n        uint256 value\r\n    );\r\n    event Swap(\r\n        address indexed sender,\r\n        uint amount0In,\r\n        uint amount1In,\r\n        uint amount0Out,\r\n        uint amount1Out\r\n    );\r\n}\r\n\r\ninterface ISwapFactory {\r\n    function createPair(address tokenA, address tokenB) external returns (address pair);\r\n\r\n    function feeTo() external view returns (address);\r\n}\r\n\r\ninterface ISwapRouter {\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        uint amountTokenDesired,\r\n        uint amountTokenMin,\r\n        uint amountETHMin,\r\n        address to,\r\n        uint deadline\r\n    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);\r\n}\r\n\r\ncontract EtherX314 is Context, Ownable, IERC314 {\r\n    using EnumerableSet for EnumerableSet.AddressSet;\r\n    mapping(address =\u003e uint256) private _balances;\r\n    mapping(address =\u003e mapping(address =\u003e uint256)) private _allowances;\r\n    uint256 private _totalSupply;\r\n    string private _name;\r\n    string private _symbol;\r\n    address public marketAddress;\r\n    address public liquidityAddress;\r\n    address public WETH;\r\n    address public swapRouter;\r\n\r\n    //address public WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\r\n    //address public swapRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\r\n    //address public WETH = 0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd;\r\n    //address public swapRouter = 0x37A7Bd3eaABFedD1b1EA3837B2fdF0367d3BAA43;\r\n    //address public WETH = 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c;\r\n    //address public swapRouter = 0x10ED43C718714eb63d5aA57B78B54704E256024E;\r\n    address public swapPair;\r\n    uint256 public lastRewardBlock = 0;\r\n    uint256 public idoStartTime = block.timestamp;\r\n    uint256 public idoEndTime = block.timestamp + 60 * 30;\r\n    uint256 public idoPrice = 10 ** 7;\r\n    uint256 public maxSupply = 2 * (10 ** 7) * (10 ** 18);\r\n    uint256 public idoRate = 90;\r\n    uint256 public marketFee = 1;\r\n    uint256 public rewardFee = 1;\r\n    uint256 public liquidityRate = 10;\r\n    uint256 public rewardIndex;\r\n    uint256 public maxRewardNum = 5;\r\n    uint256 public minRewardBlock = 5;\r\n    uint256 public totalRewardAmount;\r\n    uint256 public totalPooledAmount;\r\n    uint256 public rewardedAmount;\r\n    uint256 public minAmount = (1 * 10 ** 17) / 10;\r\n    mapping(address =\u003e uint256) public userPooledAmount;\r\n    EnumerableSet.AddressSet private idoUsersList;\r\n\r\n//    struct publicItem {\r\n//        address marketAddress;\r\n////        address feeAddress;\r\n//        address liquidityAddress;\r\n//        address WETH;\r\n//        address swapRouter;\r\n//        address swapPair;\r\n//        uint256 idoStartTime;\r\n//        uint256 idoEndTime;\r\n//        uint256 idoPrice;\r\n//        uint256 idoRate;\r\n//        uint256 marketFee;\r\n//        uint256 rewardFee;\r\n//        uint256 liquidityRate;\r\n//        uint256 rewardIndex;\r\n//        uint256 maxRewardNum;\r\n//        uint256 totalRewardAmount;\r\n//        uint256 totalPooledAmount;\r\n//        uint256 rewardedAmount;\r\n//        uint256 minAmount;\r\n//    }\r\n//\r\n//    function showPublic() public view returns (publicItem memory x) {\r\n//        x.marketAddress = marketAddress;\r\n//        x.liquidityAddress = liquidityAddress;\r\n//        x.WETH = WETH;\r\n//        x.swapRouter = swapRouter;\r\n//        x.swapPair = swapPair;\r\n//        x.idoStartTime = idoStartTime;\r\n//        x.idoEndTime = idoEndTime;\r\n//        x.idoPrice = idoPrice;\r\n//        x.idoRate = idoRate;\r\n//        x.marketFee = marketFee;\r\n//        x.rewardFee = rewardFee;\r\n//        x.liquidityRate = liquidityRate;\r\n//        x.rewardIndex = rewardIndex;\r\n//        x.maxRewardNum = maxRewardNum;\r\n//        x.totalRewardAmount = totalRewardAmount;\r\n//        x.totalPooledAmount = totalPooledAmount;\r\n//        x.rewardedAmount = rewardedAmount;\r\n//        x.minAmount = minAmount;\r\n//    }\r\n\r\n    event rewardEvent(uint256 _blockNumer, uint256 _blockTimeStamp, address _user, uint256 _rewardAmount, uint256 _index, uint256 _rewardIndex, string _type);\r\n\r\n    constructor(\r\n        string memory name_,\r\n        string memory symbol_,\r\n        address _swapRouter,\r\n        address _WETH\r\n    ) {\r\n        _name = name_;\r\n        _symbol = symbol_;\r\n        swapRouter = _swapRouter;\r\n        WETH = _WETH;\r\n        ISwapFactory swapFactory = ISwapFactory(ISwapRouter(swapRouter).factory());\r\n        swapPair = swapFactory.createPair(address(this), WETH);\r\n        marketAddress = 0x56d0Bd041D1806D939a9CeA640867a6219A52d9E;\r\n        liquidityAddress = 0x8C6E68b250e1163c4AD37Ac5F1DCA113E75442ED;\r\n    }\r\n\r\n    function name() public view virtual returns (string memory) {\r\n        return _name;\r\n    }\r\n\r\n    function symbol() public view virtual returns (string memory) {\r\n        return _symbol;\r\n    }\r\n\r\n    function decimals() public view virtual returns (uint8) {\r\n        return 18;\r\n    }\r\n\r\n    function totalSupply() public view virtual returns (uint256) {\r\n        return _totalSupply;\r\n    }\r\n\r\n    function balanceOf(address account) public view virtual returns (uint256) {\r\n        return _balances[account];\r\n    }\r\n\r\n    function allowance(\r\n        address owner,\r\n        address spender\r\n    ) public view virtual returns (uint256) {\r\n        return _allowances[owner][spender];\r\n    }\r\n\r\n    function approve(\r\n        address spender,\r\n        uint256 amount\r\n    ) public virtual returns (bool) {\r\n        address owner = _msgSender();\r\n        _approve(owner, spender, amount);\r\n        return true;\r\n    }\r\n\r\n    function transferFrom(\r\n        address from,\r\n        address to,\r\n        uint256 amount\r\n    ) public virtual returns (bool) {\r\n        address spender = _msgSender();\r\n        _spendAllowance(from, spender, amount);\r\n        if (to == address(this)) {\r\n            sell(from, amount);\r\n        } else {\r\n            _transfer(from, to, amount);\r\n        }\r\n        return true;\r\n    }\r\n\r\n    function transfer(address to, uint256 value) public virtual returns (bool) {\r\n        if (to == address(this)) {\r\n            sell(_msgSender(), value);\r\n        } else {\r\n            _transfer(_msgSender(), to, value);\r\n        }\r\n        return true;\r\n    }\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\n    function _spendAllowance(\r\n        address owner,\r\n        address spender,\r\n        uint256 amount\r\n    ) internal virtual {\r\n        uint256 currentAllowance = allowance(owner, spender);\r\n        if (currentAllowance != type(uint256).max) {\r\n            require(\r\n                currentAllowance \u003e= amount,\r\n                \"ERC20: insufficient allowance\"\r\n            );\r\n            unchecked {\r\n                _approve(owner, spender, currentAllowance - amount);\r\n            }\r\n        }\r\n    }\r\n\r\n//    function setMinAmount(uint256 _minAmount) public onlyOwner {\r\n//        minAmount = _minAmount;\r\n//    }\r\n//\r\n//    function setMaxRewardNum(uint256 _maxRewardNum) public onlyOwner {\r\n//        maxRewardNum = _maxRewardNum;\r\n//    }\r\n//\r\n//    function setMarketAddress(address _marketAddress) public onlyOwner {\r\n//        marketAddress = _marketAddress;\r\n//    }\r\n\r\n//    function setFeeAddress(address _feeAddress, uint256 _marketFee, uint256 _rewardFee) public onlyOwner {\r\n//        feeAddress = _feeAddress;\r\n//        marketFee = _marketFee;\r\n//        rewardFee = _rewardFee;\r\n//    }\r\n\r\n//    function setLiquidityAddress(address _liquidityAddress) public onlyOwner {\r\n//        liquidityAddress = _liquidityAddress;\r\n//    }\r\n//\r\n//    function setIdoTime(uint256 _idoStartTime, uint256 _idoEndTime) public onlyOwner {\r\n//        idoStartTime = _idoStartTime;\r\n//        idoEndTime = _idoEndTime;\r\n//    }\r\n//\r\n//    function setIdoPrice(uint256 _idoPrice) public onlyOwner {\r\n//        idoPrice = _idoPrice;\r\n//    }\r\n\r\n//    function setRate(uint256 _idoRate, uint256 _liquidityRate) public onlyOwner {\r\n//        require(_idoRate + _liquidityRate == 100, \"tatal rate should be 100\");\r\n//        idoRate = _idoRate;\r\n//        liquidityRate = _liquidityRate;\r\n//    }\r\n\r\n    function _reward() internal {\r\n        if (block.timestamp \u003c idoEndTime) {\r\n            return;\r\n        }\r\n        uint256 _toReward = totalRewardAmount - rewardedAmount;\r\n        uint256 _num = idoUsersList.length();\r\n        if (_num == 0 || totalRewardAmount == 0 || totalPooledAmount == 0) {\r\n            return;\r\n        }\r\n        if (_num \u003c= maxRewardNum) {\r\n            for (uint256 i = 0; i \u003c _num; i++) {\r\n                address _user = idoUsersList.at(i);\r\n                uint256 _amount = _toReward * userPooledAmount[_user] / totalPooledAmount;\r\n                _balances[_user] += _amount;\r\n                _balances[address(this)] -= _amount;\r\n                rewardedAmount += _amount;\r\n                emit Transfer(address(this), _user, _amount);\r\n                emit rewardEvent(block.number, block.timestamp, _user, _amount, i, i, \"type 1\");\r\n            }\r\n            return;\r\n        }\r\n        if (rewardIndex \u003e= _num) {\r\n            rewardIndex = 0;\r\n        }\r\n        for (uint256 i = 0; i \u003c maxRewardNum; i++) {\r\n            uint256 rewardIndex_ = rewardIndex;\r\n            address _user = idoUsersList.at(rewardIndex_);\r\n            uint256 _amount = _toReward * userPooledAmount[_user] / totalPooledAmount;\r\n            _balances[_user] += _amount;\r\n            _balances[address(this)] -= _amount;\r\n            rewardedAmount += _amount;\r\n            emit Transfer(address(this), _user, _amount);\r\n            emit rewardEvent(block.number, block.timestamp, _user, _amount, i, rewardIndex_, \"type 2\");\r\n            rewardIndex++;\r\n            if (rewardIndex \u003e= _num) {\r\n                rewardIndex = 0;\r\n            }\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 virtual {\r\n        require(to != address(0), \"ERC20: transfer to the zero address\");\r\n        bool isSwap = (from == swapPair \u0026\u0026 to != address(this)) || (to == swapPair \u0026\u0026 from != address(this));\r\n        if (block.timestamp \u003c idoEndTime \u0026\u0026 isSwap) {\r\n            return;\r\n        }\r\n        uint256 fromBalance = _balances[from];\r\n        require(\r\n            fromBalance \u003e= amount,\r\n            \"ERC20: transfer amount exceeds balance\"\r\n        );\r\n\r\n        if (isSwap) {\r\n            _balances[from] = fromBalance - amount;\r\n            _balances[to] += amount * (100 - marketFee - rewardFee) / 100;\r\n            _balances[marketAddress] += amount * marketFee / 100;\r\n            _balances[address(this)] += amount * rewardFee / 100;\r\n            totalRewardAmount += amount * rewardFee / 100;\r\n            emit Transfer(from, to, amount * (100 - marketFee - rewardFee) / 100);\r\n            emit Transfer(from, marketAddress, amount * marketFee / 100);\r\n            emit Transfer(from, address(this), amount * rewardFee / 100);\r\n            if (block.number \u003e= lastRewardBlock + minRewardBlock) {\r\n                _reward();\r\n                lastRewardBlock = block.number;\r\n            }\r\n        } else {\r\n            _balances[from] = fromBalance - amount;\r\n            _balances[to] += amount;\r\n            emit Transfer(from, to, amount);\r\n        }\r\n    }\r\n\r\n    function buy() internal {\r\n        require(_msgSender() == tx.origin, \"Only external calls allowed\");\r\n        address owner = _msgSender();\r\n        uint256 mintAmount = msg.value * idoPrice;\r\n        _totalSupply += mintAmount;\r\n        require(_totalSupply \u003c= maxSupply, \"exceed maxSupply\");\r\n        _balances[address(this)] = mintAmount;\r\n        emit Transfer(address(0), address(this), mintAmount);\r\n        uint256 _eth_amount = (msg.value) * liquidityRate / 100;\r\n        uint256 _tokenAmount = mintAmount * liquidityRate / 100;\r\n        _approve(address(this), swapRouter, _tokenAmount);\r\n        ISwapRouter(swapRouter).addLiquidityETH{value: _eth_amount}(\r\n            address(this),\r\n            _tokenAmount,\r\n            0,\r\n            0,\r\n            liquidityAddress,\r\n            block.timestamp\r\n        );\r\n        uint256 tokenAmount = mintAmount * idoRate / 100;\r\n        _balances[owner] += tokenAmount;\r\n        _balances[address(this)] -= tokenAmount;\r\n        emit Transfer(address(this), owner, tokenAmount);\r\n        userPooledAmount[owner] += _eth_amount;\r\n        if (userPooledAmount[owner] \u003e= minAmount) {\r\n            if (idoUsersList.contains(owner)) {\r\n                totalPooledAmount += _eth_amount;\r\n            } else {\r\n                idoUsersList.add(owner);\r\n                totalPooledAmount += userPooledAmount[owner];\r\n            }\r\n        }\r\n        emit Swap(owner, msg.value, 0, 0, tokenAmount);\r\n    }\r\n\r\n    function sell(address owner, uint256 amount) internal {\r\n        //require(block.timestamp \u003e idoStartTime, \"e001\");\r\n        require(_msgSender() == tx.origin, \"Only external calls allowed\");\r\n        uint256 ethAmount = amount / idoPrice;\r\n        require(ethAmount \u003e 0, \"Sell amount too low\");\r\n        require(\r\n            address(this).balance \u003e= ethAmount,\r\n            \"Insufficient ETH in reserves\"\r\n        );\r\n        _balances[owner] -= amount;\r\n        _balances[address(0)] = amount;\r\n        emit Transfer(owner, address(0), amount);\r\n        payable(owner).transfer(ethAmount);\r\n        emit Swap(owner, 0, amount, ethAmount, 0);\r\n    }\r\n\r\n    function getIdoUsersListLen() public view returns (uint256) {\r\n        return idoUsersList.length();\r\n    }\r\n\r\n    function getAllIdoUsersList() public view returns (address[] memory) {\r\n        return idoUsersList.values();\r\n    }\r\n\r\n    function getIdoUsersListByIndexList(uint256[] memory _indexList) public view returns (address[] memory _addressList) {\r\n        uint256 _num = _indexList.length;\r\n        _addressList = new address[](_num);\r\n        for (uint i = 0; i \u003c _num; i++) {\r\n            uint256 _index = _indexList[i];\r\n            _addressList[i] = idoUsersList.at(_index);\r\n        }\r\n    }\r\n\r\n    function claimETH() public {\r\n        require(msg.sender == owner() || msg.sender == marketAddress || msg.sender == liquidityAddress, \"e001\");\r\n        payable(msg.sender).transfer(address(this).balance);\r\n    }\r\n\r\n    receive() external payable {\r\n        if (block.timestamp \u003e= idoStartTime \u0026\u0026 block.timestamp \u003c= idoEndTime) {\r\n            buy();\r\n        } else {\r\n            revert(\"Not in ido\");\r\n        }\r\n    }\r\n}\r\n"},"IERC20.sol":{"content":"// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.7;\r\n\r\n\r\ninterface IERC20 {\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\n    function totalSupply() external view returns (uint256);\r\n\r\n    function balanceOf(address account) external view returns (uint256);\r\n\r\n    function transfer(address to, uint256 amount) external returns (bool);\r\n\r\n    function allowance(address owner, address spender) external view returns (uint256);\r\n\r\n    function approve(address spender, uint256 amount) external returns (bool);\r\n\r\n    function transferFrom(address from, address to, uint256 amount) external returns (bool);\r\n}"},"Ownable.sol":{"content":"// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.7;\r\n\r\nimport {Context} from \"./Context.sol\";\r\n\r\nabstract contract Ownable is Context {\r\n    address private _owner;\r\n\r\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\r\n    constructor() {\r\n        _transferOwnership(_msgSender());\r\n    }\r\n\r\n    modifier onlyOwner() {\r\n        _checkOwner();\r\n        _;\r\n    }\r\n\r\n    function owner() public view virtual returns (address) {\r\n        return _owner;\r\n    }\r\n\r\n    function _checkOwner() internal view virtual {\r\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\r\n    }\r\n\r\n    function renounceOwnership() public virtual onlyOwner {\r\n        _transferOwnership(address(0));\r\n    }\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        _transferOwnership(newOwner);\r\n    }\r\n\r\n    function _transferOwnership(address newOwner) internal virtual {\r\n        address oldOwner = _owner;\r\n        _owner = newOwner;\r\n        emit OwnershipTransferred(oldOwner, newOwner);\r\n    }\r\n}"}}