creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "@openzeppelin/contracts/access/Ownable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../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 * The initial owner is set to the address provided by the deployer. This can\n * 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    /**\n     * @dev The caller account is not authorized to perform an operation.\n     */\n    error OwnableUnauthorizedAccount(address account);\n\n    /**\n     * @dev The owner is not a valid owner account. (eg. `address(0)`)\n     */\n    error OwnableInvalidOwner(address owner);\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n     */\n    constructor(address initialOwner) {\n        if (initialOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(initialOwner);\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        if (owner() != _msgSender()) {\n            revert OwnableUnauthorizedAccount(_msgSender());\n        }\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby disabling 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        if (newOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\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"
      },
      "@openzeppelin/contracts/interfaces/draft-IERC6093.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.\n */\ninterface IERC20Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC20InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC20InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     * @param allowance Amount of tokens a `spender` is allowed to operate with.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC20InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.\n */\ninterface IERC721Errors {\n    /**\n     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.\n     * Used in balance queries.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721InvalidOwner(address owner);\n\n    /**\n     * @dev Indicates a `tokenId` whose `owner` is the zero address.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721NonexistentToken(uint256 tokenId);\n\n    /**\n     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param tokenId Identifier number of a token.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC721InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC721InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC721InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.\n */\ninterface IERC1155Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC1155InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC1155InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC1155MissingApprovalForAll(address operator, address owner);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC1155InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC1155InvalidOperator(address operator);\n\n    /**\n     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n     * Used in batch transfers.\n     * @param idsLength Length of the array of token identifiers\n     * @param valuesLength Length of the array of token amounts\n     */\n    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n"
      },
      "@openzeppelin/contracts/token/ERC20/ERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC20Metadata} from \"./extensions/IERC20Metadata.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {IERC20Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n */\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\n    mapping(address account => uint256) private _balances;\n\n    mapping(address account => mapping(address spender => uint256)) private _allowances;\n\n    uint256 private _totalSupply;\n\n    string private _name;\n    string private _symbol;\n\n    /**\n     * @dev Sets the values for {name} and {symbol}.\n     *\n     * All two of these values are immutable: they can only be set once during\n     * construction.\n     */\n    constructor(string memory name_, string memory symbol_) {\n        _name = name_;\n        _symbol = symbol_;\n    }\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() public view virtual returns (string memory) {\n        return _name;\n    }\n\n    /**\n     * @dev Returns the symbol of the token, usually a shorter version of the\n     * name.\n     */\n    function symbol() public view virtual returns (string memory) {\n        return _symbol;\n    }\n\n    /**\n     * @dev Returns the number of decimals used to get its user representation.\n     * For example, if `decimals` equals `2`, a balance of `505` tokens should\n     * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n     *\n     * Tokens usually opt for a value of 18, imitating the relationship between\n     * Ether and Wei. This is the default value returned by this function, unless\n     * it's overridden.\n     *\n     * NOTE: This information is only used for _display_ purposes: it in\n     * no way affects any of the arithmetic of the contract, including\n     * {IERC20-balanceOf} and {IERC20-transfer}.\n     */\n    function decimals() public view virtual returns (uint8) {\n        return 18;\n    }\n\n    /**\n     * @dev See {IERC20-totalSupply}.\n     */\n    function totalSupply() public view virtual returns (uint256) {\n        return _totalSupply;\n    }\n\n    /**\n     * @dev See {IERC20-balanceOf}.\n     */\n    function balanceOf(address account) public view virtual returns (uint256) {\n        return _balances[account];\n    }\n\n    /**\n     * @dev See {IERC20-transfer}.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - the caller must have a balance of at least `value`.\n     */\n    function transfer(address to, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _transfer(owner, to, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-allowance}.\n     */\n    function allowance(address owner, address spender) public view virtual returns (uint256) {\n        return _allowances[owner][spender];\n    }\n\n    /**\n     * @dev See {IERC20-approve}.\n     *\n     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\n     * `transferFrom`. This is semantically equivalent to an infinite approval.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function approve(address spender, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _approve(owner, spender, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-transferFrom}.\n     *\n     * Emits an {Approval} event indicating the updated allowance. This is not\n     * required by the EIP. See the note at the beginning of {ERC20}.\n     *\n     * NOTE: Does not update the allowance if the current allowance\n     * is the maximum `uint256`.\n     *\n     * Requirements:\n     *\n     * - `from` and `to` cannot be the zero address.\n     * - `from` must have a balance of at least `value`.\n     * - the caller must have allowance for ``from``'s tokens of at least\n     * `value`.\n     */\n    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n        address spender = _msgSender();\n        _spendAllowance(from, spender, value);\n        _transfer(from, to, value);\n        return true;\n    }\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to`.\n     *\n     * This internal function is equivalent to {transfer}, and can be used to\n     * e.g. implement automatic token fees, slashing mechanisms, etc.\n     *\n     * Emits a {Transfer} event.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _transfer(address from, address to, uint256 value) internal {\n        if (from == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        if (to == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(from, to, value);\n    }\n\n    /**\n     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n     * this function.\n     *\n     * Emits a {Transfer} event.\n     */\n    function _update(address from, address to, uint256 value) internal virtual {\n        if (from == address(0)) {\n            // Overflow check required: The rest of the code assumes that totalSupply never overflows\n            _totalSupply += value;\n        } else {\n            uint256 fromBalance = _balances[from];\n            if (fromBalance < value) {\n                revert ERC20InsufficientBalance(from, fromBalance, value);\n            }\n            unchecked {\n                // Overflow not possible: value <= fromBalance <= totalSupply.\n                _balances[from] = fromBalance - value;\n            }\n        }\n\n        if (to == address(0)) {\n            unchecked {\n                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\n                _totalSupply -= value;\n            }\n        } else {\n            unchecked {\n                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n                _balances[to] += value;\n            }\n        }\n\n        emit Transfer(from, to, value);\n    }\n\n    /**\n     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n     * Relies on the `_update` mechanism\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _mint(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(address(0), account, value);\n    }\n\n    /**\n     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n     * Relies on the `_update` mechanism.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead\n     */\n    function _burn(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        _update(account, address(0), value);\n    }\n\n    /**\n     * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.\n     *\n     * This internal function is equivalent to `approve`, and can be used to\n     * e.g. set automatic allowances for certain subsystems, etc.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `owner` cannot be the zero address.\n     * - `spender` cannot be the zero address.\n     *\n     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n     */\n    function _approve(address owner, address spender, uint256 value) internal {\n        _approve(owner, spender, value, true);\n    }\n\n    /**\n     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n     *\n     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\n     * `Approval` event during `transferFrom` operations.\n     *\n     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\n     * true using the following override:\n     * ```\n     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n     *     super._approve(owner, spender, value, true);\n     * }\n     * ```\n     *\n     * Requirements are the same as {_approve}.\n     */\n    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n        if (owner == address(0)) {\n            revert ERC20InvalidApprover(address(0));\n        }\n        if (spender == address(0)) {\n            revert ERC20InvalidSpender(address(0));\n        }\n        _allowances[owner][spender] = value;\n        if (emitEvent) {\n            emit Approval(owner, spender, value);\n        }\n    }\n\n    /**\n     * @dev Updates `owner` s allowance for `spender` based on spent `value`.\n     *\n     * Does not update the allowance value in case of infinite allowance.\n     * Revert if not enough allowance is available.\n     *\n     * Does not emit an {Approval} event.\n     */\n    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n        uint256 currentAllowance = allowance(owner, spender);\n        if (currentAllowance != type(uint256).max) {\n            if (currentAllowance < value) {\n                revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n            }\n            unchecked {\n                _approve(owner, spender, currentAllowance - value, false);\n            }\n        }\n    }\n}\n"
      },
      "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\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/token/ERC20/IERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\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 value of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the value of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens as the allowance of `spender` over the\n     * 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 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\n     * allowance mechanism. `value` 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(address from, address to, uint256 value) external returns (bool);\n}\n"
      },
      "@openzeppelin/contracts/utils/Context.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\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    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\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"
      },
      "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol": {
        "content": "pragma solidity >=0.5.0;\n\ninterface IUniswapV2Pair {\n    event Approval(address indexed owner, address indexed spender, uint value);\n    event Transfer(address indexed from, address indexed to, uint value);\n\n    function name() external pure returns (string memory);\n    function symbol() external pure returns (string memory);\n    function decimals() external pure returns (uint8);\n    function totalSupply() external view returns (uint);\n    function balanceOf(address owner) external view returns (uint);\n    function allowance(address owner, address spender) external view returns (uint);\n\n    function approve(address spender, uint value) external returns (bool);\n    function transfer(address to, uint value) external returns (bool);\n    function transferFrom(address from, address to, uint value) external returns (bool);\n\n    function DOMAIN_SEPARATOR() external view returns (bytes32);\n    function PERMIT_TYPEHASH() external pure returns (bytes32);\n    function nonces(address owner) external view returns (uint);\n\n    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;\n\n    event Mint(address indexed sender, uint amount0, uint amount1);\n    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);\n    event Swap(\n        address indexed sender,\n        uint amount0In,\n        uint amount1In,\n        uint amount0Out,\n        uint amount1Out,\n        address indexed to\n    );\n    event Sync(uint112 reserve0, uint112 reserve1);\n\n    function MINIMUM_LIQUIDITY() external pure returns (uint);\n    function factory() external view returns (address);\n    function token0() external view returns (address);\n    function token1() external view returns (address);\n    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);\n    function price0CumulativeLast() external view returns (uint);\n    function price1CumulativeLast() external view returns (uint);\n    function kLast() external view returns (uint);\n\n    function mint(address to) external returns (uint liquidity);\n    function burn(address to) external returns (uint amount0, uint amount1);\n    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;\n    function skim(address to) external;\n    function sync() external;\n\n    function initialize(address, address) external;\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"
      },
      "@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"
      },
      "contracts/R4RE.sol": {
        "content": "// SPDX-License-Identifier: MIT\r\n// Author: A.P\r\n// Organization: Rare Art\r\n// Development: Kibernacia\r\n// Product: R4RE\r\n// Version: 1.0.0\r\n// Link: https://linktr.ee/rareuniverse\r\npragma solidity >=0.8.23 <0.9.0;\r\n\r\n// OpenZeppelin\r\nimport {ERC20} from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\r\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\r\n\r\n// Uniswap V2\r\nimport {IUniswapV2Factory} from \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\";\r\nimport {IUniswapV2Router02} from \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\";\r\n\r\n// R4RE\r\nimport {R4REPool} from \"./R4REPool.sol\";\r\n\r\ncontract R4RE is ERC20, Ownable, R4REPool {\r\n    /// @notice Stores token name.\r\n    /// @dev Stores constant string.\r\n    string private constant _NAME = \"R4RE\";\r\n\r\n    /// @notice Stores token symbol.\r\n    /// @dev Stores constant string.\r\n    string private constant _SYMBOL = \"R4RE\";\r\n\r\n    /// @notice Stores max wallet factor.\r\n    /// @dev Stores number.\r\n    uint32 private _maxWalletFactor = 50;\r\n\r\n    /// @notice Stores max transaction factor.\r\n    /// @dev Stores number.\r\n    uint32 private _maxTransactionFactor = 50;\r\n\r\n    /// @notice Stores time-based restriction per address.\r\n    /// @dev Stores map from address to timestamp.\r\n    mapping(address => uint256) public lastTransactionTimestamp;\r\n\r\n    /// @notice Stores cooldown time per address.\r\n    /// @dev Stores timestamp.\r\n    uint256 public cooldownTime = 5 seconds;\r\n\r\n    /// @notice Indicates whether automatic liquidity provision to the pool is enabled.\r\n    /// @dev Set to `true` by default, allowing the contract to automatically add liquidity. This can be toggled to enable or disable the feature.\r\n    bool public autoLiquidityProviding = true;\r\n\r\n    /// @notice Stores tax factor.\r\n    /// @dev Stores number.\r\n    uint32 private _taxFactor = 100;\r\n\r\n    /// @notice Stores buy tax.\r\n    /// @dev Stores number.\r\n    uint32 public buyTax = 6; // 6.00% (default)\r\n\r\n    /// @notice Stores sell tax.\r\n    /// @dev Stores number.\r\n    uint32 public sellTax = 6; // 6.00% (default)\r\n\r\n    /// @notice Defines the fee percentage for liquidity provision.\r\n    /// @notice LP tax will be fractionated from both buy and sell tax.\r\n    /// @dev Stored number.\r\n    uint32 public liquidityFee = 50; // 50.00% (default)\r\n\r\n    /// @notice Stores tax collecting address.\r\n    /// @dev Stores address.\r\n    address payable public taxCollector;\r\n\r\n    /// @notice Stores excluded from fee addresses.\r\n    /// @dev Stores map from address to bool.\r\n    mapping(address => bool) public isExcluded;\r\n\r\n    constructor(\r\n        uint256 initialSupply\r\n    ) ERC20(_NAME, _SYMBOL) Ownable(_msgSender()) {\r\n        // Create token supply\r\n        _mint(_msgSender(), initialSupply);\r\n\r\n        // Set tax collection address\r\n        taxCollector = payable(_msgSender());\r\n\r\n        // Setup uniswap v2 router\r\n        uniswapV2Router = IUniswapV2Router02(\r\n            0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\r\n        );\r\n\r\n        // Set uniswap v2 factory\r\n        IUniswapV2Factory uniswapV2Factory = IUniswapV2Factory(\r\n            uniswapV2Router.factory()\r\n        );\r\n\r\n        // Create uniswap v2 pair\r\n        uniswapV2Pair = uniswapV2Factory.createPair(\r\n            address(this),\r\n            uniswapV2Router.WETH()\r\n        );\r\n\r\n        // Exclude owner, contract, uniswap v2 router and pair from fees by default\r\n        isExcluded[_msgSender()] = true;\r\n        isExcluded[address(this)] = true;\r\n        isExcluded[address(uniswapV2Router)] = true;\r\n        isExcluded[uniswapV2Pair] = true;\r\n    }\r\n\r\n    // Modifiers\r\n    /**\r\n     * @dev Throws if called by any account other than the tax collector.\r\n     */\r\n    modifier onlyTaxCollector() {\r\n        if (taxCollector != _msgSender()) {\r\n            revert OwnableUnauthorizedAccount(_msgSender());\r\n        }\r\n\r\n        _;\r\n    }\r\n\r\n    /**\r\n     * @dev Throws if transaction conditions are not valid.\r\n     * @param from The address to which tokens are being transferred.\r\n     * @param to The address to which tokens are being transferred.\r\n     * @param value The amount of tokens being transferred.\r\n     */\r\n    modifier validateTransfer(\r\n        address from,\r\n        address to,\r\n        uint256 value\r\n    ) {\r\n        // Validation\r\n        if (from == address(0)) {\r\n            revert TransferFromZeroAddress();\r\n        }\r\n\r\n        if (to == address(0)) {\r\n            revert TransferToZeroAddress();\r\n        }\r\n\r\n        if (!isExcluded[from] && isUniswap(to)) {\r\n            // Max transaction size validation\r\n            if (value > maxTransactionSize()) {\r\n                revert MaxTransactionSizeExceeded();\r\n            }\r\n\r\n            // Time-based restriction validation\r\n            uint256 timestamp = lastTransactionTimestamp[from];\r\n            uint256 restriction = timestamp + cooldownTime;\r\n            if (block.timestamp < restriction) {\r\n                revert TransferTimeRestriction();\r\n            }\r\n\r\n            // Set timestamp\r\n            lastTransactionTimestamp[from] = block.timestamp;\r\n        }\r\n\r\n        if (isUniswap(from) && !isExcluded[to]) {\r\n            // Max transaction size validation\r\n            if (value > maxTransactionSize()) {\r\n                revert MaxTransactionSizeExceeded();\r\n            }\r\n\r\n            // Time-based restriction validation\r\n            uint256 timestamp = lastTransactionTimestamp[to];\r\n            uint256 restriction = timestamp + cooldownTime;\r\n            if (block.timestamp < restriction) {\r\n                revert TransferTimeRestriction();\r\n            }\r\n\r\n            // Set timestamp\r\n            lastTransactionTimestamp[to] = block.timestamp;\r\n        }\r\n\r\n        if (!isExcluded[to]) {\r\n            // Max wallet size validation\r\n            if ((balanceOf(to) + value) > maxWalletSize()) {\r\n                revert MaxWalletSizeExceeded();\r\n            }\r\n        }\r\n\r\n        // Cooldown transfer\r\n        if (!isExcluded[from] && !isExcluded[to]) {\r\n            lastTransactionTimestamp[to] = lastTransactionTimestamp[from];\r\n        }\r\n\r\n        _;\r\n    }\r\n\r\n    /**\r\n     * @dev Overrides transfer function to add custom logic for trading protections and taxes.\r\n     * @notice This function is used to transfer tokens with additional features such as trading protections and taxes.\r\n     * @param to The address to which tokens are transferred.\r\n     * @param value The amount of tokens to be transferred.\r\n     * @return A boolean that indicates whether the operation succeeded.\r\n     */\r\n    function transfer(\r\n        address to,\r\n        uint256 value\r\n    ) public override validateTransfer(_msgSender(), to, value) returns (bool) {\r\n        // Parameters\r\n        uint256 amountAfterTax = value;\r\n        uint256 taxedAmount = 0;\r\n        bool deductTax = false;\r\n\r\n        // Swap Token to ETH\r\n        if (_msgSender() == uniswapV2Pair) {\r\n            // Verification\r\n            if (!isExcluded[to]) {\r\n                deductTax = true;\r\n            }\r\n\r\n            if (deductTax) {\r\n                // Taxation\r\n                (amountAfterTax, taxedAmount) = calculateTax(value, buyTax);\r\n\r\n                // Collect tax\r\n                if (taxedAmount > 0) {\r\n                    // Update\r\n                    super._update(_msgSender(), address(this), taxedAmount);\r\n\r\n                    // Event\r\n                    emit Taxed(_msgSender(), taxedAmount);\r\n                }\r\n\r\n                return super.transfer(to, amountAfterTax);\r\n            } else {\r\n                return super.transfer(to, value);\r\n            }\r\n        }\r\n\r\n        return super.transfer(to, value);\r\n    }\r\n\r\n    /**\r\n     * @dev Overrides transferFrom function to add custom logic for trading protections and taxes.\r\n     * @notice This function is used to transfer tokens from one address to another with additional features such as trading protections and taxes.\r\n     * @param from The address from which tokens are transferred.\r\n     * @param to The address to which tokens are transferred.\r\n     * @param value The amount of tokens to be transferred.\r\n     * @return A boolean that indicates whether the operation succeeded.\r\n     */\r\n    function transferFrom(\r\n        address from,\r\n        address to,\r\n        uint256 value\r\n    ) public override validateTransfer(from, to, value) returns (bool) {\r\n        // Parameters\r\n        uint256 amountAfterTax = value;\r\n        uint256 taxedAmount = 0;\r\n        bool deductTax = false;\r\n\r\n        // Swap ETH to Token\r\n        if (from == uniswapV2Pair) {\r\n            // Verification\r\n            if (!isExcluded[to]) {\r\n                deductTax = true;\r\n            }\r\n\r\n            if (deductTax) {\r\n                // Taxation\r\n                (amountAfterTax, taxedAmount) = calculateTax(value, buyTax);\r\n\r\n                // Collect tax\r\n                if (taxedAmount > 0) {\r\n                    // Update\r\n                    super._update(from, address(this), taxedAmount);\r\n\r\n                    // Event\r\n                    emit Taxed(to, taxedAmount);\r\n                }\r\n\r\n                return super.transferFrom(from, to, amountAfterTax);\r\n            } else {\r\n                return super.transferFrom(from, to, value);\r\n            }\r\n        }\r\n\r\n        // Swap Token to ETH\r\n        if (to == uniswapV2Pair) {\r\n            // Verification\r\n            if (!isExcluded[from]) {\r\n                deductTax = true;\r\n            }\r\n\r\n            if (deductTax) {\r\n                // Taxation\r\n                (amountAfterTax, taxedAmount) = calculateTax(value, sellTax);\r\n\r\n                // Collect tax\r\n                if (taxedAmount > 0) {\r\n                    // Update\r\n                    super._update(from, address(this), taxedAmount);\r\n\r\n                    if (autoLiquidityProviding) {\r\n                        // Tax\r\n                        uint256 amountTax = 0;\r\n                        uint256 amountLiquidity = 0;\r\n                        uint256 amountSwap = balanceOf(address(this));\r\n\r\n                        // Distribution\r\n                        (amountTax, amountLiquidity) = calculateTax(\r\n                            balanceOf(address(this)),\r\n                            liquidityFee\r\n                        );\r\n\r\n                        // Validation\r\n                        if (amountLiquidity >= 2) {\r\n                            amountSwap = amountTax + amountLiquidity / 2;\r\n                        }\r\n\r\n                        // Swap\r\n                        swapTokensForEth(amountSwap);\r\n\r\n                        if (autoLiquidityProviding) {\r\n                            // Distribution\r\n                            uint amountToken = balanceOf(address(this));\r\n                            uint amountETH = quote(amountToken);\r\n\r\n                            emit Quote(\r\n                                amountToken,\r\n                                amountETH,\r\n                                address(this).balance\r\n                            );\r\n\r\n                            // Add Liquidity\r\n                            if (address(this).balance > amountETH) {\r\n                                addLiquidity(amountToken, amountETH);\r\n                            }\r\n                        }\r\n\r\n                        // Distribute\r\n                        transferTax();\r\n                    } else {\r\n                        // Swap\r\n                        swapTokensForEth(balanceOf(address(this)));\r\n\r\n                        // Distribute\r\n                        transferTax();\r\n                    }\r\n\r\n                    // Event\r\n                    emit Taxed(from, taxedAmount);\r\n                }\r\n\r\n                return super.transferFrom(from, to, amountAfterTax);\r\n            } else {\r\n                return super.transferFrom(from, to, value);\r\n            }\r\n        }\r\n\r\n        return super.transferFrom(from, to, value);\r\n    }\r\n\r\n    /**\r\n     * @dev Checks if the given address is either the Uniswap V2 Router or the Uniswap V2 Pair.\r\n     * @param sender The address to be checked.\r\n     * @return Whether the address is associated with Uniswap.\r\n     */\r\n    function isUniswap(address sender) private view returns (bool) {\r\n        return sender == address(uniswapV2Router) || sender == uniswapV2Pair;\r\n    }\r\n\r\n    /**\r\n     * @notice Returns the max wallet size per address.\r\n     * @dev Returns a number calculated based on supply divided by the factor.\r\n     */\r\n    function maxWalletSize() public view returns (uint256) {\r\n        return totalSupply() / _maxWalletFactor;\r\n    }\r\n\r\n    /**\r\n     * @notice Returns the max transaction size per transfer.\r\n     * @dev Returns a number calculated based on supply divided by the factor.\r\n     */\r\n    function maxTransactionSize() public view returns (uint256) {\r\n        return totalSupply() / _maxTransactionFactor;\r\n    }\r\n\r\n    /**\r\n     * @dev Calculates the amount after applying a tax to the given amount.\r\n     * @param amount The original amount on which tax is to be applied.\r\n     * @param tax The tax rate to be applied, represented as a percentage (e.g., 5 for 5%).\r\n     * @return amountAfterTax The amount after applying the tax.\r\n     * @return taxedAmount The calculated tax amount.\r\n     *\r\n     * @notice This function is a view function, meaning it does not modify the state of the contract.\r\n     * @notice If the tax is set to 0, the original amount is returned with no tax applied.\r\n     * @notice If the product of amount and tax is less than a predefined factor (_taxFactor),\r\n     * the tax is considered negligible and the amount is returned with no tax applied.\r\n     * @notice If the original amount is less than 2, no tax is applied, and the original amount is returned.\r\n     * @notice If none of the above conditions are met, the tax is calculated and subtracted from the original amount.\r\n     */\r\n    function calculateTax(\r\n        uint256 amount,\r\n        uint32 tax\r\n    ) public view returns (uint256 amountAfterTax, uint256 taxedAmount) {\r\n        // Validation Zero Tax\r\n        if (tax == 0) return (amount, 0);\r\n\r\n        // Validation Small Amount\r\n        if ((amount * tax) < _taxFactor) {\r\n            if (amount < 2) {\r\n                return (amount, 0);\r\n            } else {\r\n                taxedAmount = amount / 2;\r\n                amountAfterTax = amount - taxedAmount;\r\n\r\n                return (amountAfterTax, taxedAmount);\r\n            }\r\n        }\r\n\r\n        taxedAmount = (amount * tax) / _taxFactor;\r\n        amountAfterTax = amount - taxedAmount;\r\n\r\n        return (amountAfterTax, taxedAmount);\r\n    }\r\n\r\n    /**\r\n     * @dev Sets a new tax collector for the contract.\r\n     * @param newTaxCollector The address of the new tax collector.\r\n     *\r\n     * @notice This function is external and can be called by anyone, but it is restricted to only the current tax collector.\r\n     * @notice Only the current tax collector has the authority to set a new tax collector.\r\n     * @notice The new tax collector's address is stored, and the old tax collector is replaced with the new one.\r\n     * @notice The new tax collector is marked as excluded to prevent taxation on themselves.\r\n     * @notice Emits a TaxCollectorModified event with details about the modification, including the old and new tax collector's addresses.\r\n     */\r\n    function setTaxCollector(\r\n        address newTaxCollector\r\n    ) external onlyTaxCollector {\r\n        // Set\r\n        address oldTaxCollector = taxCollector;\r\n        taxCollector = payable(newTaxCollector);\r\n\r\n        // Exclude\r\n        isExcluded[newTaxCollector] = true;\r\n\r\n        // Event\r\n        emit TaxCollectorModified(oldTaxCollector, newTaxCollector);\r\n    }\r\n\r\n    /**\r\n     * @dev Sets the exclusion status for a given account from tax calculations.\r\n     * @param account The address of the account to be excluded or included.\r\n     * @param exclude A boolean flag indicating whether the account should be excluded (true) or included (false).\r\n     *\r\n     * @notice This function is external, meaning it can only be called from outside the contract.\r\n     * @notice Only the owner of the contract has the authority to exclude or include accounts.\r\n     * @notice The exclusion status is updated for the specified account, affecting tax calculations.\r\n     * @notice Emits an Excluded event with details about the modification, including the account address and exclusion status.\r\n     */\r\n    function setExclude(address account, bool exclude) external onlyOwner {\r\n        // Set\r\n        isExcluded[account] = exclude;\r\n\r\n        // Event\r\n        emit Excluded(account, exclude);\r\n    }\r\n\r\n    /**\r\n     * @dev Sets the maximum wallet factor for the contract, which is used as a threshold for wallet balance validation.\r\n     * @param newFactor The new maximum wallet factor to be set.\r\n     *\r\n     * @notice This function is external, meaning it can only be called from outside the contract.\r\n     * @notice Only the owner of the contract has the authority to set the maximum wallet factor.\r\n     * @notice The new maximum wallet factor must not exceed the total supply of the contract's token.\r\n     * @notice If the new maximum wallet factor is invalid, the function reverts and emits an error message.\r\n     * @notice Emits a FactorModified event with details about the modification, including the factor type, old factor, and new factor.\r\n     */\r\n    function setMaxWalletFactor(uint32 newFactor) external onlyOwner {\r\n        // Validation\r\n        if (newFactor > totalSupply()) {\r\n            revert InvalidInput(\r\n                \"Max wallet factor\",\r\n                \"Max wallet factor cannot exceed total supply\"\r\n            );\r\n        }\r\n\r\n        // Set\r\n        uint32 oldFactor = _maxWalletFactor;\r\n        _maxWalletFactor = newFactor;\r\n\r\n        // Event\r\n        emit FactorModified(\"Max Wallet Factor\", oldFactor, newFactor);\r\n    }\r\n\r\n    /**\r\n     * @dev Sets the maximum transaction factor for the contract, which is used as a threshold for transaction validation.\r\n     * @param newFactor The new maximum transaction factor to be set.\r\n     *\r\n     * @notice This function is external, meaning it can only be called from outside the contract.\r\n     * @notice Only the owner of the contract has the authority to set the maximum transaction factor.\r\n     * @notice The new maximum transaction factor must not exceed the total supply of the contract's token.\r\n     * @notice If the new maximum transaction factor is invalid, the function reverts and emits an error message.\r\n     * @notice Emits a FactorModified event with details about the modification, including the factor type, old factor, and new factor.\r\n     */\r\n    function setMaxTransactionFactor(uint32 newFactor) external onlyOwner {\r\n        // Validation\r\n        if (newFactor > totalSupply()) {\r\n            revert InvalidInput(\r\n                \"Max transaction factor\",\r\n                \"Max transaction factor cannot exceed total supply\"\r\n            );\r\n        }\r\n\r\n        // Set\r\n        uint32 oldFactor = _maxTransactionFactor;\r\n        _maxTransactionFactor = newFactor;\r\n\r\n        // Event\r\n        emit FactorModified(\"Max Transaction Factor\", oldFactor, newFactor);\r\n    }\r\n\r\n    /**\r\n     * @dev Sets the cooldown time for transactions in the contract.\r\n     * @param newCooldownTime The new cooldown time, representing the duration in seconds.\r\n     *\r\n     * @notice This function is external, meaning it can only be called from outside the contract.\r\n     * @notice Only the owner of the contract has the authority to set the cooldown time.\r\n     * @notice The new cooldown time is stored, affecting the time duration between transactions.\r\n     * @notice Emits a CooldownTimeModified event with details about the modification, including the old and new cooldown times.\r\n     */\r\n    function setCooldownTime(uint256 newCooldownTime) external onlyOwner {\r\n        // Set\r\n        uint256 oldCooldownTime = cooldownTime;\r\n        cooldownTime = newCooldownTime;\r\n\r\n        // Event\r\n        emit CooldownTimeModified(oldCooldownTime, newCooldownTime);\r\n    }\r\n\r\n    /**\r\n     * @dev Toggles the automatic liquidity provision feature of the contract. This feature, when enabled, allows the contract to automatically provide liquidity to a paired liquidity pool.\r\n     *\r\n     * @notice This function is external, meaning it can only be called from outside the contract.\r\n     * @notice Only the owner of the contract has the authority to toggle the automatic liquidity provision feature.\r\n     * @notice Toggling this feature inverses the current state of the autoLiquidityProviding variable.\r\n     * @notice Emits an AutoLiquiditySwitch event indicating the new state of the automatic liquidity provision feature.\r\n     */\r\n    function switchAutoLiquidity() external onlyOwner {\r\n        // Set\r\n        autoLiquidityProviding = !autoLiquidityProviding;\r\n\r\n        // Event\r\n        emit AutoLiquiditySwitch(autoLiquidityProviding);\r\n    }\r\n\r\n    /**\r\n     * @dev Sets the tax factor for the contract, which is used as a threshold for tax division.\r\n     * @param newTaxFactor The new tax factor to be set.\r\n     *\r\n     * @notice This function is external, meaning it can only be called from outside the contract.\r\n     * @notice Only the owner of the contract has the authority to set the tax factor.\r\n     * @notice The new tax factor must not exceed the total supply of the contract's token.\r\n     * @notice If the new tax factor is invalid, the function reverts and emits an error message.\r\n     * @notice Emits a FactorModified event with details about the modification, including the factor type, old factor, and new factor.\r\n     */\r\n    function setTaxFactor(uint32 newTaxFactor) external onlyOwner {\r\n        // Validation\r\n        if (_taxFactor > totalSupply()) {\r\n            revert InvalidInput(\r\n                \"Tax Factor\",\r\n                \"Tax factor cannot exceed total supply\"\r\n            );\r\n        }\r\n\r\n        // Set\r\n        uint32 oldTaxFactor = newTaxFactor;\r\n        _taxFactor = newTaxFactor;\r\n\r\n        // Event\r\n        emit FactorModified(\"Tax Factor\", oldTaxFactor, newTaxFactor);\r\n    }\r\n\r\n    /**\r\n     * @dev Sets the buying tax rate for the contract.\r\n     * @param newTax The new tax rate to be set, represented as a percentage (e.g., 5 for 5%).\r\n     *\r\n     * @notice This function is external, meaning it can only be called from outside the contract.\r\n     * @notice Only the owner of the contract has the authority to set the buying tax rate.\r\n     * @notice The new tax rate must not exceed a predefined factor (_taxFactor) to prevent excessive taxation.\r\n     * @notice If the new tax rate is invalid, the function reverts and emits an error message.\r\n     * @notice Emits a TaxModified event with details about the modification, including the tax type, old tax rate, and new tax rate.\r\n     */\r\n    function setBuyTax(uint32 newTax) external onlyOwner {\r\n        // Validation\r\n        if (newTax > _taxFactor) {\r\n            revert InvalidInput(\"Buy Tax\", \"Buy tax cannot exceed tax factor\");\r\n        }\r\n\r\n        // Set\r\n        uint32 oldTax = buyTax;\r\n        buyTax = newTax;\r\n\r\n        // Event\r\n        emit TaxModified(\"Buy Tax\", oldTax, newTax);\r\n    }\r\n\r\n    /**\r\n     * @dev Sets the selling tax rate for the contract.\r\n     * @param newTax The new tax rate to be set, represented as a percentage.\r\n     *\r\n     * @notice This function is external, meaning it can only be called from outside the contract.\r\n     * @notice Only the owner of the contract has the authority to set the selling tax rate.\r\n     * @notice The new tax rate must not exceed a predefined factor (_taxFactor) to prevent excessive taxation.\r\n     * @notice If the new tax rate is invalid, the function reverts and emits an error message.\r\n     * @notice Emits a TaxModified event with details about the modification, including the tax type, old tax rate, and new tax rate.\r\n     */\r\n    function setSellTax(uint32 newTax) external onlyOwner {\r\n        // Validation\r\n        if (newTax > _taxFactor) {\r\n            revert InvalidInput(\r\n                \"Sell Tax\",\r\n                \"Sell tax cannot exceed tax factor\"\r\n            );\r\n        }\r\n\r\n        // Set\r\n        uint32 oldTax = sellTax;\r\n        sellTax = newTax;\r\n\r\n        // Event\r\n        emit TaxModified(\"Sell Tax\", oldTax, newTax);\r\n    }\r\n\r\n    /**\r\n     * @dev Sets a new liquidity fee for the contract, which is applied to transactions for liquidity provision.\r\n     * @param newTax The new liquidity fee to be set, expressed in basis points (bps). For example, a value of 50 represents a 0.5% fee.\r\n     *\r\n     * @notice This function is external, meaning it can only be called from outside the contract.\r\n     * @notice Only the owner of the contract has the authority to set the liquidity fee.\r\n     * @notice The new liquidity fee must not exceed the predefined tax factor limit. If it does, the function reverts with an \"InvalidInput\" error.\r\n     * @notice Emits a `TaxModified` event with details about the modification, including the tax type (\"LP Tax\"), old tax rate, and new tax rate.\r\n     */\r\n    function setliquidityFee(uint32 newTax) external onlyOwner {\r\n        // Validation\r\n        if (newTax > _taxFactor) {\r\n            revert InvalidInput(\"LP Tax\", \"LP tax cannot exceed tax factor\");\r\n        }\r\n\r\n        // Set\r\n        uint32 oldTax = liquidityFee;\r\n        liquidityFee = newTax;\r\n\r\n        // Event\r\n        emit TaxModified(\"LP Tax\", oldTax, newTax);\r\n    }\r\n\r\n    /**\r\n     * @dev Adds liquidity to the Uniswap V2 liquidity pool using a specified amount of tokens and ETH.\r\n     * The function first verifies the Uniswap V2 Router's address, then approves the router to spend the tokens,\r\n     * and finally attempts to add liquidity to the pool. It handles success or failure of liquidity addition.\r\n     * @param amountToken The amount of tokens to add to the pool.\r\n     * @param amountETH The amount of ETH to add to the pool, sent along with the transaction.\r\n     *\r\n     * @notice This function is private, meaning it can only be called from within the contract itself.\r\n     * @notice Before calling this function, ensure that the Uniswap V2 Router is set and valid.\r\n     * @notice The function approves the Uniswap V2 Router to spend the specified `amountToken`.\r\n     * @notice Attempts to add `amountToken` tokens and `amountETH` ETH to the Uniswap V2 liquidity pool.\r\n     * If successful, emits a `LiquidityAdded` event with the amounts used and liquidity tokens received.\r\n     * @notice If the attempt to add liquidity fails due to a revert with a reason, emits a `LiquidityAdditionFailed` event with the reason.\r\n     * @notice If the attempt fails without a revert reason, emits a `LiquidityAdditionFailedBytes` event with the low-level data.\r\n     */\r\n    function addLiquidity(uint amountToken, uint amountETH) private {\r\n        // Verification\r\n        if (address(uniswapV2Router) == address(0)) {\r\n            revert UniswapV2InvalidRouter(address(0));\r\n        }\r\n\r\n        // Approve the Uniswap V2 router to spend the token amount\r\n        _approve(address(this), address(uniswapV2Router), amountToken);\r\n\r\n        // Add tokens and ETH to the liquidity pool\r\n        try\r\n            uniswapV2Router.addLiquidityETH{value: amountETH}(\r\n                address(this),\r\n                amountToken,\r\n                0, // Consider setting non-zero slippage limits for production\r\n                0, // Consider setting non-zero slippage limits for production\r\n                address(taxCollector),\r\n                block.timestamp + 600\r\n            )\r\n        returns (uint amountTokenUsed, uint amountETHUsed, uint liquidity) {\r\n            // Handle successful liquidity addition\r\n            // e.g., Emit an event or execute further logic as needed\r\n            emit LiquidityAdded(amountTokenUsed, amountETHUsed, liquidity);\r\n        } catch Error(string memory reason) {\r\n            // Handle a revert with a reason from the Uniswap V2 Router\r\n            // e.g., Emit an event or revert the transaction\r\n            emit LiquidityAdditionFailed(reason);\r\n        } catch (bytes memory lowLevelData) {\r\n            // Handle a failure without a revert reason from the Uniswap V2 Router\r\n            // e.g., Emit an event or revert the transaction\r\n            emit LiquidityAdditionFailedBytes(lowLevelData);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Initiates the swap of Tokens for ETH and distributes the resulting ETH.\r\n     * @dev Accessible only by the contract owner.\r\n     */\r\n    function swap() external onlyOwner {\r\n        // Swap\r\n        swapTokensForEth(balanceOf(address(this)));\r\n\r\n        // Distribute\r\n        transferTax();\r\n\r\n        // Event\r\n        emit Swap();\r\n    }\r\n\r\n    /**\r\n     * @dev Internal function to swap Tokens for ETH using the Uniswap V2 Router.\r\n     * @param amount The amount of tokens to be swapped.\r\n     */\r\n    function swapTokensForEth(uint256 amount) private {\r\n        // Verification\r\n        if (address(uniswapV2Router) == address(0)) {\r\n            revert UniswapV2InvalidRouter(address(0));\r\n        }\r\n\r\n        // Approve the Uniswap V2 router to spend the token amount\r\n        _approve(address(this), address(uniswapV2Router), amount);\r\n\r\n        // Parameters\r\n        address[] memory path = new address[](2);\r\n\r\n        // Configuration\r\n        path[0] = address(this);\r\n        path[1] = uniswapV2Router.WETH();\r\n\r\n        // Swap tokens for ETH\r\n        uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\r\n            amount,\r\n            0,\r\n            path,\r\n            address(this),\r\n            block.timestamp + 600\r\n        );\r\n    }\r\n\r\n    /**\r\n     * @dev Internal function to transfer collected tax to the designated tax collector address.\r\n     */\r\n    function transferTax() private {\r\n        // Parameter\r\n        uint256 tax = address(this).balance;\r\n\r\n        if (tax > 0) {\r\n            taxCollector.transfer(tax);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Fallback function to receive ETH.\r\n     */\r\n    receive() external payable {}\r\n\r\n    /**\r\n     * @dev Fallback function to receive ETH.\r\n     */\r\n    fallback() external payable {}\r\n}\r\n"
      },
      "contracts/R4REErrors.sol": {
        "content": "// SPDX-License-Identifier: MIT\r\n// Author: A.P\r\n// Organization: Rare Art\r\n// Development: Kibernacia\r\n// Product: R4RE\r\n// Version: 1.0.0\r\n// Link: https://linktr.ee/rareuniverse\r\npragma solidity >=0.8.23 <0.9.0;\r\n\r\n/**\r\n * @dev R4RE Errors\r\n */\r\ninterface R4REErrors {\r\n    /**\r\n     * @dev Error indicating that the provided UniswapV2Router address is invalid.\r\n     * @param newUniswapV2Router The address of the invalid UniswapV2Router.\r\n     */\r\n    error UniswapV2InvalidRouter(address newUniswapV2Router);\r\n\r\n    /**\r\n     * @dev Error indicating that the provided UniswapV2Pair address is invalid.\r\n     * @param newUniswapV2Pair The address of the invalid UniswapV2Pair.\r\n     */\r\n    error UniswapV2InvalidPool(address newUniswapV2Pair);\r\n\r\n    /**\r\n     * @dev Error indicating that an operation failed because the provided amount is insufficient.\r\n     */\r\n    error UniswapV2InsufficientAmount();\r\n\r\n    /**\r\n     * @dev Error indicating that an operation failed due to insufficient liquidity in the Uniswap V2 pool.\r\n     */\r\n    error UniswapV2InsufficientLiquidity();\r\n\r\n    /**\r\n     * @dev Error indicating that a transfer from the zero address is not allowed.\r\n     */\r\n    error TransferFromZeroAddress();\r\n\r\n    /**\r\n     * @dev Error indicating that a transfer to the zero address is not allowed.\r\n     */\r\n    error TransferToZeroAddress();\r\n\r\n    /**\r\n     * @dev Error indicating that the maximum wallet size has been exceeded.\r\n     */\r\n    error MaxWalletSizeExceeded();\r\n\r\n    /**\r\n     * @dev Error indicating that the maximum transaction size has been exceeded.\r\n     */\r\n    error MaxTransactionSizeExceeded();\r\n\r\n    /**\r\n     * @dev Error indicating that a transfer is not allowed due to transfer time restrictions.\r\n     */\r\n    error TransferTimeRestriction();\r\n\r\n    /**\r\n     * @dev Error indicating that a withdrawal operation is invalid.\r\n     */\r\n    error WidthdrawInvalid();\r\n\r\n    /**\r\n     * @dev Error indicating that an input parameter is invalid.\r\n     * @param index The index or identifier of the invalid input.\r\n     * @param message A message describing the reason for the invalid input.\r\n     */\r\n    error InvalidInput(string index, string message);\r\n}\r\n"
      },
      "contracts/R4REEvents.sol": {
        "content": "// SPDX-License-Identifier: MIT\r\n// Author: A.P\r\n// Organization: Rare Art\r\n// Development: Kibernacia\r\n// Product: R4RE\r\n// Version: 1.0.0\r\n// Link: https://linktr.ee/rareuniverse\r\npragma solidity >=0.8.23 <0.9.0;\r\n\r\n/**\r\n * @dev R4RE Events\r\n */\r\ninterface R4REEvents {\r\n    /**\r\n     * @dev Emitted when an account is excluded or included from tax calculations.\r\n     * @param account The address of the account being excluded or included.\r\n     * @param exclude A boolean flag indicating whether the account is excluded (true) or included (false).\r\n     */\r\n    event Excluded(address indexed account, bool exclude);\r\n\r\n    /**\r\n     * @dev Emitted when the tax collector address is modified.\r\n     * @param oldTaxCollector The old tax collector address before modification.\r\n     * @param newTaxCollector The new tax collector address after modification.\r\n     */\r\n    event TaxCollectorModified(\r\n        address indexed oldTaxCollector,\r\n        address indexed newTaxCollector\r\n    );\r\n\r\n    /**\r\n     * @dev Emitted when a factor (e.g., tax factor, max transaction factor, max wallet factor) is modified.\r\n     * @param factor The type of factor being modified.\r\n     * @param oldFactor The old value of the factor before modification.\r\n     * @param newFactor The new value of the factor after modification.\r\n     */\r\n    event FactorModified(\r\n        string indexed factor,\r\n        uint32 oldFactor,\r\n        uint32 newFactor\r\n    );\r\n\r\n    /**\r\n     * @dev Emitted when a tax rate is modified.\r\n     * @param tax The type of tax being modified.\r\n     * @param oldTax The old tax rate before modification.\r\n     * @param newTax The new tax rate after modification.\r\n     */\r\n    event TaxModified(string indexed tax, uint32 oldTax, uint32 newTax);\r\n\r\n    /**\r\n     * @dev Emitted when a swap operation occurs (e.g., in the Uniswap decentralized exchange).\r\n     */\r\n    event Swap();\r\n\r\n    /**\r\n     * @dev Emitted when a recipient address is taxed.\r\n     * @param receiver The address of the recipient being taxed.\r\n     * @param amount The amount of the tax applied.\r\n     */\r\n    event Taxed(address indexed receiver, uint256 amount);\r\n\r\n    /**\r\n     * @dev Emitted when the UniswapV2Router address is modified.\r\n     * @param oldUniswapV2Router The old UniswapV2Router address before modification.\r\n     * @param newUniswapV2Router The new UniswapV2Router address after modification.\r\n     */\r\n    event UniswapV2RouterModified(\r\n        address indexed oldUniswapV2Router,\r\n        address indexed newUniswapV2Router\r\n    );\r\n\r\n    /**\r\n     * @dev Emitted when the UniswapV2Pair address is modified.\r\n     * @param oldUniswapV2Pair The old UniswapV2Pair address before modification.\r\n     * @param newUniswapV2Pair The new UniswapV2Pair address after modification.\r\n     */\r\n    event UniswapV2PairModified(\r\n        address indexed oldUniswapV2Pair,\r\n        address indexed newUniswapV2Pair\r\n    );\r\n\r\n    /**\r\n     * @dev Emitted when the cooldown time for transactions is modified.\r\n     * @param oldCooldownTime The old cooldown time before modification.\r\n     * @param newCooldownTime The new cooldown time after modification.\r\n     */\r\n    event CooldownTimeModified(\r\n        uint256 oldCooldownTime,\r\n        uint256 newCooldownTime\r\n    );\r\n\r\n    /**\r\n     * @dev Emitted when the automatic liquidity provision setting is toggled.\r\n     * @param autoLiquidityProviding Indicates whether automatic liquidity providing is enabled (true) or disabled (false).\r\n     */\r\n    event AutoLiquiditySwitch(bool indexed autoLiquidityProviding);\r\n\r\n    /**\r\n     * @dev Emitted when liquidity is successfully added to the liquidity pool.\r\n     * @param amountTokenUsed The amount of tokens used to add liquidity.\r\n     * @param amountETHUsed The amount of ETH used to add liquidity.\r\n     * @param liquidity The amount of liquidity tokens received in return for adding liquidity.\r\n     */\r\n    event LiquidityAdded(\r\n        uint256 amountTokenUsed,\r\n        uint256 amountETHUsed,\r\n        uint256 liquidity\r\n    );\r\n\r\n    /**\r\n     * @dev Emitted when adding liquidity to the liquidity pool fails due to a reason that can be expressed in a string.\r\n     * @param reason The reason why adding liquidity failed, described as a string.\r\n     */\r\n    event LiquidityAdditionFailed(string reason);\r\n\r\n    /**\r\n     * @dev Emitted when adding liquidity to the liquidity pool fails due to a reason that is captured in low-level bytes data.\r\n     * @param lowLevelData The low-level bytes data representing the reason for the liquidity addition failure.\r\n     */\r\n    event LiquidityAdditionFailedBytes(bytes lowLevelData);\r\n\r\n    /**\r\n     * @dev Emitted after calculating the equivalent amount of ETH for a given amount of tokens.\r\n     * This event helps in tracking the outcomes of quote operations, providing insights into the value conversions and the state of balances after the operation.\r\n     * @param amountToken The amount of tokens for which the quote was calculated.\r\n     * @param amountETH The equivalent amount of ETH for the given amount of tokens as per the current conversion rate.\r\n     * @param balance The balance after the operation, potentially reflecting changes in reserves or liquidity.\r\n     */\r\n    event Quote(uint amountToken, uint amountETH, uint balance);\r\n}\r\n"
      },
      "contracts/R4REPool.sol": {
        "content": "// SPDX-License-Identifier: MIT\r\n// Author: A.P\r\n// Organization: Rare Art\r\n// Development: Kibernacia\r\n// Product: R4RE\r\n// Version: 1.0.0\r\n// Link: https://linktr.ee/rareuniverse\r\npragma solidity >=0.8.23 <0.9.0;\r\n\r\n// OpenZeppelin\r\nimport {Context} from \"@openzeppelin/contracts/utils/Context.sol\";\r\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\r\n\r\n// Uniswap V2\r\nimport {IUniswapV2Pair} from \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol\";\r\nimport {IUniswapV2Router02} from \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\";\r\n\r\n// R4RE\r\nimport {R4REEvents} from \"./R4REEvents.sol\";\r\nimport {R4REErrors} from \"./R4REErrors.sol\";\r\n\r\n/**\r\n * @dev R4RE Pool\r\n */\r\n\r\nabstract contract R4REPool is Context, Ownable, R4REEvents, R4REErrors {\r\n    /// @notice Stores Uniswap V2 router interface.\r\n    /// @dev Stores IUniswapV2Router02 interface.\r\n    IUniswapV2Router02 public uniswapV2Router;\r\n\r\n    /// @notice Stores Uniswap V2 pair address.\r\n    /// @dev Stores address.\r\n    address public uniswapV2Pair;\r\n\r\n    /**\r\n     * @dev Sets the UniswapV2Router for the contract to enable interactions with the Uniswap decentralized exchange.\r\n     * @param newUniswapV2Router The address of the new UniswapV2Router contract.\r\n     *\r\n     * @notice This function is external, meaning it can only be called from outside the contract.\r\n     * @notice Only the owner of the contract has the authority to set the UniswapV2Router.\r\n     * @notice The new UniswapV2Router address must be a valid address and not equal to address(0).\r\n     * @notice If the new UniswapV2Router address is invalid, the function reverts and emits an error message.\r\n     * @notice Emits a UniswapV2RouterModified event with details about the modification, including the old and new UniswapV2Router addresses.\r\n     */\r\n    function setUniswapV2Router(address newUniswapV2Router) external onlyOwner {\r\n        // Verification\r\n        if (newUniswapV2Router == address(0)) {\r\n            revert UniswapV2InvalidRouter(address(0));\r\n        }\r\n\r\n        // Parameter\r\n        address oldUniswapV2Router = address(uniswapV2Router);\r\n\r\n        // Configuration\r\n        uniswapV2Router = IUniswapV2Router02(newUniswapV2Router);\r\n\r\n        // Event\r\n        emit UniswapV2RouterModified(oldUniswapV2Router, newUniswapV2Router);\r\n    }\r\n\r\n    /**\r\n     * @dev Sets the UniswapV2Pair for the contract to define the trading pair with the Uniswap decentralized exchange.\r\n     * @param newUniswapV2Pair The address of the new UniswapV2Pair contract representing the trading pair.\r\n     *\r\n     * @notice This function is external, meaning it can only be called from outside the contract.\r\n     * @notice Only the owner of the contract has the authority to set the UniswapV2Pair.\r\n     * @notice The new UniswapV2Pair address must be a valid address and not equal to address(0).\r\n     * @notice If the new UniswapV2Pair address is invalid, the function reverts and emits an error message.\r\n     * @notice Emits a UniswapV2PairModified event with details about the modification, including the old and new UniswapV2Pair addresses.\r\n     */\r\n    function setUniswapV2Pair(address newUniswapV2Pair) external onlyOwner {\r\n        // Verification\r\n        if (newUniswapV2Pair == address(0)) {\r\n            revert UniswapV2InvalidPool(address(0));\r\n        }\r\n\r\n        // Parameter\r\n        address oldUniswapV2Pair = uniswapV2Pair;\r\n\r\n        // Configuration\r\n        uniswapV2Pair = newUniswapV2Pair;\r\n\r\n        // Event\r\n        emit UniswapV2PairModified(oldUniswapV2Pair, uniswapV2Pair);\r\n    }\r\n\r\n    /**\r\n     * @dev Retrieves the reserve amounts of the two tokens in the Uniswap V2 pair, along with the last block timestamp when these reserves were updated.\r\n     * This function interfaces with the Uniswap V2 pair contract to fetch its current state, which is essential for calculating accurate trading prices, understanding liquidity depth, and more.\r\n     * The reserves and timestamp can be used by external contracts or callers to make informed decisions in DeFi operations such as swaps, liquidity provision, or arbitrage.\r\n     *\r\n     * @return _reserve0 The reserve amount of the first token in the Uniswap V2 pair. Token pairs in Uniswap are ordered by their contract addresses.\r\n     * @return _reserve1 The reserve amount of the second token in the Uniswap V2 pair.\r\n     * @return _blockTimestampLast The last block timestamp when the reserves were recorded by the pair contract. This can be used to assess the freshness of the data.\r\n     */\r\n    function getReserves()\r\n        public\r\n        view\r\n        returns (uint _reserve0, uint _reserve1, uint32 _blockTimestampLast)\r\n    {\r\n        // Parameter\r\n        IUniswapV2Pair iPair = IUniswapV2Pair(uniswapV2Pair);\r\n\r\n        return iPair.getReserves();\r\n    }\r\n\r\n    /**\r\n     * @dev Calculates the equivalent amount of ETH for a given amount of tokens based on the reserves in the liquidity pool.\r\n     * @param amountToken The amount of tokens to convert to an equivalent amount of ETH.\r\n     * @return amountETH The equivalent amount of ETH based on the current reserves.\r\n     */\r\n    function quote(uint amountToken) internal view returns (uint amountETH) {\r\n        // Get the reserves from the liquidity pool\r\n        (uint reserveA, uint reserveB, ) = getReserves();\r\n\r\n        if (amountToken <= 0) revert UniswapV2InsufficientAmount();\r\n        if (reserveA <= 0 || reserveB <= 0) {\r\n            revert UniswapV2InsufficientLiquidity();\r\n        }\r\n\r\n        // Parameter\r\n        IUniswapV2Pair iPair = IUniswapV2Pair(uniswapV2Pair);\r\n\r\n        if (address(this) == iPair.token0()) {\r\n            // Calculate the equivalent amount of ETH based on the reserves and the amount of tokens\r\n            amountETH = (amountToken * reserveB) / reserveA;\r\n        } else {\r\n            // Calculate the equivalent amount of ETH based on the reserves and the amount of tokens\r\n            amountETH = (amountToken * reserveA) / reserveB;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Allows the owner of the contract to withdraw the contract's balance.\r\n     *\r\n     * @notice This function is external, meaning it can only be called from outside the contract.\r\n     * @notice Only the owner of the contract has the authority to withdraw funds.\r\n     * @notice The entire balance of the contract is transferred to the owner's address.\r\n     * @notice If the withdrawal is unsuccessful, the function reverts and emits an error message.\r\n     */\r\n    function withdraw() external onlyOwner {\r\n        // Withdraw\r\n        (bool success, ) = msg.sender.call{value: address(this).balance}(\"\");\r\n\r\n        // Verification\r\n        if (!success) {\r\n            revert WidthdrawInvalid();\r\n        }\r\n    }\r\n}\r\n"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": true,
        "runs": 1000
      },
      "viaIR": true,
      "evmVersion": "paris",
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "libraries": {}
    }
  }}