File size: 34,868 Bytes
f998fcd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{
  "language": "Solidity",
  "sources": {
    "contracts/Ronin.sol": {
      "content": "// SPDX-License-Identifier: MIT\n\n/**\n47 Ronin\n\n“A man will only be as long as his life but his name will be for all time.”\n\nEvery 47th Ronin will earn the treasury of his life..\n*/\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\";\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\";\n\n\ncontract Ronin is Context, IERC20Metadata, Ownable {\n    using SafeMath for uint256;\n\n    string private constant NAME = \"47 Ronin\";\n    string private constant SYMBOL = \"47RONIN\";\n    uint8 private constant DECIMALS = 18;\n\n    uint256 private constant _totalSupply = 47000000 * 10 ** DECIMALS;\n    mapping(address => mapping(address => uint256)) private _allowances;\n    mapping(address => uint256) private _balances;\n\n    bool public _tradingOpen = false;\n\n    uint256 public _rewardBuyFee;\n    uint256 public _marketingBuyFee;\n    uint256 public _liquidityBuyFee;\n    uint256 public _rewardSellFee;\n    uint256 public _marketingSellFee;\n    uint256 public _liquiditySellFee;\n    uint256 public constant _maxFeePercentage = 10;\n    address public _marketingWallet;\n    address public _liquidityWallet;\n    uint256 private _marketingBalance;\n    uint256 private _rewardBalance;\n    uint256 private _liquidityBalance;\n    mapping(address => bool) private _feeExclusions;\n\n    uint256 public _rewardCounter;\n    uint256 public _rewardMinBuy = 1 * 10 ** (DECIMALS) / 10; //0.1 eth\n    address public _lastWinner;\n    uint256 private constant FORTY_SEVEN = 23;\n    uint256 private constant ROUTER_FEE_PCT = 30; //uniswap take 0.3%\n    uint256 private constant MAX_PCT = 10000;\n\n    uint256 public _transactionUpperLimit = _totalSupply;\n    uint256 private constant MIN_TRANS_UPPER_LIMIT = _totalSupply / 1000;\n    mapping(address => bool) private _limitExclusions;\n\n    uint8 constant FEE_EXEMPT = 0;\n    uint8 constant TRANSFER = 1;\n    uint8 constant BUY = 2;\n    uint8 constant SELL = 3;\n\n    IUniswapV2Router02 private _swapRouter;\n    address public _swapPair;\n    bool private _inSwap;\n\n    event UpdateRewardCounter(\n        uint256 currentCounter\n    );\n\n    event Reward(\n        address winner,\n        uint256 tokenAmount\n    );\n\n    event SwapAndLiquify(\n        uint256 tokensSwapped,\n        uint256 ethReceived,\n        uint256 tokensIntoLiquidity\n    );\n\n    constructor(address routerAddress) {\n        _balances[_msgSender()] = totalSupply();\n\n        _feeExclusions[address(this)] = true;\n        _feeExclusions[_msgSender()] = true;\n        _limitExclusions[_msgSender()] = true;\n\n        _marketingWallet = _msgSender();\n        _liquidityWallet = _msgSender();\n\n        setFees(3, 2, 1, 5, 2, 1);\n        setTransactionUpperLimit(_totalSupply / 100 + 1);\n        if (routerAddress != address(0)) {\n            setSwapRouter(routerAddress);\n        }\n\n        emit Transfer(address(0), _msgSender(), totalSupply());\n    }\n\n    modifier swapping() {\n        _inSwap = true;\n        _;\n        _inSwap = false;\n    }\n\n    receive() external payable {}\n\n    function setFeeWallets(\n        address marketingWallet,\n        address liquidityWallet\n    )\n    external\n    onlyOwner\n    {\n        _marketingWallet = marketingWallet;\n        _liquidityWallet = liquidityWallet;\n    }\n\n    function setExcludedFromFees(address addr, bool value) external onlyOwner {\n        _feeExclusions[addr] = value;\n    }\n\n    function setRewardMinBuy(uint256 rewardMinBuy) external onlyOwner {\n        _rewardMinBuy = _rewardMinBuy;\n    }\n\n    function openTrading() external onlyOwner {\n        _tradingOpen = true;\n    }\n\n    function removeLimit() external onlyOwner {\n        _transactionUpperLimit = _totalSupply;\n    }\n\n    function setFees(\n        uint256 marketingBuyFee,\n        uint256 rewardBuyFee,\n        uint256 liquidityBuyFee,\n        uint256 marketingSellFee,\n        uint256 rewardSellFee,\n        uint256 liquiditySellFee\n    )\n    public\n    onlyOwner\n    {\n        require(_maxFeePercentage >= marketingBuyFee + rewardBuyFee + liquidityBuyFee);\n        require(_maxFeePercentage >= marketingSellFee + rewardSellFee + liquiditySellFee);\n        _marketingBuyFee = marketingBuyFee;\n        _rewardBuyFee = rewardBuyFee;\n        _liquidityBuyFee = liquidityBuyFee;\n        _marketingSellFee = marketingSellFee;\n        _rewardSellFee = rewardSellFee;\n        _liquiditySellFee = liquiditySellFee;\n    }\n\n    function isExcludedFromFees(address addr)\n    public\n    view\n    returns (bool)\n    {\n        return _feeExclusions[addr];\n    }\n\n\n    function setTransactionUpperLimit(uint256 limit) public onlyOwner {\n        require(limit > MIN_TRANS_UPPER_LIMIT);\n        _transactionUpperLimit = limit;\n    }\n\n    function setLimitExclusions(address addr, bool value) public onlyOwner {\n        _limitExclusions[addr] = value;\n    }\n\n    function isExcludedFromLimit(address addr)\n    public\n    view\n    returns (bool)\n    {\n        return _limitExclusions[addr];\n    }\n\n    function setSwapRouter(address routerAddress) public onlyOwner {\n        require(routerAddress != address(0), \"Invalid router address\");\n\n        _swapRouter = IUniswapV2Router02(routerAddress);\n        _approve(address(this), routerAddress, type(uint256).max);\n\n        _swapPair = IUniswapV2Factory(_swapRouter.factory()).getPair(address(this), _swapRouter.WETH());\n        if (_swapPair == address(0)) {// pair doesn't exist beforehand\n            _swapPair = IUniswapV2Factory(_swapRouter.factory()).createPair(address(this), _swapRouter.WETH());\n        }\n    }\n\n    //// internal\n    function _approve(address owner, address spender, uint256 amount) private {\n        require(owner != address(0), \"Invalid owner address\");\n        require(spender != address(0), \"Invalid spender address\");\n\n        _allowances[owner][spender] = amount;\n        emit Approval(owner, spender, amount);\n    }\n\n    function _transfer(address sender, address recipient, uint256 amount) internal virtual {\n        require(sender != address(0), \"Invalid sender address\");\n        require(recipient != address(0), \"Invalid recipient address\");\n        require(amount > 0, \"Invalid transferring amount\");\n\n        if (!isExcludedFromLimit(sender) && !isExcludedFromLimit(recipient)) {\n            require(amount <= _transactionUpperLimit, \"Transferring amount exceeds the maximum allowed\");\n            require(_tradingOpen, \"Trading is not open\");\n        }\n\n        if (_inSwap) {\n            basicTransfer(sender, recipient, amount);\n            return;\n        }\n\n        _balances[sender] = _balances[sender].sub(amount, \"Insufficient balance\");\n        uint8 transferType = transferType(sender, recipient);\n        uint256 afterFeeAmount = takeFees(amount, transferType);\n        _balances[recipient] = _balances[recipient].add(afterFeeAmount);\n\n\n        if (transferType == BUY || transferType == SELL) {\n            _rewardCounter++;\n            if (shouldReward(amount, transferType)) {\n                //Only reward on BUY transaction => Then we send the reward for recipient (buyer)\n                reward(recipient);\n            }\n            emit UpdateRewardCounter(_rewardCounter);\n        }\n\n        emit Transfer(sender, recipient, afterFeeAmount);\n    }\n\n    function transferType(address from, address to) internal view returns (uint8) {\n        if (isExcludedFromFees(from) || isExcludedFromFees(to)) return FEE_EXEMPT;\n        if (from == _swapPair) return BUY;\n        if (to == _swapPair) return SELL;\n        return TRANSFER;\n    }\n\n    function basicTransfer(address sender, address recipient, uint256 amount) internal {\n        _balances[sender] = _balances[sender].sub(amount, \"Insufficient Balance\");\n        _balances[recipient] = _balances[recipient].add(amount);\n        emit Transfer(sender, recipient, amount);\n    }\n\n    function takeFees(uint256 amount, uint8 transferType) private returns (uint256) {\n        if (transferType != BUY && transferType != SELL) {\n            return amount;\n        }\n        uint256 marketingPercentage = transferType == BUY ? _marketingBuyFee : _marketingSellFee;\n        uint256 rewardPercentage = transferType == BUY ? _rewardBuyFee : _rewardSellFee;\n        uint256 liquidityPercentage = transferType == BUY ? _liquidityBuyFee : _liquiditySellFee;\n\n        uint256 marketingFee = amount.mul(marketingPercentage).div(100);\n        uint256 rewardFee = amount.mul(rewardPercentage).div(100);\n        uint256 liquidityFee = amount.mul(liquidityPercentage).div(100);\n\n        _marketingBalance += marketingFee;\n        _rewardBalance += rewardFee;\n        _liquidityBalance += liquidityFee;\n\n        uint256 totalFee = marketingFee.add(rewardFee).add(liquidityFee);\n        _balances[address(this)] = _balances[address(this)].add(totalFee);\n        uint256 afterFeeAmount = amount.sub(totalFee, \"Insufficient amount\");\n\n        if (shouldSwapFees(transferType)) {\n            swapFees();\n            swapAndLiquify();\n        }\n\n        return afterFeeAmount;\n    }\n\n    function shouldSwapFees(uint8 transferType) private returns (bool) {\n        return transferType == SELL && balanceOf(address(this)) > 0;\n    }\n\n    function swapFees() private swapping {\n        uint256 ethToMarketing = swapTokensForEth(_marketingBalance);\n        (bool successSentMarketing,) = _marketingWallet.call{value : ethToMarketing}(\"\");\n        _marketingBalance = 0;\n    }\n\n    function swapAndLiquify() private swapping {\n        uint256 half = _liquidityBalance.div(2);\n        uint256 otherHalf = _liquidityBalance.sub(half);\n        uint256 ethToLiquidity = swapTokensForEth(half);\n        _swapRouter.addLiquidityETH{value : ethToLiquidity}(\n            address(this),\n            otherHalf,\n            0, // slippage is unavoidable\n            0, // slippage is unavoidable\n            _liquidityWallet,\n            block.timestamp\n        );\n        _liquidityBalance = 0;\n\n        emit SwapAndLiquify(half, ethToLiquidity, otherHalf);\n    }\n\n    function swapTokensForEth(uint256 amount) internal returns (uint256) {\n        address[] memory path = new address[](2);\n        path[0] = address(this);\n        path[1] = _swapRouter.WETH();\n\n        // Swap\n        _swapRouter.swapExactTokensForETH(amount, 0, path, address(this), block.timestamp + 360);\n\n        // Return the amount received\n        return address(this).balance;\n    }\n\n    function shouldReward(uint256 amount, uint8 transferType) private returns (bool){\n        if (transferType != BUY) {\n            return false;\n        }\n        if (_rewardCounter < FORTY_SEVEN) {\n            return false;\n        }\n        if (_rewardMinBuy == 0) {\n            return true;\n        }\n        address[] memory path = new address[](2);\n        path[0] = _swapRouter.WETH();\n        path[1] = address(this);\n\n        // We don't subtract the buy fee since the amount is pre-tax\n        uint256 tokensOut = _swapRouter.getAmountsOut(_rewardMinBuy, path)[1].mul(MAX_PCT.sub(ROUTER_FEE_PCT)).div(MAX_PCT);\n        return amount >= tokensOut;\n    }\n\n    function reward(address winner) private {\n        uint256 rewardAmount = _rewardBalance;\n        _lastWinner = winner;\n        _rewardCounter = 0;\n        _rewardBalance = 0;\n        basicTransfer(address(this), winner, rewardAmount);\n\n        emit Reward(winner, rewardAmount);\n    }\n\n    //// private\n    //// view / pure\n    function totalFee()\n    external\n    view\n    returns (uint256)\n    {\n        return _marketingBuyFee.add(_rewardBuyFee).add(_liquidityBuyFee);\n    }\n\n    //region IERC20\n    function totalSupply()\n    public\n    override\n    pure\n    returns (uint256) {\n        return _totalSupply;\n    }\n\n    function allowance(address owner, address spender)\n    public\n    view\n    override\n    returns (uint256)\n    {\n        return _allowances[owner][spender];\n    }\n\n    function balanceOf(address account)\n    public\n    view\n    override\n    returns (uint256)\n    {\n        return _balances[account];\n    }\n\n    function transfer(address recipient, uint256 amount)\n    public\n    override\n    returns (bool)\n    {\n        _transfer(_msgSender(), recipient, amount);\n        return true;\n    }\n\n    function approve(address spender, uint256 amount)\n    public\n    override\n    returns (bool)\n    {\n        _approve(_msgSender(), spender, amount);\n        return true;\n    }\n\n    function transferFrom(\n        address sender,\n        address recipient,\n        uint256 amount\n    )\n    public\n    override\n    returns (bool)\n    {\n        if (_allowances[sender][msg.sender] != type(uint256).max) {\n            _allowances[sender][_msgSender()] = _allowances[sender][_msgSender()].sub(amount, \"Insufficient allowance\");\n        }\n        _transfer(sender, recipient, amount);\n        return true;\n    }\n\n    //region IERC20Metadata\n    function name()\n    public\n    override\n    pure\n    returns (string memory)\n    {\n        return NAME;\n    }\n\n    function symbol()\n    public\n    override\n    pure\n    returns (string memory)\n    {\n        return SYMBOL;\n    }\n\n    function decimals()\n    public\n    override\n    pure\n    returns (uint8)\n    {\n        return DECIMALS;\n    }\n}\n"
    },
    "@openzeppelin/contracts/utils/Context.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n}\n"
    },
    "@openzeppelin/contracts/utils/math/SafeMath.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)\n\npragma solidity ^0.8.0;\n\n// CAUTION\n// This version of SafeMath should only be used with Solidity 0.8 or later,\n// because it relies on the compiler's built in overflow checks.\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations.\n *\n * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler\n * now has built in overflow checking.\n */\nlibrary SafeMath {\n    /**\n     * @dev Returns the addition of two unsigned integers, with an overflow flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            uint256 c = a + b;\n            if (c < a) return (false, 0);\n            return (true, c);\n        }\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.\n     *\n     * _Available since v3.4._\n     */\n    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            if (b > a) return (false, 0);\n            return (true, a - b);\n        }\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n            // benefit is lost if 'b' is also tested.\n            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n            if (a == 0) return (true, 0);\n            uint256 c = a * b;\n            if (c / a != b) return (false, 0);\n            return (true, c);\n        }\n    }\n\n    /**\n     * @dev Returns the division of two unsigned integers, with a division by zero flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            if (b == 0) return (false, 0);\n            return (true, a / b);\n        }\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            if (b == 0) return (false, 0);\n            return (true, a % b);\n        }\n    }\n\n    /**\n     * @dev Returns the addition of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity's `+` operator.\n     *\n     * Requirements:\n     *\n     * - Addition cannot overflow.\n     */\n    function add(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a + b;\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, reverting on\n     * overflow (when the result is negative).\n     *\n     * Counterpart to Solidity's `-` operator.\n     *\n     * Requirements:\n     *\n     * - Subtraction cannot overflow.\n     */\n    function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a - b;\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity's `*` operator.\n     *\n     * Requirements:\n     *\n     * - Multiplication cannot overflow.\n     */\n    function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a * b;\n    }\n\n    /**\n     * @dev Returns the integer division of two unsigned integers, reverting on\n     * division by zero. The result is rounded towards zero.\n     *\n     * Counterpart to Solidity's `/` operator.\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function div(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a / b;\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n     * reverting when dividing by zero.\n     *\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\n     * invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a % b;\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n     * overflow (when the result is negative).\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {trySub}.\n     *\n     * Counterpart to Solidity's `-` operator.\n     *\n     * Requirements:\n     *\n     * - Subtraction cannot overflow.\n     */\n    function sub(\n        uint256 a,\n        uint256 b,\n        string memory errorMessage\n    ) internal pure returns (uint256) {\n        unchecked {\n            require(b <= a, errorMessage);\n            return a - b;\n        }\n    }\n\n    /**\n     * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n     * division by zero. The result is rounded towards zero.\n     *\n     * Counterpart to Solidity's `/` operator. Note: this function uses a\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\n     * uses an invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function div(\n        uint256 a,\n        uint256 b,\n        string memory errorMessage\n    ) internal pure returns (uint256) {\n        unchecked {\n            require(b > 0, errorMessage);\n            return a / b;\n        }\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n     * reverting with custom message when dividing by zero.\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {tryMod}.\n     *\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\n     * invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function mod(\n        uint256 a,\n        uint256 b,\n        string memory errorMessage\n    ) internal pure returns (uint256) {\n        unchecked {\n            require(b > 0, errorMessage);\n            return a % b;\n        }\n    }\n}\n"
    },
    "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() external view returns (string memory);\n\n    /**\n     * @dev Returns the symbol of the token.\n     */\n    function symbol() external view returns (string memory);\n\n    /**\n     * @dev Returns the decimals places of the token.\n     */\n    function decimals() external view returns (uint8);\n}\n"
    },
    "@openzeppelin/contracts/access/Ownable.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the deployer as the initial owner.\n     */\n    constructor() {\n        _transferOwnership(_msgSender());\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        _checkOwner();\n        _;\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby removing any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n"
    },
    "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol": {
      "content": "pragma solidity >=0.6.2;\n\nimport './IUniswapV2Router01.sol';\n\ninterface IUniswapV2Router02 is IUniswapV2Router01 {\n    function removeLiquidityETHSupportingFeeOnTransferTokens(\n        address token,\n        uint liquidity,\n        uint amountTokenMin,\n        uint amountETHMin,\n        address to,\n        uint deadline\n    ) external returns (uint amountETH);\n    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(\n        address token,\n        uint liquidity,\n        uint amountTokenMin,\n        uint amountETHMin,\n        address to,\n        uint deadline,\n        bool approveMax, uint8 v, bytes32 r, bytes32 s\n    ) external returns (uint amountETH);\n\n    function swapExactTokensForTokensSupportingFeeOnTransferTokens(\n        uint amountIn,\n        uint amountOutMin,\n        address[] calldata path,\n        address to,\n        uint deadline\n    ) external;\n    function swapExactETHForTokensSupportingFeeOnTransferTokens(\n        uint amountOutMin,\n        address[] calldata path,\n        address to,\n        uint deadline\n    ) external payable;\n    function swapExactTokensForETHSupportingFeeOnTransferTokens(\n        uint amountIn,\n        uint amountOutMin,\n        address[] calldata path,\n        address to,\n        uint deadline\n    ) external;\n}\n"
    },
    "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol": {
      "content": "pragma solidity >=0.5.0;\n\ninterface IUniswapV2Factory {\n    event PairCreated(address indexed token0, address indexed token1, address pair, uint);\n\n    function feeTo() external view returns (address);\n    function feeToSetter() external view returns (address);\n\n    function getPair(address tokenA, address tokenB) external view returns (address pair);\n    function allPairs(uint) external view returns (address pair);\n    function allPairsLength() external view returns (uint);\n\n    function createPair(address tokenA, address tokenB) external returns (address pair);\n\n    function setFeeTo(address) external;\n    function setFeeToSetter(address) external;\n}\n"
    },
    "@openzeppelin/contracts/token/ERC20/IERC20.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `from` to `to` using the\n     * allowance mechanism. `amount` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(\n        address from,\n        address to,\n        uint256 amount\n    ) external returns (bool);\n}\n"
    },
    "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol": {
      "content": "pragma solidity >=0.6.2;\n\ninterface IUniswapV2Router01 {\n    function factory() external pure returns (address);\n    function WETH() external pure returns (address);\n\n    function addLiquidity(\n        address tokenA,\n        address tokenB,\n        uint amountADesired,\n        uint amountBDesired,\n        uint amountAMin,\n        uint amountBMin,\n        address to,\n        uint deadline\n    ) external returns (uint amountA, uint amountB, uint liquidity);\n    function addLiquidityETH(\n        address token,\n        uint amountTokenDesired,\n        uint amountTokenMin,\n        uint amountETHMin,\n        address to,\n        uint deadline\n    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);\n    function removeLiquidity(\n        address tokenA,\n        address tokenB,\n        uint liquidity,\n        uint amountAMin,\n        uint amountBMin,\n        address to,\n        uint deadline\n    ) external returns (uint amountA, uint amountB);\n    function removeLiquidityETH(\n        address token,\n        uint liquidity,\n        uint amountTokenMin,\n        uint amountETHMin,\n        address to,\n        uint deadline\n    ) external returns (uint amountToken, uint amountETH);\n    function removeLiquidityWithPermit(\n        address tokenA,\n        address tokenB,\n        uint liquidity,\n        uint amountAMin,\n        uint amountBMin,\n        address to,\n        uint deadline,\n        bool approveMax, uint8 v, bytes32 r, bytes32 s\n    ) external returns (uint amountA, uint amountB);\n    function removeLiquidityETHWithPermit(\n        address token,\n        uint liquidity,\n        uint amountTokenMin,\n        uint amountETHMin,\n        address to,\n        uint deadline,\n        bool approveMax, uint8 v, bytes32 r, bytes32 s\n    ) external returns (uint amountToken, uint amountETH);\n    function swapExactTokensForTokens(\n        uint amountIn,\n        uint amountOutMin,\n        address[] calldata path,\n        address to,\n        uint deadline\n    ) external returns (uint[] memory amounts);\n    function swapTokensForExactTokens(\n        uint amountOut,\n        uint amountInMax,\n        address[] calldata path,\n        address to,\n        uint deadline\n    ) external returns (uint[] memory amounts);\n    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)\n        external\n        payable\n        returns (uint[] memory amounts);\n    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\n        external\n        returns (uint[] memory amounts);\n    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\n        external\n        returns (uint[] memory amounts);\n    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)\n        external\n        payable\n        returns (uint[] memory amounts);\n\n    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);\n    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);\n    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);\n    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);\n    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);\n}\n"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": false,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "metadata": {
      "useLiteralContent": true
    },
    "libraries": {}
  }
}