Oko contract explorer
Contract

Code for 0xb115…ca4e (LidoConverter)

Since block 19316308

Verified contract

  1. {{
  2. "language": "Solidity",
  3. "sources": {
  4. "@openzeppelin/contracts/math/SafeMath.sol": {
  5. "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * 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 */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n"
  6. },
  7. "@openzeppelin/contracts/token/ERC20/IERC20.sol": {
  8. "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\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 `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` 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(address sender, address recipient, uint256 amount) external returns (bool);\n\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"
  9. },
  10. "@openzeppelin/contracts/token/ERC20/SafeERC20.sol": {
  11. "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.0;\n\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using SafeMath for uint256;\n using Address for address;\n\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n // solhint-disable-next-line max-line-length\n require((value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) { // Return data is optional\n // solhint-disable-next-line max-line-length\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n"
  12. },
  13. "@openzeppelin/contracts/utils/Address.sol": {
  14. "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.0;\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 */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 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://diligence.consensys.net/posts/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.5.11/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 // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\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(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"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(address target, bytes memory data, string memory errorMessage) 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(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\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(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(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(address target, bytes memory data) internal view returns (bytes memory) {\n return 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(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(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(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\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(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\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\n // solhint-disable-next-line no-inline-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}\n"
  15. },
  16. "contracts/helpers/converter/ConverterBase.sol": {
  17. "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.6;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport { IWETH } from \"../../interfaces/IWETH.sol\";\nimport { ITokenConverter } from \"./ITokenConverter.sol\";\n\nabstract contract ConverterBase is ITokenConverter {\n using SafeERC20 for IERC20;\n\n /*************\n * Constants *\n *************/\n\n /// @inheritdoc ITokenConverter\n address public immutable override registry;\n\n /// @dev The address of ETH which is commonly used.\n address internal constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n /// @dev The address of WETH token.\n address internal constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n\n /// @dev The address of referral contract.\n address internal constant REFERRAL = 0x26B2ec4E02ebe2F54583af25b647b1D619e67BbF;\n\n /***************\n * Constructor *\n ***************/\n\n constructor(address _registry) {\n registry = _registry;\n }\n\n /****************************\n * Public Mutated Functions *\n ****************************/\n\n // solhint-disable-next-line no-empty-blocks\n receive() external payable {}\n\n /****************************\n * Public Mutated Functions *\n ****************************/\n\n /// @inheritdoc ITokenConverter\n function withdrawFund(address _token, address _recipient) external override {\n require(msg.sender == registry, \"only registry\");\n\n if (_token == address(0)) {\n (bool success, ) = _recipient.call{ value: address(this).balance }(\"\");\n require(success, \"withdraw ETH failed\");\n } else {\n IERC20(_token).safeTransfer(_recipient, IERC20(_token).balanceOf(address(this)));\n }\n }\n\n /**********************\n * Internal Functions *\n **********************/\n\n /// @dev Internal function to get the pool type of the route.\n /// @param encoding The route encoding.\n function _getPoolType(uint256 encoding) internal pure returns (uint256) {\n return encoding & 255;\n }\n\n /// @dev Internal function to get the action of the route.\n /// @param encoding The route encoding.\n function _getAction(uint256 encoding) internal pure returns (uint256) {\n return (encoding >> 8) & 3;\n }\n\n /// @dev Internal function to get the address of pool.\n /// @param encoding The route encoding.\n function _getPool(uint256 encoding) internal pure returns (address) {\n return address((encoding >> 10) & 1461501637330902918203684832716283019655932542975);\n }\n\n function _isETH(address _token) internal pure returns (bool) {\n return _token == ETH || _token == address(0);\n }\n\n function _wrapTokenIfNeeded(address _token, uint256 _amount) internal {\n if (_token == WETH && IERC20(_token).balanceOf(address(this)) < _amount) {\n IWETH(_token).deposit{ value: _amount }();\n }\n }\n\n function _unwrapIfNeeded(uint256 _amount) internal {\n if (address(this).balance < _amount) {\n IWETH(WETH).withdraw(_amount);\n }\n }\n\n function _approve(\n address _token,\n address _spender,\n uint256 _amount\n ) internal {\n if (!_isETH(_token) && IERC20(_token).allowance(address(this), _spender) < _amount) {\n // hBTC cannot approve 0\n if (_token != 0x0316EB71485b0Ab14103307bf65a021042c6d380) {\n IERC20(_token).safeApprove(_spender, 0);\n }\n IERC20(_token).safeApprove(_spender, uint256(-1));\n }\n }\n}\n"
  18. },
  19. "contracts/helpers/converter/ITokenConverter.sol": {
  20. "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.0 || ^0.8.0;\n\ninterface ITokenConverter {\n /*************************\n * Public View Functions *\n *************************/\n\n /// @notice The address of Converter Registry.\n function registry() external view returns (address);\n\n /// @notice Return the input token and output token for the route.\n /// @param route The encoding of the route.\n /// @return tokenIn The address of input token.\n /// @return tokenOut The address of output token.\n function getTokenPair(uint256 route) external view returns (address tokenIn, address tokenOut);\n\n /// @notice Query the output token amount according to the encoding.\n ///\n /// @dev See the comments in `convert` for the meaning of encoding.\n ///\n /// @param encoding The encoding used to convert.\n /// @param amountIn The amount of input token.\n /// @param amountOut The amount of output token received.\n function queryConvert(uint256 encoding, uint256 amountIn) external returns (uint256 amountOut);\n\n /****************************\n * Public Mutated Functions *\n ****************************/\n\n /// @notice Convert input token to output token according to the encoding.\n /// Assuming that the input token is already in the contract.\n ///\n /// @dev encoding for single route\n /// | 8 bits | 2 bits | 246 bits |\n /// | pool_type | action | customized |\n ///\n /// + pool_type = 0: UniswapV2, only action = 0\n /// customized = | 160 bits | 24 bits | 1 bit | 1 bit | ... |\n /// | pool address | fee_num | zero_for_one | twamm | ... |\n /// + pool_type = 1: UniswapV3, only action = 0\n /// customized = | 160 bits | 24 bits | 1 bit | ... |\n /// | pool address | fee_num | zero_for_one | ... |\n /// + pool_type = 2: BalancerV1, only action = 0\n /// customized = | 160 bits | 3 bits | 3 bits | 3 bits | ... |\n /// | pool address | tokens | index in | index out | ... |\n /// + pool_type = 3: BalancerV2, only action = 0\n /// customized = | 160 bits | 3 bits | 3 bits | 3 bits | ... |\n /// | pool address | tokens | index in | index out | ... |\n /// + pool_type = 4: CurvePlainPool or CurveFactoryPlainPool\n /// customized = | 160 bits | 3 bits | 3 bits | 3 bits | 1 bit | ... |\n /// | pool address | tokens | index in | index out | use_eth | ... |\n /// + pool_type = 5: CurveAPool\n /// customized = | 160 bits | 3 bits | 3 bits | 3 bits | 1 bits | ... |\n /// | pool address | tokens | index in | index out | use_underlying | ... |\n /// + pool_type = 6: CurveYPool\n /// customized = | 160 bits | 3 bits | 3 bits | 3 bits | 1 bits | ... |\n /// | pool address | tokens | index in | index out | use_underlying | ... |\n /// + pool_type = 7: CurveMetaPool or CurveFactoryMetaPool\n /// customized = | 160 bits | 3 bits | 3 bits | 3 bits | ... |\n /// | pool address | tokens | index in | index out | ... |\n /// + pool_type = 8: CurveCryptoPool or CurveFactoryCryptoPool\n /// customized = | 160 bits | 3 bits | 3 bits | 3 bits | 1 bit | ... |\n /// | pool address | tokens | index in | index out | use_eth | ... |\n /// + pool_type = 9: ERC4626, no action 0\n /// customized = | 160 bits | ... |\n /// | pool address | ... |\n /// + pool_type = 10: Lido, no action 0\n /// customized = | 160 bits | ... |\n /// | pool address | ... |\n /// + pool_type = 11: ETHLSDConverter v1, no action 0\n /// supported in other pool type\n /// puffer: pufETH is ERC4626, base is stETH\n /// frax: sfrxETH is ERC4626, base is frxETH\n /// pirex: apxETH is ERC4626, base is pxETH\n /// supported in this pool type\n /// 0=wBETH: mint wBETH from ETH\n /// 1=RocketPool: mint rETH from ETH\n /// 2=frax: mint frxETH from ETH\n /// 3=pirex: mint pxETH from ETH\n /// 4=renzo: mint ezETH from ETH, stETH, wBETH\n /// 5=ether.fi: mint eETH from ETH, mint weETH from eETH, unwrap weETH to eETH\n /// 6=kelpdao.xyz: mint rsETH from ETH, ETHx, stETH, sfrxETH, and etc.\n /// customized = | 160 bits | 8 bits | ... |\n /// | pool address | protocol | ... |\n /// + pool_type = 12: CurveStableSwapNG\n /// customized = | 160 bits | 3 bits | 3 bits | 3 bits | ... |\n /// | pool address | tokens | index in | index out | ... |\n /// + pool_type = 13: CurveStableSwapMetaNG\n /// customized = | 160 bits | 3 bits | 3 bits | 3 bits | ... |\n /// | pool address | tokens | index in | index out | ... |\n ///\n /// Note: tokens + 1 is the number of tokens of the pool\n ///\n /// + action = 0: swap\n /// + action = 1: add liquidity / wrap / stake\n /// + action = 2: remove liquidity / unwrap / unstake\n ///\n /// @param encoding The encoding used to convert.\n /// @param amountIn The amount of input token.\n /// @param recipient The address of token receiver.\n /// @return amountOut The amount of output token received.\n function convert(\n uint256 encoding,\n uint256 amountIn,\n address recipient\n ) external payable returns (uint256 amountOut);\n\n /// @notice Withdraw dust assets in this contract.\n /// @param token The address of token to withdraw.\n /// @param recipient The address of token receiver.\n function withdrawFund(address token, address recipient) external;\n}\n"
  21. },
  22. "contracts/helpers/converter/LidoConverter.sol": {
  23. "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.6;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport { ILidoStETH } from \"../../interfaces/ILidoStETH.sol\";\nimport { ILidoWstETH } from \"../../interfaces/ILidoWstETH.sol\";\nimport { ITokenConverter } from \"./ITokenConverter.sol\";\n\nimport { ConverterBase } from \"./ConverterBase.sol\";\n\n// solhint-disable const-name-snakecase\n// solhint-disable no-empty-blocks\n\ncontract LidoConverter is ConverterBase {\n using SafeERC20 for IERC20;\n\n /*************\n * Constants *\n *************/\n\n /// @dev The address of Lido's stETH token.\n address private constant stETH = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84;\n\n /// @dev The address of Lido's wstETH token.\n address private constant wstETH = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0;\n\n /***************\n * Constructor *\n ***************/\n\n constructor(address _registry) ConverterBase(_registry) {}\n\n /*************************\n * Public View Functions *\n *************************/\n\n /// @inheritdoc ITokenConverter\n function getTokenPair(uint256 _encoding) external pure override returns (address, address) {\n require(_getPoolType(_encoding) == 10, \"unsupported poolType\");\n uint256 _action = _getAction(_encoding);\n address _pool = address((_encoding >> 10) & 1461501637330902918203684832716283019655932542975);\n if (_pool == stETH) {\n if (_action == 1) return (WETH, stETH);\n else revert(\"unsupported action\");\n } else if (_pool == wstETH) {\n if (_action == 1) return (stETH, wstETH);\n else if (_action == 2) return (wstETH, stETH);\n else revert(\"unsupported action\");\n } else {\n revert(\"unsupported pool\");\n }\n }\n\n /// @inheritdoc ITokenConverter\n function queryConvert(uint256 _encoding, uint256 _amountIn) external view override returns (uint256 _amountOut) {\n require(_getPoolType(_encoding) == 10, \"unsupported poolType\");\n uint256 _action = _getAction(_encoding);\n address _pool = address((_encoding >> 10) & 1461501637330902918203684832716283019655932542975);\n if (_pool == stETH) {\n if (_action == 1) _amountOut = _amountIn;\n else revert(\"unsupported action\");\n } else if (_pool == wstETH) {\n if (_action == 1) _amountOut = ILidoWstETH(_pool).getWstETHByStETH(_amountIn);\n else if (_action == 2) _amountOut = ILidoWstETH(_pool).getStETHByWstETH(_amountIn);\n else revert(\"unsupported action\");\n } else {\n revert(\"unsupported pool\");\n }\n }\n\n /****************************\n * Public Mutated Functions *\n ****************************/\n\n /// @inheritdoc ITokenConverter\n function convert(\n uint256 _encoding,\n uint256 _amountIn,\n address _recipient\n ) external payable override returns (uint256 _amountOut) {\n require(_getPoolType(_encoding) == 10, \"unsupported poolType\");\n uint256 _action = _getAction(_encoding);\n address _pool = address((_encoding >> 10) & 1461501637330902918203684832716283019655932542975);\n address _token = _pool;\n if (_pool == stETH) {\n if (_action == 1) {\n _unwrapIfNeeded(_amountIn);\n uint256 _shares = ILidoStETH(_pool).submit{ value: _amountIn }(REFERRAL);\n _amountOut = ILidoStETH(_pool).getPooledEthByShares(_shares);\n } else {\n revert(\"unsupported action\");\n }\n } else if (_pool == wstETH) {\n if (_action == 1) {\n _approve(stETH, _pool, _amountIn);\n _amountOut = ILidoWstETH(_pool).wrap(_amountIn);\n } else if (_action == 2) {\n _amountOut = ILidoWstETH(_pool).unwrap(_amountIn);\n _token = stETH;\n } else {\n revert(\"unsupported action\");\n }\n } else {\n revert(\"unsupported pool\");\n }\n\n if (_recipient != address(this)) {\n IERC20(_token).safeTransfer(_recipient, _amountOut);\n }\n }\n}\n"
  24. },
  25. "contracts/interfaces/ILidoStETH.sol": {
  26. "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.6;\n\ninterface ILidoStETH {\n /**\n * @notice Send funds to the pool with optional _referral parameter\n * @dev This function is alternative way to submit funds. Supports optional referral address.\n * @return Amount of StETH shares generated\n */\n function submit(address _referral) external payable returns (uint256);\n\n /**\n * @return the amount of Ether that corresponds to `_sharesAmount` token shares.\n */\n function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);\n}\n"
  27. },
  28. "contracts/interfaces/ILidoWstETH.sol": {
  29. "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.6;\n\ninterface ILidoWstETH {\n /**\n * @notice Exchanges stETH to wstETH\n * @param _stETHAmount amount of stETH to wrap in exchange for wstETH\n * @dev Requirements:\n * - `_stETHAmount` must be non-zero\n * - msg.sender must approve at least `_stETHAmount` stETH to this\n * contract.\n * - msg.sender must have at least `_stETHAmount` of stETH.\n * User should first approve _stETHAmount to the WstETH contract\n * @return Amount of wstETH user receives after wrap\n */\n function wrap(uint256 _stETHAmount) external returns (uint256);\n\n /**\n * @notice Exchanges wstETH to stETH\n * @param _wstETHAmount amount of wstETH to uwrap in exchange for stETH\n * @dev Requirements:\n * - `_wstETHAmount` must be non-zero\n * - msg.sender must have at least `_wstETHAmount` wstETH.\n * @return Amount of stETH user receives after unwrap\n */\n function unwrap(uint256 _wstETHAmount) external returns (uint256);\n\n /**\n * @notice Get amount of stETH for a given amount of wstETH\n * @param _wstETHAmount amount of wstETH\n * @return Amount of stETH for a given wstETH amount\n */\n function getStETHByWstETH(uint256 _wstETHAmount) external view returns (uint256);\n\n /**\n * @notice Get amount of wstETH for a given amount of stETH\n * @param _stETHAmount amount of stETH\n * @return Amount of wstETH for a given stETH amount\n */\n function getWstETHByStETH(uint256 _stETHAmount) external view returns (uint256);\n\n /**\n * @notice Get amount of stETH for a one wstETH\n * @return Amount of stETH for 1 wstETH\n */\n function stEthPerToken() external view returns (uint256);\n\n /**\n * @notice Get amount of wstETH for a one stETH\n * @return Amount of wstETH for a 1 stETH\n */\n function tokensPerStEth() external view returns (uint256);\n}\n"
  30. },
  31. "contracts/interfaces/IWETH.sol": {
  32. "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.6;\n\ninterface IWETH {\n function deposit() external payable;\n\n function withdraw(uint256 wad) external;\n}\n"
  33. }
  34. },
  35. "settings": {
  36. "optimizer": {
  37. "enabled": true,
  38. "runs": 200
  39. },
  40. "evmVersion": "istanbul",
  41. "outputSelection": {
  42. "*": {
  43. "*": [
  44. "evm.bytecode",
  45. "evm.deployedBytecode",
  46. "devdoc",
  47. "userdoc",
  48. "metadata",
  49. "abi"
  50. ]
  51. }
  52. },
  53. "libraries": {}
  54. }
  55. }}

Contract sourced from Etherscan. Solidity version v0.7.6+commit.7338295f.

Panoramix decompilation

# Palkeoramix decompiler. 

const registry = 0x997b6f43c1c1e8630d03b8e3c11b60e98a1bea90

#
#  Regular functions
#

def _fallback(?) payable: # default function
  revert

def getTokenPair(uint256 tokenPairIndex): # not payable
  require calldata.size - 4 >= 32
  if uint8(tokenPairIndex) != 10:
      revert with 0, 'unsupported poolType'
  if Mask(160, 10, tokenPairIndex) >> 10 == 0xae7ab96520de3a18e5e111b5eaab095312d7fe84:
      if Mask(2, 8, tokenPairIndex) >> 8 != 1:
          revert with 0, 'unsupported action'
      return 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 0xae7ab96520de3a18e5e111b5eaab095312d7fe84
  if Mask(160, 10, tokenPairIndex) >> 10 != 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0:
      revert with 0, 'unsupported pool'
  if 1 == Mask(2, 8, tokenPairIndex) >> 8:
      return 0xae7ab96520de3a18e5e111b5eaab095312d7fe84, 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0
  if Mask(2, 8, tokenPairIndex) >> 8 != 2:
      revert with 0, 'unsupported action'
  return 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0, 0xae7ab96520de3a18e5e111b5eaab095312d7fe84

def unknown9114750b(uint8 _param1, uint256 _param2): # not payable
  require calldata.size - 4 >= 64
  if _param1 != 10:
      revert with 0, 'unsupported poolType'
  if Mask(160, 10, _param1) >> 10 == 0xae7ab96520de3a18e5e111b5eaab095312d7fe84:
      if Mask(2, 8, _param1) >> 8 != 1:
          revert with 0, 'unsupported action'
      return _param2
  if Mask(160, 10, _param1) >> 10 != 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0:
      revert with 0, 'unsupported pool'
  if 1 == Mask(2, 8, _param1) >> 8:
      require ext_code.size(Mask(160, 10, _param1) >> 10)
      static call Mask(160, 10, _param1) >> 10.getWstETHByStETH(uint256 _stETHAmount) with:
              gas gas_remaining wei
             args _param2
  else:
      if Mask(2, 8, _param1) >> 8 != 2:
          revert with 0, 'unsupported action'
      require ext_code.size(Mask(160, 10, _param1) >> 10)
      static call Mask(160, 10, _param1) >> 10.getStETHByWstETH(uint256 _wstETHAmount) with:
              gas gas_remaining wei
             args _param2
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  return ext_call.return_data[0]

def unknown22fdad5f(address _param1, address _param2): # not payable
  require calldata.size - 4 >= 64
  if caller != 0x997b6f43c1c1e8630d03b8e3c11b60e98a1bea90:
      revert with 0, 'only registry'
  if not _param1:
      call _param2 with:
         value eth.balance(this.address) wei
           gas gas_remaining wei
      if not ext_call.success:
          revert with 0, 'withdraw ETH failed'
  else:
      require ext_code.size(_param1)
      static call _param1.balanceOf(address account) with:
              gas gas_remaining wei
             args this.address
      if not ext_call.success:
          revert with ext_call.return_data[0 len return_data.size]
      require return_data.size >= 32
      if eth.balance(this.address) < 0:
          revert with 0, 32, 38, 0xfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c, mem[366 len 26]
      if not ext_code.size(_param1):
          revert with 0, 'Address: call to non-contract'
      mem[260 len 64] = transfer(address recipient, uint256 amount), address(_param2) << 64, 0, ext_call.return_data[0 len 28]
      mem[324 len 0] = 0
      call _param1 with:
           gas gas_remaining wei
          args Mask(480, -256, ext_call.return_data[0 len 28]) << 256, mem[324 len 4]
      if not return_data.size:
          if not ext_call.success:
              revert with transfer(address recipient, uint256 amount), address(_param2) << 64, 0, ext_call.return_data[0]
          if not transfer(address recipient, uint256 amount), address(_param2) << 64:
              revert with 0, 32, 42, 0x6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565, mem[370 len 22]
      else:
          mem[292 len return_data.size] = ext_call.return_data[0 len return_data.size]
          if not ext_call.success:
              if return_data.size:
                  revert with ext_call.return_data[0 len return_data.size]
              revert with 0, 'SafeERC20: low-level call failed'
          if return_data.size:
              require return_data.size >= 32
              if not mem[292]:
                  revert with 0, 
                              32,
                              42,
                              0x6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565,
                              mem[ceil32(return_data.size) + 371 len 22]

def unknown392f084f(uint8 _param1, uint256 _param2, uint256 _param3) payable: 
  require calldata.size - 4 >= 96
  if _param1 != 10:
      revert with 0, 'unsupported poolType'
  if Mask(160, 10, _param1) >> 10 == 0xae7ab96520de3a18e5e111b5eaab095312d7fe84:
      if Mask(2, 8, _param1) >> 8 != 1:
          revert with 0, 'unsupported action'
      if eth.balance(this.address) >= _param2:
          require ext_code.size(Mask(160, 10, _param1) >> 10)
          call Mask(160, 10, _param1) >> 10.submit(address id) with:
             value _param2 wei
               gas gas_remaining wei
              args 0x26b2ec4e02ebe2f54583af25b647b1d619e67bbf
          if not ext_call.success:
              revert with ext_call.return_data[0 len return_data.size]
          require return_data.size >= 32
          require ext_code.size(Mask(160, 10, _param1) >> 10)
          static call Mask(160, 10, _param1) >> 10.getPooledEthByShares(uint256 _sharesAmount) with:
                  gas gas_remaining wei
                 args ext_call.return_data[0]
          if not ext_call.success:
              revert with ext_call.return_data[0 len return_data.size]
          require return_data.size >= 32
          if address(_param3) != this.address:
              if eth.balance(this.address) < 0:
                  revert with 0, 32, 38, 0xfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c, mem[366 len 26]
              if not ext_code.size(Mask(160, 10, _param1) >> 10):
                  revert with 0, 'Address: call to non-contract'
              mem[260 len 64] = transfer(address recipient, uint256 amount), address(_param3) << 64, 0, ext_call.return_data[0 len 28]
              call Mask(160, 10, _param1) >> 10 with:
                   gas gas_remaining wei
                  args Mask(480, -256, ext_call.return_data[0 len 28]) << 256, mem[324 len 4]
              if not return_data.size:
                  if not ext_call.success:
                      revert with transfer(address recipient, uint256 amount), address(_param3) << 64, 0, ext_call.return_data[0]
                  if not transfer(address recipient, uint256 amount), address(_param3) << 64:
                      revert with 0, 32, 42, 0x6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565, mem[370 len 22]
              else:
                  mem[292 len return_data.size] = ext_call.return_data[0 len return_data.size]
                  if not ext_call.success:
                      if return_data.size:
                          revert with ext_call.return_data[0 len return_data.size]
                      revert with 0, 'SafeERC20: low-level call failed'
                  if return_data.size:
                      require return_data.size >= 32
                      if not mem[292]:
                          revert with 0, 
                                      32,
                                      42,
                                      0x6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565,
                                      mem[ceil32(return_data.size) + 371 len 22]
      else:
          require ext_code.size(0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2)
          call 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.withdraw(uint256 amount) with:
               gas gas_remaining wei
              args _param2
          if not ext_call.success:
              revert with ext_call.return_data[0 len return_data.size]
          require ext_code.size(Mask(160, 10, _param1) >> 10)
          call Mask(160, 10, _param1) >> 10.submit(address id) with:
             value _param2 wei
               gas gas_remaining wei
              args 0x26b2ec4e02ebe2f54583af25b647b1d619e67bbf
          if not ext_call.success:
              revert with ext_call.return_data[0 len return_data.size]
          require return_data.size >= 32
          require ext_code.size(Mask(160, 10, _param1) >> 10)
          static call Mask(160, 10, _param1) >> 10.getPooledEthByShares(uint256 _sharesAmount) with:
                  gas gas_remaining wei
                 args ext_call.return_data[0]
          if not ext_call.success:
              revert with ext_call.return_data[0 len return_data.size]
          require return_data.size >= 32
          if address(_param3) != this.address:
              if eth.balance(this.address) < 0:
                  revert with 0, 32, 38, 0xfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c, mem[366 len 26]
              if not ext_code.size(Mask(160, 10, _param1) >> 10):
                  revert with 0, 'Address: call to non-contract'
              mem[260 len 64] = transfer(address recipient, uint256 amount), address(_param3) << 64, 0, ext_call.return_data[0 len 28]
              mem[324 len 0] = 0
              call Mask(160, 10, _param1) >> 10 with:
                   gas gas_remaining wei
                  args Mask(480, -256, ext_call.return_data[0 len 28]) << 256, mem[324 len 4]
              if not return_data.size:
                  if not ext_call.success:
                      revert with transfer(address recipient, uint256 amount), address(_param3) << 64, 0, ext_call.return_data[0]
                  if not transfer(address recipient, uint256 amount), address(_param3) << 64:
                      revert with 0, 32, 42, 0x6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565, mem[370 len 22]
              else:
                  mem[292 len return_data.size] = ext_call.return_data[0 len return_data.size]
                  if not ext_call.success:
                      if return_data.size:
                          revert with ext_call.return_data[0 len return_data.size]
                      revert with 0, 'SafeERC20: low-level call failed'
                  if return_data.size:
                      require return_data.size >= 32
                      if not mem[292]:
                          revert with 0, 
                                      32,
                                      42,
                                      0x6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565,
                                      mem[ceil32(return_data.size) + 371 len 22]
      return ext_call.return_data[0]
  if Mask(160, 10, _param1) >> 10 != 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0:
      revert with 0, 'unsupported pool'
  if Mask(2, 8, _param1) >> 8 != 1:
      if Mask(2, 8, _param1) >> 8 != 2:
          revert with 0, 'unsupported action'
      require ext_code.size(Mask(160, 10, _param1) >> 10)
      call Mask(160, 10, _param1) >> 10.unwrap(uint256 amount) with:
           gas gas_remaining wei
          args _param2
      if not ext_call.success:
          revert with ext_call.return_data[0 len return_data.size]
      require return_data.size >= 32
      if address(_param3) != this.address:
          if eth.balance(this.address) < 0:
              revert with 0, 32, 38, 0xfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c, mem[366 len 26]
          if not ext_code.size(0xae7ab96520de3a18e5e111b5eaab095312d7fe84):
              revert with 0, 'Address: call to non-contract'
          mem[260 len 64] = transfer(address recipient, uint256 amount), address(_param3) << 64, 0, ext_call.return_data[0 len 28]
          call 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 with:
               gas gas_remaining wei
              args Mask(480, -256, ext_call.return_data[0 len 28]) << 256, mem[324 len 4]
          if not return_data.size:
              if not ext_call.success:
                  revert with transfer(address recipient, uint256 amount), address(_param3) << 64, 0, ext_call.return_data[0]
              if not transfer(address recipient, uint256 amount), address(_param3) << 64:
                  revert with 0, 32, 42, 0x6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565, mem[370 len 22]
          else:
              mem[292 len return_data.size] = ext_call.return_data[0 len return_data.size]
              if not ext_call.success:
                  if return_data.size:
                      revert with ext_call.return_data[0 len return_data.size]
                  revert with 0, 'SafeERC20: low-level call failed'
              if return_data.size:
                  require return_data.size >= 32
                  if not mem[292]:
                      revert with 0, 
                                  32,
                                  42,
                                  0x6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565,
                                  mem[ceil32(return_data.size) + 371 len 22]
      return ext_call.return_data[0]
  require ext_code.size(0xae7ab96520de3a18e5e111b5eaab095312d7fe84)
  static call 0xae7ab96520de3a18e5e111b5eaab095312d7fe84.allowance(address owner, address spender) with:
          gas gas_remaining wei
         args this.address, Mask(160, 10, _param1) >> 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  if ext_call.return_data[0] >= _param2:
      require ext_code.size(Mask(160, 10, _param1) >> 10)
      call Mask(160, 10, _param1) >> 10.wrap(uint256 tokenId) with:
           gas gas_remaining wei
          args _param2
      if not ext_call.success:
          revert with ext_call.return_data[0 len return_data.size]
      require return_data.size >= 32
      if address(_param3) != this.address:
          if eth.balance(this.address) < 0:
              revert with 0, 32, 38, 0xfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c, mem[366 len 26]
          if not ext_code.size(Mask(160, 10, _param1) >> 10):
              revert with 0, 'Address: call to non-contract'
          mem[260 len 64] = transfer(address recipient, uint256 amount), address(_param3) << 64, 0, ext_call.return_data[0 len 28]
          call Mask(160, 10, _param1) >> 10 with:
               gas gas_remaining wei
              args Mask(480, -256, ext_call.return_data[0 len 28]) << 256, mem[324 len 4]
          if not return_data.size:
              if not ext_call.success:
                  revert with transfer(address recipient, uint256 amount), address(_param3) << 64, 0, ext_call.return_data[0]
              if not transfer(address recipient, uint256 amount), address(_param3) << 64:
                  revert with 0, 32, 42, 0x6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565, mem[370 len 22]
          else:
              mem[292 len return_data.size] = ext_call.return_data[0 len return_data.size]
              if not ext_call.success:
                  if return_data.size:
                      revert with ext_call.return_data[0 len return_data.size]
                  revert with 0, 'SafeERC20: low-level call failed'
              if return_data.size:
                  require return_data.size >= 32
                  if not mem[292]:
                      revert with 0, 
                                  32,
                                  42,
                                  0x6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565,
                                  mem[ceil32(return_data.size) + 371 len 22]
      return ext_call.return_data[0]
  if eth.balance(this.address) < 0:
      revert with 0, 32, 38, 0xfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c, mem[366 len 26]
  if not ext_code.size(0xae7ab96520de3a18e5e111b5eaab095312d7fe84):
      revert with 0, 'Address: call to non-contract'
  mem[260 len 64] = approve(address spender, uint256 amount), Mask(160, 10, _param1) << 54, 0, 0
  mem[324 len 0] = 0
  call 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 with:
       gas gas_remaining wei
      args Mask(480, -256, approve(address spender, uint256 amount), Mask(160, 10, _param1) << 54, 0, 0) << 256, mem[324 len 4]
  if not return_data.size:
      if not ext_call.success:
          revert with approve(address spender, uint256 amount), Mask(160, 10, _param1) << 54, 0, 0
      if not approve(address spender, uint256 amount), Mask(160, 10, _param1) << 54:
          revert with 0, 32, 42, 0x6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565, mem[370 len 22]
      require ext_code.size(0xae7ab96520de3a18e5e111b5eaab095312d7fe84)
      static call 0xae7ab96520de3a18e5e111b5eaab095312d7fe84.allowance(address owner, address spender) with:
              gas gas_remaining wei
             args this.address, Mask(160, 10, _param1) >> 10
      if not ext_call.success:
          revert with ext_call.return_data[0 len return_data.size]
      require return_data.size >= 32
      if ext_call.return_data[0]:
          revert with 0, 
                      32,
                      54,
                      0x645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e63,
                      mem[382 len 10]
      if eth.balance(this.address) < 0:
          revert with 0, 32, 38, 0xfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c, mem[530 len 26]
      if not ext_code.size(0xae7ab96520de3a18e5e111b5eaab095312d7fe84):
          revert with 0, 'Address: call to non-contract'
      mem[424 len 64] = 0, Mask(160, 10, _param1) << 86, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff
      call 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 with:
           gas gas_remaining wei
          args -1, mem[360 len 28], mem[488 len 4]
      if not return_data.size:
          if not ext_call.success:
              revert with approve(address spender, uint256 amount), Mask(160, 10, _param1) << 54, 0, 0
          if not approve(address spender, uint256 amount), Mask(160, 10, _param1) << 54:
              revert with 0, 32, 42, 0x6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565, mem[534 len 22]
          require ext_code.size(Mask(160, 10, _param1) >> 10)
          call Mask(160, 10, _param1) >> 10.wrap(uint256 tokenId) with:
               gas gas_remaining wei
              args _param2
          if not ext_call.success:
              revert with ext_call.return_data[0 len return_data.size]
          require return_data.size >= 32
          if this.address == address(_param3):
              return ext_call.return_data[0]
          if eth.balance(this.address) < 0:
              revert with 0, 32, 38, 0xfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c, mem[694 len 26]
          if not ext_code.size(Mask(160, 10, _param1) >> 10):
              revert with 0, 'Address: call to non-contract'
      else:
          mem[456 len return_data.size] = ext_call.return_data[0 len return_data.size]
          if not ext_call.success:
              if return_data.size:
                  revert with ext_call.return_data[0 len return_data.size]
          else:
              if return_data.size:
                  require return_data.size >= 32
                  if not mem[456]:
                      revert with 0, 
                                  32,
                                  42,
                                  0x6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565,
                                  mem[ceil32(return_data.size) + 535 len 22]
              require ext_code.size(Mask(160, 10, _param1) >> 10)
              call Mask(160, 10, _param1) >> 10.wrap(uint256 tokenId) with:
                   gas gas_remaining wei
                  args _param2
              if not ext_call.success:
                  revert with ext_call.return_data[0 len return_data.size]
              require return_data.size >= 32
              if this.address == address(_param3):
                  return ext_call.return_data[0]
              if eth.balance(this.address) < 0:
                  revert with 0, 
                              32,
                              38,
                              0xfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c,
                              mem[ceil32(return_data.size) + 695 len 26]
              if not ext_code.size(Mask(160, 10, _param1) >> 10):
                  revert with 0, 'Address: call to non-contract'
  else:
      mem[292 len return_data.size] = ext_call.return_data[0 len return_data.size]
      if not ext_call.success:
          if return_data.size:
              revert with ext_call.return_data[0 len return_data.size]
          revert with 0, 'SafeERC20: low-level call failed'
      if not return_data.size:
          require ext_code.size(0xae7ab96520de3a18e5e111b5eaab095312d7fe84)
          static call 0xae7ab96520de3a18e5e111b5eaab095312d7fe84.allowance(address owner, address spender) with:
                  gas gas_remaining wei
                 args this.address, Mask(160, 10, _param1) >> 10
          if not ext_call.success:
              revert with ext_call.return_data[0 len return_data.size]
          require return_data.size >= 32
          if ext_call.return_data[0]:
              revert with 0, 
                          32,
                          54,
                          0x645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e63,
                          mem[ceil32(return_data.size) + 383 len 10]
          if eth.balance(this.address) < 0:
              revert with 0, 
                          32,
                          38,
                          0xfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c,
                          mem[ceil32(return_data.size) + 531 len 26]
          if not ext_code.size(0xae7ab96520de3a18e5e111b5eaab095312d7fe84):
              revert with 0, 'Address: call to non-contract'
          mem[ceil32(return_data.size) + 425 len 64] = 0, Mask(160, 10, _param1) << 86, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff
          call 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 with:
               gas gas_remaining wei
              args -1, mem[ceil32(return_data.size) + 361 len 28], mem[ceil32(return_data.size) + 489 len 4]
          if not return_data.size:
              if not ext_call.success:
                  revert with approve(address spender, uint256 amount), Mask(160, 10, _param1) << 54, 0, 0
              if not approve(address spender, uint256 amount), Mask(160, 10, _param1) << 54:
                  revert with 0, 
                              32,
                              42,
                              0x6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565,
                              mem[ceil32(return_data.size) + 535 len 22]
              require ext_code.size(Mask(160, 10, _param1) >> 10)
              call Mask(160, 10, _param1) >> 10.wrap(uint256 tokenId) with:
                   gas gas_remaining wei
                  args _param2
              if not ext_call.success:
                  revert with ext_call.return_data[0 len return_data.size]
              require return_data.size >= 32
              if this.address == address(_param3):
                  return ext_call.return_data[0]
              if eth.balance(this.address) < 0:
                  revert with 0, 
                              32,
                              38,
                              0xfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c,
                              mem[ceil32(return_data.size) + 695 len 26]
              if not ext_code.size(Mask(160, 10, _param1) >> 10):
                  revert with 0, 'Address: call to non-contract'
          else:
              mem[ceil32(return_data.size) + 457 len return_data.size] = ext_call.return_data[0 len return_data.size]
              if not ext_call.success:
                  if return_data.size:
                      revert with ext_call.return_data[0 len return_data.size]
              else:
                  if return_data.size:
                      require return_data.size >= 32
                      if not mem[ceil32(return_data.size) + 457]:
                          revert with 0, 
                                      32,
                                      42,
                                      0x6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565,
                                      mem[(2 * ceil32(return_data.size)) + 536 len 22]
                  require ext_code.size(Mask(160, 10, _param1) >> 10)
                  call Mask(160, 10, _param1) >> 10.wrap(uint256 tokenId) with:
                       gas gas_remaining wei
                      args _param2
                  if not ext_call.success:
                      revert with ext_call.return_data[0 len return_data.size]
                  require return_data.size >= 32
                  if this.address == address(_param3):
                      return ext_call.return_data[0]
                  if eth.balance(this.address) < 0:
                      revert with 0, 
                                  32,
                                  38,
                                  0xfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c,
                                  mem[(2 * ceil32(return_data.size)) + 696 len 26]
                  if not ext_code.size(Mask(160, 10, _param1) >> 10):
                      revert with 0, 'Address: call to non-contract'
      else:
          require return_data.size >= 32
          if not mem[292]:
              revert with 0, 
                          32,
                          42,
                          0x6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565,
                          mem[ceil32(return_data.size) + 371 len 22]
          require ext_code.size(0xae7ab96520de3a18e5e111b5eaab095312d7fe84)
          static call 0xae7ab96520de3a18e5e111b5eaab095312d7fe84.allowance(address owner, address spender) with:
                  gas gas_remaining wei
                 args this.address, Mask(160, 10, _param1) >> 10
          if not ext_call.success:
              revert with ext_call.return_data[0 len return_data.size]
          require return_data.size >= 32
          if ext_call.return_data[0]:
              revert with 0, 
                          32,
                          54,
                          0x645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e63,
                          mem[ceil32(return_data.size) + 383 len 10]
          if eth.balance(this.address) < 0:
              revert with 0, 
                          32,
                          38,
                          0xfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c,
                          mem[ceil32(return_data.size) + 531 len 26]
          if not ext_code.size(0xae7ab96520de3a18e5e111b5eaab095312d7fe84):
              revert with 0, 'Address: call to non-contract'
          mem[ceil32(return_data.size) + 425 len 64] = 0, Mask(160, 10, _param1) << 86, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff
          call 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 with:
               gas gas_remaining wei
              args -1, mem[ceil32(return_data.size) + 361 len 28], mem[ceil32(return_data.size) + 489 len 4]
          if not return_data.size:
              if not ext_call.success:
                  revert with approve(address spender, uint256 amount), Mask(160, 10, _param1) << 54, 0, 0
              if not approve(address spender, uint256 amount), Mask(160, 10, _param1) << 54:
                  revert with 0, 
                              32,
                              42,
                              0x6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565,
                              mem[ceil32(return_data.size) + 535 len 22]
              require ext_code.size(Mask(160, 10, _param1) >> 10)
              call Mask(160, 10, _param1) >> 10.wrap(uint256 tokenId) with:
                   gas gas_remaining wei
                  args _param2
              if not ext_call.success:
                  revert with ext_call.return_data[0 len return_data.size]
              require return_data.size >= 32
              if this.address == address(_param3):
                  return ext_call.return_data[0]
              if eth.balance(this.address) < 0:
                  revert with 0, 
                              32,
                              38,
                              0xfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c,
                              mem[ceil32(return_data.size) + 695 len 26]
              if not ext_code.size(Mask(160, 10, _param1) >> 10):
                  revert with 0, 'Address: call to non-contract'
          else:
              mem[ceil32(return_data.size) + 457 len return_data.size] = ext_call.return_data[0 len return_data.size]
              if not ext_call.success:
                  if return_data.size:
                      revert with ext_call.return_data[0 len return_data.size]
              else:
                  if return_data.size:
                      require return_data.size >= 32
                      if not mem[ceil32(return_data.size) + 457]:
                          revert with 0, 
                                      32,
                                      42,
                                      0x6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565,
                                      mem[(2 * ceil32(return_data.size)) + 536 len (2 * ceil32(return_data.size)) + (-2 * ceil32(return_data.size)) + 22]
                  require ext_code.size(Mask(160, 10, _param1) >> 10)
                  call Mask(160, 10, _param1) >> 10.wrap(uint256 tokenId) with:
                       gas gas_remaining wei
                      args _param2
                  if not ext_call.success:
                      revert with ext_call.return_data[0 len return_data.size]
                  require return_data.size >= 32
                  if this.address == address(_param3):
                      return ext_call.return_data[0]
                  if eth.balance(this.address) < 0:
                      revert with 0, 
                                  32,
                                  38,
                                  0xfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c,
                                  mem[(2 * ceil32(return_data.size)) + 696 len 26]
                  if not ext_code.size(Mask(160, 10, _param1) >> 10):
                      revert with 0, 'Address: call to non-contract'
  ...  # Decompilation aborted, sorry: ("decompilation didn't finish",)

Decompilation generated by Panoramix.

Raw bytecode

0x60806040526004361061004e5760003560e01c806322fdad5f1461005a578063392f084f146100975780637b103999146100db5780637c21ce141461010c5780639114750b1461016557610055565b3661005557005b600080fd5b34801561006657600080fd5b506100956004803603604081101561007d57600080fd5b506001600160a01b0381358116916020013516610195565b005b6100c9600480360360608110156100ad57600080fd5b50803590602081013590604001356001600160a01b0316610344565b60408051918252519081900360200190f35b3480156100e757600080fd5b506100f061070a565b604080516001600160a01b039092168252519081900360200190f35b34801561011857600080fd5b506101366004803603602081101561012f57600080fd5b503561072e565b60405180836001600160a01b03168152602001826001600160a01b031681526020019250505060405180910390f35b34801561017157600080fd5b506100c96004803603604081101561018857600080fd5b508035906020013561089c565b336001600160a01b037f000000000000000000000000997b6f43c1c1e8630d03b8e3c11b60e98a1bea901614610202576040805162461bcd60e51b815260206004820152600d60248201526c6f6e6c7920726567697374727960981b604482015290519081900360640190fd5b6001600160a01b0382166102b2576040516000906001600160a01b0383169047908381818185875af1925050503d806000811461025b576040519150601f19603f3d011682016040523d82523d6000602084013e610260565b606091505b50509050806102ac576040805162461bcd60e51b81526020600482015260136024820152721dda5d1a191c985dc81155120819985a5b1959606a1b604482015290519081900360640190fd5b50610340565b61034081836001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561030357600080fd5b505afa158015610317573d6000803e3d6000fd5b505050506040513d602081101561032d57600080fd5b50516001600160a01b0385169190610a35565b5050565b600061034f84610a8c565b600a1461039a576040805162461bcd60e51b8152602060048201526014602482015273756e737570706f7274656420706f6f6c5479706560601b604482015290519081900360640190fd5b60006103a585610a92565b90506001600160a01b03600a86901c168073ae7ab96520de3a18e5e111b5eaab095312d7fe8481141561053d5782600114156104f6576103e486610a9b565b6000826001600160a01b031663a1903eab887326b2ec4e02ebe2f54583af25b647b1d619e67bbf6040518363ffffffff1660e01b815260040180826001600160a01b031681526020019150506020604051808303818588803b15801561044957600080fd5b505af115801561045d573d6000803e3d6000fd5b50505050506040513d602081101561047457600080fd5b505160408051630f451f7160e31b81526004810183905290519192506001600160a01b03851691637a28fb8891602480820192602092909190829003018186803b1580156104c157600080fd5b505afa1580156104d5573d6000803e3d6000fd5b505050506040513d60208110156104eb57600080fd5b505194506105389050565b6040805162461bcd60e51b81526020600482015260126024820152713ab739bab83837b93a32b21030b1ba34b7b760711b604482015290519081900360640190fd5b6106dc565b6001600160a01b038216737f39c581f595b53c5cb19bd0b3f8da6c935e2ca0141561069c5782600114156106035761058a73ae7ab96520de3a18e5e111b5eaab095312d7fe848388610b19565b816001600160a01b031663ea598cb0876040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b1580156105d057600080fd5b505af11580156105e4573d6000803e3d6000fd5b505050506040513d60208110156105fa57600080fd5b50519350610538565b82600214156104f657816001600160a01b031663de0e9a3e876040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b15801561065257600080fd5b505af1158015610666573d6000803e3d6000fd5b505050506040513d602081101561067c57600080fd5b5051935073ae7ab96520de3a18e5e111b5eaab095312d7fe849050610538565b6040805162461bcd60e51b815260206004820152601060248201526f1d5b9cdd5c1c1bdc9d1959081c1bdbdb60821b604482015290519081900360640190fd5b6001600160a01b0385163014610700576107006001600160a01b0382168686610a35565b5050509392505050565b7f000000000000000000000000997b6f43c1c1e8630d03b8e3c11b60e98a1bea9081565b60008061073a83610a8c565b600a14610785576040805162461bcd60e51b8152602060048201526014602482015273756e737570706f7274656420706f6f6c5479706560601b604482015290519081900360640190fd5b600061079084610a92565b90506001600160a01b03600a85901c1673ae7ab96520de3a18e5e111b5eaab095312d7fe848114156107fa5781600114156104f65773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ae7ab96520de3a18e5e111b5eaab095312d7fe84935093505050610897565b6001600160a01b038116737f39c581f595b53c5cb19bd0b3f8da6c935e2ca0141561069c57816001141561085d5773ae7ab96520de3a18e5e111b5eaab095312d7fe84737f39c581f595b53c5cb19bd0b3f8da6c935e2ca0935093505050610897565b81600214156104f657737f39c581f595b53c5cb19bd0b3f8da6c935e2ca073ae7ab96520de3a18e5e111b5eaab095312d7fe849350935050505b915091565b60006108a783610a8c565b600a146108f2576040805162461bcd60e51b8152602060048201526014602482015273756e737570706f7274656420706f6f6c5479706560601b604482015290519081900360640190fd5b60006108fd84610a92565b90506001600160a01b03600a85901c1673ae7ab96520de3a18e5e111b5eaab095312d7fe8481141561093b5781600114156104f6578392505b610a2d565b6001600160a01b038116737f39c581f595b53c5cb19bd0b3f8da6c935e2ca0141561069c5781600114156109e057806001600160a01b031663b0e38900856040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156109ad57600080fd5b505afa1580156109c1573d6000803e3d6000fd5b505050506040513d60208110156109d757600080fd5b50519250610936565b81600214156104f657806001600160a01b031663bb2952fc856040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156109ad57600080fd5b505092915050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610a87908490610bfc565b505050565b60ff1690565b60081c60031690565b80471015610b165773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316632e1a7d4d826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015610afd57600080fd5b505af1158015610b11573d6000803e3d6000fd5b505050505b50565b610b2283610cad565b158015610ba8575060408051636eb1769f60e11b81523060048201526001600160a01b0384811660248301529151839286169163dd62ed3e916044808301926020929190829003018186803b158015610b7a57600080fd5b505afa158015610b8e573d6000803e3d6000fd5b505050506040513d6020811015610ba457600080fd5b5051105b15610a8757730316eb71485b0ab14103307bf65a021042c6d3806001600160a01b03841614610be657610be66001600160a01b038416836000610ce7565b610a876001600160a01b03841683600019610ce7565b6000610c51826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610dfa9092919063ffffffff16565b805190915015610a8757808060200190516020811015610c7057600080fd5b5051610a875760405162461bcd60e51b815260040180806020018281038252602a81526020018061103f602a913960400191505060405180910390fd5b60006001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1480610ce157506001600160a01b038216155b92915050565b801580610d6d575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b158015610d3f57600080fd5b505afa158015610d53573d6000803e3d6000fd5b505050506040513d6020811015610d6957600080fd5b5051155b610da85760405162461bcd60e51b81526004018080602001828103825260368152602001806110696036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052610a87908490610bfc565b6060610e098484600085610e13565b90505b9392505050565b606082471015610e545760405162461bcd60e51b81526004018080602001828103825260268152602001806110196026913960400191505060405180910390fd5b610e5d85610f6e565b610eae576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b60208310610eec5780518252601f199092019160209182019101610ecd565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610f4e576040519150601f19603f3d011682016040523d82523d6000602084013e610f53565b606091505b5091509150610f63828286610f74565b979650505050505050565b3b151590565b60608315610f83575081610e0c565b825115610f935782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610fdd578181015183820152602001610fc5565b50505050905090810190601f16801561100a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a2646970667358221220b2ba9445ddfc29038de435139c1681c7e0e608621662a9d765045518a882f57464736f6c63430007060033