ETH Price: $3,460.08 (+0.06%)
Gas: 15 Gwei

Contract

0xF066b1B7A49bc5d7da8d8CDf305370f08A05EC5b
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Initialize164230732023-01-17 0:56:35548 days ago1673916995IN
0xF066b1B7...08A05EC5b
0 ETH0.0036424632.22312599
0x60806040164230472023-01-17 0:51:23548 days ago1673916683IN
 Create: ControlPlane01
0 ETH0.0398423619.36338378

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ControlPlane01

Compiler Version
v0.8.3+commit.8d00100c

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2023-01-17
*/

// File: @openzeppelin/contracts/utils/StorageSlot.sol



pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        assembly {
            r.slot := slot
        }
    }
}

// File: @openzeppelin/contracts/utils/Address.sol



pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// File: @openzeppelin/contracts/proxy/Proxy.sol



pragma solidity ^0.8.0;

/**
 * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
 * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
 * be specified by overriding the virtual {_implementation} function.
 *
 * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a
 * different contract through the {_delegate} function.
 *
 * The success and return data of the delegated call will be returned back to the caller of the proxy.
 */
abstract contract Proxy {
    /**
     * @dev Delegates the current call to `implementation`.
     *
     * This function does not return to its internall call site, it will return directly to the external caller.
     */
    function _delegate(address implementation) internal virtual {
        assembly {
            // Copy msg.data. We take full control of memory in this inline assembly
            // block because it will not return to Solidity code. We overwrite the
            // Solidity scratch pad at memory position 0.
            calldatacopy(0, 0, calldatasize())

            // Call the implementation.
            // out and outsize are 0 because we don't know the size yet.
            let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)

            // Copy the returned data.
            returndatacopy(0, 0, returndatasize())

            switch result
            // delegatecall returns 0 on error.
            case 0 {
                revert(0, returndatasize())
            }
            default {
                return(0, returndatasize())
            }
        }
    }

    /**
     * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function
     * and {_fallback} should delegate.
     */
    function _implementation() internal view virtual returns (address);

    /**
     * @dev Delegates the current call to the address returned by `_implementation()`.
     *
     * This function does not return to its internall call site, it will return directly to the external caller.
     */
    function _fallback() internal virtual {
        _beforeFallback();
        _delegate(_implementation());
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
     * function in the contract matches the call data.
     */
    fallback() external payable virtual {
        _fallback();
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data
     * is empty.
     */
    receive() external payable virtual {
        _fallback();
    }

    /**
     * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`
     * call, or as part of the Solidity `fallback` or `receive` functions.
     *
     * If overriden should call `super._beforeFallback()`.
     */
    function _beforeFallback() internal virtual {}
}

// File: @openzeppelin/contracts/proxy/beacon/IBeacon.sol



pragma solidity ^0.8.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeacon {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {BeaconProxy} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

// File: @openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol



pragma solidity ^0.8.2;




/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 *
 * _Available since v4.1._
 *
 * @custom:oz-upgrades-unsafe-allow delegatecall
 */
abstract contract ERC1967Upgrade {
    // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Returns the current implementation address.
     */
    function _getImplementation() internal view returns (address) {
        return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Perform implementation upgrade
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Perform implementation upgrade with additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCall(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        _upgradeTo(newImplementation);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(newImplementation, data);
        }
    }

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallSecure(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        address oldImplementation = _getImplementation();

        // Initial upgrade and setup call
        _setImplementation(newImplementation);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(newImplementation, data);
        }

        // Perform rollback test if not already in progress
        StorageSlot.BooleanSlot storage rollbackTesting = StorageSlot.getBooleanSlot(_ROLLBACK_SLOT);
        if (!rollbackTesting.value) {
            // Trigger rollback using upgradeTo from the new implementation
            rollbackTesting.value = true;
            Address.functionDelegateCall(
                newImplementation,
                abi.encodeWithSignature("upgradeTo(address)", oldImplementation)
            );
            rollbackTesting.value = false;
            // Check rollback was effective
            require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades");
            // Finally reset to the new implementation and log the upgrade
            _upgradeTo(newImplementation);
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Returns the current admin.
     */
    function _getAdmin() internal view returns (address) {
        return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        require(newAdmin != address(0), "ERC1967: new admin is the zero address");
        StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     */
    function _changeAdmin(address newAdmin) internal {
        emit AdminChanged(_getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
     */
    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Emitted when the beacon is upgraded.
     */
    event BeaconUpgraded(address indexed beacon);

    /**
     * @dev Returns the current beacon.
     */
    function _getBeacon() internal view returns (address) {
        return StorageSlot.getAddressSlot(_BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            Address.isContract(IBeacon(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;
    }

    /**
     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
     *
     * Emits a {BeaconUpgraded} event.
     */
    function _upgradeBeaconToAndCall(
        address newBeacon,
        bytes memory data,
        bool forceCall
    ) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
        }
    }
}

// File: @openzeppelin/contracts/proxy/beacon/BeaconProxy.sol



pragma solidity ^0.8.0;




/**
 * @dev This contract implements a proxy that gets the implementation address for each call from a {UpgradeableBeacon}.
 *
 * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't
 * conflict with the storage layout of the implementation behind the proxy.
 *
 * _Available since v3.4._
 */
contract BeaconProxy is Proxy, ERC1967Upgrade {
    /**
     * @dev Initializes the proxy with `beacon`.
     *
     * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This
     * will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity
     * constructor.
     *
     * Requirements:
     *
     * - `beacon` must be a contract with the interface {IBeacon}.
     */
    constructor(address beacon, bytes memory data) payable {
        assert(_BEACON_SLOT == bytes32(uint256(keccak256("eip1967.proxy.beacon")) - 1));
        _upgradeBeaconToAndCall(beacon, data, false);
    }

    /**
     * @dev Returns the current beacon address.
     */
    function _beacon() internal view virtual returns (address) {
        return _getBeacon();
    }

    /**
     * @dev Returns the current implementation address of the associated beacon.
     */
    function _implementation() internal view virtual override returns (address) {
        return IBeacon(_getBeacon()).implementation();
    }

    /**
     * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.
     *
     * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.
     *
     * Requirements:
     *
     * - `beacon` must be a contract.
     * - The implementation returned by `beacon` must be a contract.
     */
    function _setBeacon(address beacon, bytes memory data) internal virtual {
        _upgradeBeaconToAndCall(beacon, data, false);
    }
}

// File: contracts/RunningControlPlane.sol

/**
 *Submitted for verification at Etherscan.io on 2022-07-22
*/

// File: @openzeppelin/contracts/utils/Context.sol



// File: contracts/PineLendingLibrary.sol


pragma solidity 0.8.3;

library PineLendingLibrary {
  struct LoanTerms {
    uint256 loanStartBlock;
    uint256 loanExpireTimestamp;
    uint32 interestBPS1000000XBlock;
    uint32 maxLTVBPS;
    uint256 borrowedWei;
    uint256 returnedWei;
    uint256 accuredInterestWei;
    uint256 repaidInterestWei;
    address borrower;
    }

  function outstanding(LoanTerms calldata loanTerms, uint txSpeedBlocks) public view returns (uint256) {
    // do not lump the interest
    if (loanTerms.borrowedWei <= loanTerms.returnedWei) return 0;
    uint256 newAccuredInterestWei = ((block.number + txSpeedBlocks -
        loanTerms.loanStartBlock) *
        (loanTerms.borrowedWei - loanTerms.returnedWei) *
        loanTerms.interestBPS1000000XBlock) / 10000000000;
    return
        (loanTerms.borrowedWei - loanTerms.returnedWei) +
        (loanTerms.accuredInterestWei -
            loanTerms.repaidInterestWei) +
        newAccuredInterestWei;
  }

  function outstanding(LoanTerms calldata loanTerms) public view returns (uint256) {
    return outstanding(loanTerms, 0);
  }

  function nftHasLoan(LoanTerms memory loanTerms) public pure returns (bool) {
      return loanTerms.borrowedWei > loanTerms.returnedWei;
  }


  function isUnHealthyLoan(LoanTerms calldata loanTerms)
      public
      view
      returns (bool, uint32)
  {
      require(nftHasLoan(loanTerms), "nft does not have active loan");
      bool isExpired = block.timestamp > loanTerms.loanExpireTimestamp &&
          outstanding(loanTerms) > 0;
      return (isExpired, 0);
  }

  event LoanInitiated(
      address indexed user,
      address indexed erc721,
      uint256 indexed nftID,
      LoanTerms loan
  );
  event LoanTermsChanged(
      address indexed user,
      address indexed erc721,
      uint256 indexed nftID,
      LoanTerms oldTerms,
      LoanTerms newTerms
  );
  event Liquidation(
      address indexed user,
      address indexed erc721,
      uint256 indexed nftID,
      uint256 liquidated_at,
      address liquidator
  );
}
// File: contracts/interfaces/IFlashLoanReceiver.sol

pragma solidity 0.8.3;

/**
* @title IFlashLoanReceiver interface
* @notice Interface for the Aave fee IFlashLoanReceiver.
* @author Aave
* @dev implement this interface to develop a flashloan-compatible flashLoanReceiver contract
**/
interface IFlashLoanReceiver {

    function executeOperation(address _reserve, uint256 _amount, uint256 _fee, bytes calldata _params) external;
}
// File: contracts/interfaces/ICloneFactory02.sol

pragma solidity 0.8.3;

/*
The MIT License (MIT)
Copyright (c) 2018 Murray Software, LLC.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//solhint-disable max-line-length
//solhint-disable no-inline-assembly
interface ICloneFactory02 {

  function createClone(address target) external returns (address result);
  function targets(address target) external returns (bool result);
  function genuineClone(address target) external returns (bool result);

  function toggleWhitelistedTarget(address target) external;
  
}
// File: contracts/interfaces/IControlPlane01.sol

/**
  * ControlPlane01.sol
  * Registers the current global params
 */
pragma solidity 0.8.3;

interface IControlPlane01 {


  function whitelistedIntermediaries(address target) external returns (bool result);
  function whitelistedFactory() external returns (address result);
  function feeBps() external returns (uint32 result);
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol



pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

// File: @openzeppelin/contracts/token/ERC20/IERC20.sol



pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

// File: @openzeppelin/contracts/utils/introspection/IERC165.sol



pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

// File: @openzeppelin/contracts/utils/introspection/ERC165.sol



pragma solidity ^0.8.0;


/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

// File: @openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol



pragma solidity ^0.8.0;


/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
        @dev Handles the receipt of a single ERC1155 token type. This function is
        called at the end of a `safeTransferFrom` after the balance has been updated.
        To accept the transfer, this must return
        `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
        (i.e. 0xf23a6e61, or its own function selector).
        @param operator The address which initiated the transfer (i.e. msg.sender)
        @param from The address which previously owned the token
        @param id The ID of the token being transferred
        @param value The amount of tokens being transferred
        @param data Additional data with no specified format
        @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
    */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
        @dev Handles the receipt of a multiple ERC1155 token types. This function
        is called at the end of a `safeBatchTransferFrom` after the balances have
        been updated. To accept the transfer(s), this must return
        `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
        (i.e. 0xbc197c81, or its own function selector).
        @param operator The address which initiated the batch transfer (i.e. msg.sender)
        @param from The address which previously owned the token
        @param ids An array containing ids of each token being transferred (order and length must match values array)
        @param values An array containing amounts of each token being transferred (order and length must match ids array)
        @param data Additional data with no specified format
        @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
    */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

// File: @openzeppelin/contracts/token/ERC1155/utils/ERC1155Receiver.sol



pragma solidity ^0.8.0;



/**
 * @dev _Available since v3.1._
 */
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
    }
}

// File: @openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol



pragma solidity ^0.8.0;


/**
 * @dev _Available since v3.1._
 */
contract ERC1155Holder is ERC1155Receiver {
    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] memory,
        uint256[] memory,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155BatchReceived.selector;
    }
}

// File: @openzeppelin/contracts/token/ERC1155/IERC1155.sol



pragma solidity ^0.8.0;


/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

// File: @openzeppelin/contracts/token/ERC721/IERC721.sol



pragma solidity ^0.8.0;


/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;
}

// File: @openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol


// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// File: @openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol


// OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;


/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

// File: @openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol


// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;


/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuardUpgradeable is Initializable {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    function __ReentrancyGuard_init() internal onlyInitializing {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
    uint256[49] private __gap;
}

// File: @openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol


// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;


/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
    uint256[50] private __gap;
}

// File: @openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol


// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;



/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
    uint256[49] private __gap;
}

// File: @openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol


// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;



/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    function __Pausable_init() internal onlyInitializing {
        __Context_init_unchained();
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
    uint256[49] private __gap;
}

// File: contracts/VerifySignaturePool02.sol


pragma solidity 0.8.3;

/* Signature Verification

How to Sign and Verify
# Signing
1. Create message to sign
2. Hash the message
3. Sign the hash (off chain, keep your private key secret)

# Verify
1. Recreate hash from the original message
2. Recover signer from signature and hash
3. Compare recovered signer to claimed signer
*/

library VerifySignaturePool02 {
    /* 1. Unlock MetaMask account
    ethereum.enable()
    */

    /* 2. Get message hash to sign
    getMessageHash(
        0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C,
        123,
        "coffee and donuts",
        1
    )

    hash = "0xcf36ac4f97dc10d91fc2cbb20d718e94a8cbfe0f82eaedc6a4aa38946fb797cd"
    */
    function getMessageHash(
        address nft,
        uint tokenID,
        uint valuation,
        uint expireAtBlock
    ) public pure returns (bytes32) {
        return keccak256(abi.encodePacked(nft, tokenID, valuation, expireAtBlock));
    }

    /* 3. Sign message hash
    # using browser
    account = "copy paste account of signer here"
    ethereum.request({ method: "personal_sign", params: [account, hash]}).then(console.log)

    # using web3
    web3.personal.sign(hash, web3.eth.defaultAccount, console.log)

    Signature will be different for different accounts
    0x993dab3dd91f5c6dc28e17439be475478f5635c92a56e17e82349d3fb2f166196f466c0b4e0c146f285204f0dcb13e5ae67bc33f4b888ec32dfe0a063e8f3f781b
    */
    function getEthSignedMessageHash(bytes32 _messageHash)
        public
        pure
        returns (bytes32)
    {
        /*
        Signature is produced by signing a keccak256 hash with the following format:
        "\x19Ethereum Signed Message\n" + len(msg) + msg
        */
        return
            keccak256(
                abi.encodePacked("\x19Ethereum Signed Message:\n32", _messageHash)
            );
    }

    /* 4. Verify signature
    signer = 0xB273216C05A8c0D4F0a4Dd0d7Bae1D2EfFE636dd
    to = 0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C
    amount = 123
    message = "coffee and donuts"
    nonce = 1
    signature =
        0x993dab3dd91f5c6dc28e17439be475478f5635c92a56e17e82349d3fb2f166196f466c0b4e0c146f285204f0dcb13e5ae67bc33f4b888ec32dfe0a063e8f3f781b
    */
    function verify(
        address nft,
        uint tokenID,
        uint valuation,
        uint expireAtBlock,
        address _signer,
        bytes memory signature
    ) public pure returns (bool) {
        bytes32 messageHash = getMessageHash(nft, tokenID, valuation, expireAtBlock);
        bytes32 ethSignedMessageHash = getEthSignedMessageHash(messageHash);

        return recoverSigner(ethSignedMessageHash, signature) == _signer;
    }

    function recoverSigner(bytes32 _ethSignedMessageHash, bytes memory _signature)
        internal
        pure
        returns (address)
    {
        (bytes32 r, bytes32 s, uint8 v) = splitSignature(_signature);

        return ecrecover(_ethSignedMessageHash, v, r, s);
    }

    function splitSignature(bytes memory sig)
        internal
        pure
        returns (
            bytes32 r,
            bytes32 s,
            uint8 v
        )
    {
        require(sig.length == 65, "invalid signature length");

        assembly {
            /*
            First 32 bytes stores the length of the signature

            add(sig, 32) = pointer of sig + 32
            effectively, skips first 32 bytes of signature

            mload(p) loads next 32 bytes starting at the memory address p into memory
            */

            // first 32 bytes, after the length prefix
            r := mload(add(sig, 32))
            // second 32 bytes
            s := mload(add(sig, 64))
            // final byte (first byte of the next 32 bytes)
            v := byte(0, mload(add(sig, 96)))
        }

        // implicitly return (r, s, v)
    }
}
// File: contracts/ERC721LendingPool02.sol


pragma solidity 0.8.3;














contract ERC721LendingPool02 is
    OwnableUpgradeable,
    IERC721Receiver,
    PausableUpgradeable,
    ReentrancyGuardUpgradeable,
    ERC1155Holder
{
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) public pure override returns (bytes4) {
        return
            bytes4(
                keccak256("onERC721Received(address,address,uint256,bytes)")
            );
    }

    /**
     * Pool Constants
     */
    address public _valuationSigner;

    address public _supportedCollection;

    address public _controlPlane;

    address public _fundSource;

    address public _supportedCurrency;

    struct PoolParams {
        uint32 interestBPS1000000XBlock;
        uint32 collateralFactorBPS;
    }

    mapping(uint256 => PoolParams) public durationSeconds_poolParam;

    mapping(uint256 => uint256) public blockLoanAmount;
    uint256 public blockLoanLimit;

    /**
     * Pool Setup
     */

    function initialize(
        address supportedCollection,
        address valuationSigner,
        address controlPlane,
        address supportedCurrency,
        address fundSource,
        address x,
        uint y
    ) public initializer {
        require(supportedCollection != address(0));
        require(valuationSigner != address(0));
        require(controlPlane != address(0));
        require(supportedCurrency != address(0));
        require(fundSource != address(0));
        __Ownable_init();
        __Pausable_init();
        __ReentrancyGuard_init();
        _supportedCollection = supportedCollection;
        _valuationSigner = valuationSigner;
        _controlPlane = controlPlane;
        _supportedCurrency = supportedCurrency;
        _fundSource = fundSource;
        blockLoanLimit = 200000000000000000000;
    }

    function setBlockLoanLimit(uint256 bll) public onlyOwner {
        require(bll > 0);
        blockLoanLimit = bll;
    }

    function setDurationParam(uint256 duration, PoolParams calldata ppm)
        public
        onlyOwner
    {
        durationSeconds_poolParam[duration] = ppm;
        require(durationSeconds_poolParam[0].collateralFactorBPS == 0);
    }

    function pause() public onlyOwner {
        _pause();
    }

    function unpause() public onlyOwner {
        _unpause();
    }

    function updateBlockLoanAmount(uint256 loanAmount) internal {
        blockLoanAmount[block.number] += loanAmount;
        require(
            blockLoanAmount[block.number] < blockLoanLimit,
            "Amount exceed block limit"
        );
    }

    /**
     * Storage and Events
     */

    mapping(uint256 => PineLendingLibrary.LoanTerms) public _loans;

    /**
     * Loan origination
     */
    function flashLoan(
        address payable _receiver,
        address _reserve,
        uint256 _amount,
        bytes memory _params
    ) external nonReentrant {
        //check that the reserve has enough available liquidity
        uint256 availableLiquidityBefore = _reserve == address(0)
            ? address(this).balance
            : IERC20(_reserve).balanceOf(_fundSource);
        require(
            availableLiquidityBefore >= _amount,
            "There is not enough liquidity available to borrow"
        );

        uint256 lenderFeeBips = durationSeconds_poolParam[0]
            .interestBPS1000000XBlock;
        //calculate amount fee
        uint256 amountFee = (_amount * (lenderFeeBips)) / (10000000000);

        //get the FlashLoanReceiver instance
        IFlashLoanReceiver receiver = IFlashLoanReceiver(_receiver);

        //transfer funds to the receiver
        if (_reserve == address(0)) {
            (bool success, ) = _receiver.call{value: _amount}("");
            require(success, "Flash loan: cannot send ether");
        } else {
            require(IERC20(_reserve).transferFrom(_fundSource, _receiver, _amount));
        }

        //execute action of the receiver
        receiver.executeOperation(_reserve, _amount, amountFee, _params);

        //check that the actual balance of the core contract includes the returned amount
        uint256 availableLiquidityAfter = _reserve == address(0)
            ? address(this).balance
            : IERC20(_reserve).balanceOf(_fundSource);

        require(
            availableLiquidityAfter == availableLiquidityBefore + (amountFee),
            "The actual balance of the protocol is inconsistent"
        );
    }

    function borrow(
        uint256[5] calldata x,
        bytes memory signature,
        bool proxy,
        address pineWallet
    ) external nonReentrant whenNotPaused returns (bool) {
        //valuation = x[0]
        //nftID = x[1]
        //uint256 loanDurationSeconds = x[2];
        //uint256 expireAtBlock = x[3];
        //uint256 borrowedAmount = x[4];
        require(
            VerifySignaturePool02.verify(
                _supportedCollection,
                x[1],
                x[0],
                x[3],
                _valuationSigner,
                signature
            ),
            "SignatureVerifier: fake valuation provided!"
        );
        require(
            IControlPlane01(_controlPlane).whitelistedIntermediaries(
                msg.sender
            ) || msg.sender == tx.origin,
            "Phishing!"
        );
        address contextUser = proxy ? tx.origin : msg.sender;
        require(
            !PineLendingLibrary.nftHasLoan(_loans[x[1]]),
            "NFT already has loan!"
        );
        uint32 maxLTVBPS = durationSeconds_poolParam[x[2]].collateralFactorBPS;
        require(maxLTVBPS > 0, "Duration not supported");

        uint256 pineMirrorID = uint256(
            keccak256(abi.encodePacked(_supportedCollection, x[1]))
        );

        if (pineWallet == (address(0))) {
            require(
                IERC721(_supportedCollection).ownerOf(x[1]) == contextUser,
                "Stealer1!"
            );
        } else {
            require(
                ICloneFactory02(
                    IControlPlane01(_controlPlane).whitelistedFactory()
                ).genuineClone(pineWallet),
                "Scammer!"
            );
            require(
                IERC721(pineWallet).ownerOf(pineMirrorID) == contextUser,
                "Stealer2!"
            );
        }

        require(block.number < x[3], "Valuation expired");
        require(
            x[4] <= (x[0] * maxLTVBPS) / 10_000,
            "Can't borrow more than max LTV"
        );
        require(
            x[4] < IERC20(_supportedCurrency).balanceOf(_fundSource),
            "not enough money"
        );

        uint32 protocolFeeBips = IControlPlane01(_controlPlane).feeBps();
        uint256 protocolFee = (x[4] * (protocolFeeBips)) / (10000);

        updateBlockLoanAmount(x[4]);

        require(IERC20(_supportedCurrency).transferFrom(
            _fundSource,
            msg.sender,
            x[4] - protocolFee
        ));
        require(IERC20(_supportedCurrency).transferFrom(
            _fundSource,
            _controlPlane,
            protocolFee
        ));
        _loans[x[1]] = PineLendingLibrary.LoanTerms(
            block.number,
            block.timestamp + x[2],
            durationSeconds_poolParam[x[2]].interestBPS1000000XBlock,
            maxLTVBPS,
            x[4],
            0,
            0,
            0,
            contextUser
        );

        if (pineWallet == (address(0))) {
            IERC721(_supportedCollection).safeTransferFrom(
                contextUser,
                address(this),
                x[1]
            );
        } else {
            IERC721(pineWallet).safeTransferFrom(
                contextUser,
                address(this),
                pineMirrorID
            );
        }

        emit PineLendingLibrary.LoanInitiated(
            contextUser,
            _supportedCollection,
            x[1],
            _loans[x[1]]
        );
        return true;
    }

    /**
     * Repay
     */

    // repay change loan terms, renew loan start, fix interest to borrowed amount, dont renew loan expiry
    function repay(
        uint256 nftID,
        uint256 repayAmount,
        address pineWallet
    ) external nonReentrant whenNotPaused returns (bool) {
        uint256 pineMirrorID = uint256(
            keccak256(abi.encodePacked(_supportedCollection, nftID))
        );
        require(
            PineLendingLibrary.nftHasLoan(_loans[nftID]),
            "NFT does not have active loan"
        );
        require(
            IERC20(_supportedCurrency).transferFrom(
                msg.sender,
                address(this),
                repayAmount
            ),
            "fund transfer unsuccessful"
        );
        PineLendingLibrary.LoanTerms memory oldLoanTerms = _loans[nftID];

        if (repayAmount >= PineLendingLibrary.outstanding(_loans[nftID])) {
            require(
                IERC20(_supportedCurrency).transfer(
                    msg.sender,
                    repayAmount - PineLendingLibrary.outstanding(_loans[nftID])
                ),
                "exceed amount transfer unsuccessful"
            );
            repayAmount = PineLendingLibrary.outstanding(_loans[nftID]);
            _loans[nftID].returnedWei = _loans[nftID].borrowedWei;
            if (pineWallet == address(0)) {
                IERC721(_supportedCollection).safeTransferFrom(
                    address(this),
                    _loans[nftID].borrower,
                    nftID
                );
            } else {
                require(
                    ICloneFactory02(
                        IControlPlane01(_controlPlane).whitelistedFactory()
                    ).genuineClone(pineWallet),
                    "Scammer!"
                );
                IERC721(pineWallet).safeTransferFrom(
                    address(this),
                    _loans[nftID].borrower,
                    pineMirrorID
                );
            }
            clearLoanTerms(nftID);
        } else {
            // lump in interest
            _loans[nftID].accuredInterestWei +=
                ((block.number - _loans[nftID].loanStartBlock) *
                    (_loans[nftID].borrowedWei - _loans[nftID].returnedWei) *
                    _loans[nftID].interestBPS1000000XBlock) /
                10000000000;
            uint256 outstandingInterest = _loans[nftID].accuredInterestWei -
                _loans[nftID].repaidInterestWei;
            if (repayAmount > outstandingInterest) {
                _loans[nftID].repaidInterestWei = _loans[nftID]
                    .accuredInterestWei;
                _loans[nftID].returnedWei += (repayAmount -
                    outstandingInterest);
            } else {
                _loans[nftID].repaidInterestWei += repayAmount;
            }
            // restart interest calculation
            _loans[nftID].loanStartBlock = block.number;
        }
        require(
            IERC20(_supportedCurrency).transferFrom(
                address(this),
                _fundSource,
                IERC20(_supportedCurrency).balanceOf(address(this))
            ),
            "fund transfer unsuccessful"
        );
        emit PineLendingLibrary.LoanTermsChanged(
            _loans[nftID].borrower,
            _supportedCollection,
            nftID,
            oldLoanTerms,
            _loans[nftID]
        );
        return true;
    }

    /**
     * Admin functions
     */

    function withdraw(uint256 amount) external onlyOwner {
        (bool success, ) = owner().call{value: amount}("");
        require(success, "cannot send ether");
    }

    function withdrawERC20(address currency, uint256 amount)
        external
        onlyOwner
    {
        require(IERC20(currency).transfer(owner(), amount));
    }

    function withdrawERC1155(address currency, uint256 id, uint256 amount)
        external
        onlyOwner
    {
        IERC1155(currency).safeTransferFrom(address(this), owner(), id, amount, "");
    }

    function withdrawERC721(
        address collection,
        uint256 nftID,
        address target,
        bool liquidation
    ) external nonReentrant {
        require(msg.sender == _controlPlane, "not control plane");
        if ((target == _supportedCollection) && liquidation) {
            PineLendingLibrary.LoanTerms memory lt = _loans[nftID];
            emit PineLendingLibrary.Liquidation(
                lt.borrower,
                _supportedCollection,
                nftID,
                block.timestamp,
                tx.origin
            );
            clearLoanTerms(nftID);
        }
        IERC721(collection).safeTransferFrom(address(this), target, nftID);
    }

    function clearLoanTerms(uint256 nftID) internal {
        _loans[nftID] = PineLendingLibrary.LoanTerms(
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            address(0)
        );
    }
}

// File: contracts/ControlPlane01.sol

/**
  * ControlPlane01.sol
  * Registers the current global params
 */
pragma solidity 0.8.3;




contract ControlPlane01 is OwnableUpgradeable {
  uint constant PRECISION = 1000000000000;
  address public whitelistedFactory;
  uint32 public feeBps;
  mapping (address => bool) public whitelistedIntermediaries;
  mapping (address => bool) public targets;
  mapping (address => bool) public genuineClone;
  address public _feeStructure;

  function initialize(
      address feeStructure
  ) public initializer {
      whitelistedFactory = address(this);
      feeBps = 0;
      _feeStructure = feeStructure;
      __Ownable_init();
  }

  function changeFeeStructure(address feeStructure) external onlyOwner {
      _feeStructure = feeStructure;
  }
  
  function toggleWhitelistedIntermediaries(address target) external onlyOwner {
    whitelistedIntermediaries[target] = !whitelistedIntermediaries[target];
  }

  function setFee(uint32 f) external onlyOwner {
    require(f < 10000);
    feeBps = f;
  }

  function ceil(uint a, uint m) public pure returns (uint ) {
      return ((a + m - 1) / m) * m;
  }

  function outstanding(PineLendingLibrary.LoanTerms calldata loanTerms, uint txSpeedBlocks) external view returns (uint256) {
    uint adjustedO = PineLendingLibrary.outstanding(loanTerms, txSpeedBlocks);
    uint ogO = PineLendingLibrary.outstanding(loanTerms);
    if (adjustedO != ogO) {
      return ceil(adjustedO, PRECISION);
    } else {
      return ogO;
    }
  }

  function outstanding(PineLendingLibrary.LoanTerms calldata loanTerms) external view returns (uint256) {
    return PineLendingLibrary.outstanding(loanTerms);
  }

  function withdraw(uint256 amount) external onlyOwner {
        (bool success, ) = owner().call{value: amount}("");
        require(success, "cannot send ether");
    }

  function withdrawERC20(address currency, uint256 amount) external onlyOwner {
      require(IERC20(currency).transfer(owner(), amount));
  }


  // function callLoan() public {

  // }

  function liquidateNFT(address payable target, uint256 loanID) external {
    ERC721LendingPool02 pool = ERC721LendingPool02(target);
    // TODO: check unhealthy
    (uint256 a,
    uint256 b,
    uint32 c,
    ,
    uint256 e,
    uint256 f,
    uint256 g,
    uint256 h,
    ) = pool._loans(loanID);
    PineLendingLibrary.LoanTerms memory lt = PineLendingLibrary.LoanTerms(a,b,c,0,e,f,g,h,address(0));
    (bool unhealthy, ) = PineLendingLibrary.isUnHealthyLoan(lt);
    require(unhealthy, "Loan is not liquidable");
    pool.withdrawERC721(pool._supportedCollection(), loanID, pool.owner(), true);
  }

  function withdrawNFT(address payable target, address nft, uint256 id) external onlyOwner {
    ERC721LendingPool02 pool = ERC721LendingPool02(target);
    // TODO: check unhealthy
    (uint256 a,
    uint256 b,
    uint32 c,
    ,
    uint256 e,
    uint256 f,
    uint256 g,
    uint256 h,
    ) = pool._loans(id);
    PineLendingLibrary.LoanTerms memory lt = PineLendingLibrary.LoanTerms(a,b,c,0,e,f,g,h,address(0));
    (bool has) = PineLendingLibrary.nftHasLoan(lt);
    require(!has, "Loan is active");
    pool.withdrawERC721(nft, id, owner(), false);
  }


  event PoolCreated(
    address indexed result,
    address indexed supportedCollection,
    address indexed supportedCurrency,
    address target,
    address fundSource,
    uint256 duration, 
    ERC721LendingPool02.PoolParams ppm
  );

  function createClone(address target, bytes32 salt, address supportedCollection, address valuationSigner, address supportedCurrency, address fundSource, uint256 duration, ERC721LendingPool02.PoolParams calldata ppm, uint256 ethLimit) public returns (address result) {
    require(targets[target]);
    // bytes20 targetBytes = bytes20(target);
    // assembly {
    //   let clone := mload(0x40)
    //   mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
    //   mstore(add(clone, 0x14), targetBytes)
    //   mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
    //   result := create2(0, clone, 0x37, salt)
    // }
    BeaconProxy bp = new BeaconProxy{salt: salt}(target, "");
    address result2 = address(bp);

    // initialize
    ERC721LendingPool02(result2).initialize(supportedCollection, valuationSigner, address(this), supportedCurrency, fundSource, _feeStructure, ethLimit);

    // create offer
    ERC721LendingPool02(result2).setDurationParam(duration, ppm);
    ERC721LendingPool02(result2).transferOwnership(msg.sender);
    genuineClone[result2] = true;
    emit PoolCreated(result2, supportedCollection, supportedCurrency, target, fundSource, duration, ppm);
    return result2;
  }

  function toggleWhitelistedTarget(address target) external onlyOwner {
    targets[target] = !targets[target];
  }
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"result","type":"address"},{"indexed":true,"internalType":"address","name":"supportedCollection","type":"address"},{"indexed":true,"internalType":"address","name":"supportedCurrency","type":"address"},{"indexed":false,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"address","name":"fundSource","type":"address"},{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"},{"components":[{"internalType":"uint32","name":"interestBPS1000000XBlock","type":"uint32"},{"internalType":"uint32","name":"collateralFactorBPS","type":"uint32"}],"indexed":false,"internalType":"struct ERC721LendingPool02.PoolParams","name":"ppm","type":"tuple"}],"name":"PoolCreated","type":"event"},{"inputs":[],"name":"_feeStructure","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"m","type":"uint256"}],"name":"ceil","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"feeStructure","type":"address"}],"name":"changeFeeStructure","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"address","name":"supportedCollection","type":"address"},{"internalType":"address","name":"valuationSigner","type":"address"},{"internalType":"address","name":"supportedCurrency","type":"address"},{"internalType":"address","name":"fundSource","type":"address"},{"internalType":"uint256","name":"duration","type":"uint256"},{"components":[{"internalType":"uint32","name":"interestBPS1000000XBlock","type":"uint32"},{"internalType":"uint32","name":"collateralFactorBPS","type":"uint32"}],"internalType":"struct ERC721LendingPool02.PoolParams","name":"ppm","type":"tuple"},{"internalType":"uint256","name":"ethLimit","type":"uint256"}],"name":"createClone","outputs":[{"internalType":"address","name":"result","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeBps","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"genuineClone","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"feeStructure","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"target","type":"address"},{"internalType":"uint256","name":"loanID","type":"uint256"}],"name":"liquidateNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"loanStartBlock","type":"uint256"},{"internalType":"uint256","name":"loanExpireTimestamp","type":"uint256"},{"internalType":"uint32","name":"interestBPS1000000XBlock","type":"uint32"},{"internalType":"uint32","name":"maxLTVBPS","type":"uint32"},{"internalType":"uint256","name":"borrowedWei","type":"uint256"},{"internalType":"uint256","name":"returnedWei","type":"uint256"},{"internalType":"uint256","name":"accuredInterestWei","type":"uint256"},{"internalType":"uint256","name":"repaidInterestWei","type":"uint256"},{"internalType":"address","name":"borrower","type":"address"}],"internalType":"struct PineLendingLibrary.LoanTerms","name":"loanTerms","type":"tuple"},{"internalType":"uint256","name":"txSpeedBlocks","type":"uint256"}],"name":"outstanding","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"loanStartBlock","type":"uint256"},{"internalType":"uint256","name":"loanExpireTimestamp","type":"uint256"},{"internalType":"uint32","name":"interestBPS1000000XBlock","type":"uint32"},{"internalType":"uint32","name":"maxLTVBPS","type":"uint32"},{"internalType":"uint256","name":"borrowedWei","type":"uint256"},{"internalType":"uint256","name":"returnedWei","type":"uint256"},{"internalType":"uint256","name":"accuredInterestWei","type":"uint256"},{"internalType":"uint256","name":"repaidInterestWei","type":"uint256"},{"internalType":"address","name":"borrower","type":"address"}],"internalType":"struct PineLendingLibrary.LoanTerms","name":"loanTerms","type":"tuple"}],"name":"outstanding","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"f","type":"uint32"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"targets","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"toggleWhitelistedIntermediaries","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"toggleWhitelistedTarget","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"whitelistedFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedIntermediaries","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"target","type":"address"},{"internalType":"address","name":"nft","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"withdrawNFT","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50612456806100206000396000f3fe60806040523480156200001157600080fd5b5060043610620001605760003560e01c80638da5cb5b11620000c9578063c4d66de81162000087578063c4d66de8146200032f578063e59694e71462000346578063ee5ea74b146200035d578063f1a8cf851462000383578063f2fde38b1462000397578063f3a3d7c414620003ae5762000160565b80638da5cb5b14620002b0578063a1db978214620002d6578063ba03c35914620002ed578063bff863ec1462000304578063c215dbf4146200031b5762000160565b80633a7b735611620001235780633a7b735614620002045780633b7b9bf4146200021b578063562c47841462000252578063715018a614620002785780638587be6e146200028257806389fb05ab14620002995762000160565b80630242958e14620001655780631ab971ab146200018f57806324a9d85314620001a85780632e1a7d4d14620001d657806333f50d2114620001ed575b600080fd5b6200017c6200017636600462001672565b620003c5565b6040519081526020015b60405180910390f35b620001a6620001a036600462001784565b62000520565b005b606554620001c090600160a01b900463ffffffff1681565b60405163ffffffff909116815260200162000186565b620001a6620001e7366004620016a1565b62000591565b620001a6620001fe36600462001497565b6200066f565b620001a6620002153660046200151a565b620006c5565b620002416200022c36600462001497565b60686020526000908152604090205460ff1681565b604051901515815260200162000186565b620002416200026336600462001497565b60676020526000908152604090205460ff1681565b620001a662000a17565b6200017c62000293366004620016d3565b62000a52565b620001a6620002aa36600462001497565b62000a8f565b6033546001600160a01b03165b6040516001600160a01b03909116815260200162000186565b620001a6620002e73660046200151a565b62000ae5565b620001a6620002fe36600462001497565b62000bc2565b620001a662000315366004620014d5565b62000c11565b606554620002bd906001600160a01b031681565b620001a66200034036600462001497565b62000eb4565b6200017c6200035736600462001653565b62000fb4565b620002416200036e36600462001497565b60666020526000908152604090205460ff1681565b606954620002bd906001600160a01b031681565b620001a6620003a836600462001497565b6200104c565b620002bd620003bf36600462001548565b620010ee565b600080731a4c2ac5d97f4f4dda2b880342b298ea58f2b80863a3d24fe485856040518363ffffffff1660e01b81526004016200040392919062001931565b60206040518083038186803b1580156200041c57600080fd5b505af415801562000431573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004579190620016ba565b90506000731a4c2ac5d97f4f4dda2b880342b298ea58f2b80863df9a33b7866040518263ffffffff1660e01b815260040162000494919062001920565b60206040518083038186803b158015620004ad57600080fd5b505af4158015620004c2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004e89190620016ba565b90508082146200050d57620005038264e8d4a5100062000a52565b925050506200051a565b91506200051a9050565b50505b92915050565b6033546001600160a01b03163314620005565760405162461bcd60e51b81526004016200054d90620018a0565b60405180910390fd5b6127108163ffffffff16106200056b57600080fd5b6065805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b6033546001600160a01b03163314620005be5760405162461bcd60e51b81526004016200054d90620018a0565b6000620005d36033546001600160a01b031690565b6001600160a01b03168260405160006040518083038185875af1925050503d80600081146200061f576040519150601f19603f3d011682016040523d82523d6000602084013e62000624565b606091505b50509050806200066b5760405162461bcd60e51b815260206004820152601160248201527031b0b73737ba1039b2b7321032ba3432b960791b60448201526064016200054d565b5050565b6033546001600160a01b031633146200069c5760405162461bcd60e51b81526004016200054d90620018a0565b6001600160a01b03166000908152606760205260409020805460ff19811660ff90911615179055565b60008290506000806000806000806000876001600160a01b031663bd5c569b8a6040518263ffffffff1660e01b81526004016200070491815260200190565b6101206040518083038186803b1580156200071e57600080fd5b505afa15801562000733573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620007599190620016f5565b5097509750975097505096509650965060006040518061012001604052808981526020018881526020018763ffffffff168152602001600063ffffffff16815260200186815260200185815260200184815260200183815260200160006001600160a01b031681525090506000731a4c2ac5d97f4f4dda2b880342b298ea58f2b80863d359b976836040518263ffffffff1660e01b8152600401620007ff919062001950565b604080518083038186803b1580156200081757600080fd5b505af41580156200082c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000852919062001618565b509050806200089d5760405162461bcd60e51b81526020600482015260166024820152754c6f616e206973206e6f74206c697175696461626c6560501b60448201526064016200054d565b896001600160a01b031663d7087bc18b6001600160a01b03166394bfd7b06040518163ffffffff1660e01b815260040160206040518083038186803b158015620008e657600080fd5b505afa158015620008fb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620009219190620014b6565b8d8d6001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200095c57600080fd5b505afa15801562000971573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620009979190620014b6565b60405160e085901b6001600160e01b03191681526001600160a01b0393841660048201526024810192909252909116604482015260016064820152608401600060405180830381600087803b158015620009f057600080fd5b505af115801562000a05573d6000803e3d6000fd5b50505050505050505050505050505050565b6033546001600160a01b0316331462000a445760405162461bcd60e51b81526004016200054d90620018a0565b62000a50600062001363565b565b60008180600162000a648287620019e1565b62000a70919062001a3f565b62000a7c9190620019fc565b62000a88919062001a1d565b9392505050565b6033546001600160a01b0316331462000abc5760405162461bcd60e51b81526004016200054d90620018a0565b6001600160a01b03166000908152606660205260409020805460ff19811660ff90911615179055565b6033546001600160a01b0316331462000b125760405162461bcd60e51b81526004016200054d90620018a0565b816001600160a01b031663a9059cbb62000b346033546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b15801562000b7d57600080fd5b505af115801562000b92573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000bb89190620015fb565b6200066b57600080fd5b6033546001600160a01b0316331462000bef5760405162461bcd60e51b81526004016200054d90620018a0565b606980546001600160a01b0319166001600160a01b0392909216919091179055565b6033546001600160a01b0316331462000c3e5760405162461bcd60e51b81526004016200054d90620018a0565b60008390506000806000806000806000876001600160a01b031663bd5c569b8a6040518263ffffffff1660e01b815260040162000c7d91815260200190565b6101206040518083038186803b15801562000c9757600080fd5b505afa15801562000cac573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000cd29190620016f5565b5097509750975097505096509650965060006040518061012001604052808981526020018881526020018763ffffffff168152602001600063ffffffff16815260200186815260200185815260200184815260200183815260200160006001600160a01b031681525090506000731a4c2ac5d97f4f4dda2b880342b298ea58f2b80863d4d30063836040518263ffffffff1660e01b815260040162000d78919062001950565b60206040518083038186803b15801562000d9157600080fd5b505af415801562000da6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000dcc9190620015fb565b9050801562000e0f5760405162461bcd60e51b815260206004820152600e60248201526d4c6f616e2069732061637469766560901b60448201526064016200054d565b896001600160a01b031663d7087bc18d8d62000e336033546001600160a01b031690565b60405160e085901b6001600160e01b03191681526001600160a01b0393841660048201526024810192909252909116604482015260006064820152608401600060405180830381600087803b15801562000e8c57600080fd5b505af115801562000ea1573d6000803e3d6000fd5b5050505050505050505050505050505050565b600054610100900460ff1662000ed15760005460ff161562000ed5565b303b155b62000f3a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016200054d565b600054610100900460ff1615801562000f5d576000805461ffff19166101011790555b606580546001600160c01b0319163063ffffffff60a01b1916179055606980546001600160a01b0319166001600160a01b03841617905562000f9e620013b5565b80156200066b576000805461ff00191690555050565b60405163df9a33b760e01b8152600090731a4c2ac5d97f4f4dda2b880342b298ea58f2b8089063df9a33b79062000ff090859060040162001920565b60206040518083038186803b1580156200100957600080fd5b505af41580156200101e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010449190620016ba565b90505b919050565b6033546001600160a01b03163314620010795760405162461bcd60e51b81526004016200054d90620018a0565b6001600160a01b038116620010e05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200054d565b620010eb8162001363565b50565b6001600160a01b03891660009081526067602052604081205460ff166200111457600080fd5b6000898b604051620011269062001452565b6001600160a01b0390911681526040602082018190526000908201526060018190604051809103906000f590508015801562001166573d6000803e3d6000fd5b506069546040516301460e3960e41b81526001600160a01b038c811660048301528b811660248301523060448301528a81166064830152898116608483015291821660a482015260c48101869052919250829190821690631460e3909060e401600060405180830381600087803b158015620011e157600080fd5b505af1158015620011f6573d6000803e3d6000fd5b5050604051636330074d60e11b81526001600160a01b038416925063c6600e9a91506200122a9089908990600401620019cb565b600060405180830381600087803b1580156200124557600080fd5b505af11580156200125a573d6000803e3d6000fd5b505060405163f2fde38b60e01b81523360048201526001600160a01b038416925063f2fde38b9150602401600060405180830381600087803b158015620012a057600080fd5b505af1158015620012b5573d6000803e3d6000fd5b50505050600160686000836001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550876001600160a01b03168a6001600160a01b0316826001600160a01b03167ffe735a4766d74f0c8b076be3f254cfc301a851f3ac49c4ae35e7d48ab75cd69d8f8b8b8b6040516200134c949392919062001869565b60405180910390a49b9a5050505050505050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620013df5760405162461bcd60e51b81526004016200054d90620018d5565b620013e9620013f3565b62000a506200141d565b600054610100900460ff1662000a505760405162461bcd60e51b81526004016200054d90620018d5565b600054610100900460ff16620014475760405162461bcd60e51b81526004016200054d90620018d5565b62000a503362001363565b6109888062001a9983390190565b8035620010478162001a6f565b805180151581146200104757600080fd5b6000610120828403121562001491578081fd5b50919050565b600060208284031215620014a9578081fd5b813562000a888162001a6f565b600060208284031215620014c8578081fd5b815162000a888162001a6f565b600080600060608486031215620014ea578182fd5b8335620014f78162001a6f565b92506020840135620015098162001a6f565b929592945050506040919091013590565b600080604083850312156200152d578182fd5b82356200153a8162001a6f565b946020939093013593505050565b6000806000806000806000806000898b0361014081121562001568578586fd5b8a35620015758162001a6f565b995060208b0135985060408b01356200158e8162001a6f565b975060608b0135620015a08162001a6f565b965060808b0135620015b28162001a6f565b955060a08b0135620015c48162001a6f565b945060c08b01359350604060df1982011215620015df578283fd5b5060e08a0191506101208a013590509295985092959850929598565b6000602082840312156200160d578081fd5b62000a88826200146d565b600080604083850312156200162b578182fd5b62001636836200146d565b91506020830151620016488162001a85565b809150509250929050565b6000610120828403121562001666578081fd5b62000a8883836200147e565b600080610140838503121562001686578182fd5b6200169284846200147e565b94610120939093013593505050565b600060208284031215620016b3578081fd5b5035919050565b600060208284031215620016cc578081fd5b5051919050565b60008060408385031215620016e6578182fd5b50508035926020909101359150565b60008060008060008060008060006101208a8c03121562001714578283fd5b8951985060208a0151975060408a01516200172f8162001a85565b60608b0151909750620017428162001a85565b8096505060808a0151945060a08a0151935060c08a0151925060e08a015191506101008a0151620017738162001a6f565b809150509295985092959850929598565b60006020828403121562001796578081fd5b813562000a888162001a85565b80358252602081013560208301526040810135620017c18162001a85565b63ffffffff1660408301526060810135620017dc8162001a85565b63ffffffff81166060840152506080810135608083015260a081013560a083015260c081013560c083015260e081013560e08301526101006200182181830162001460565b6001600160a01b031692019190915250565b8035620018408162001a85565b63ffffffff90811683526020820135906200185b8262001a85565b808216602085015250505050565b6001600160a01b038581168252841660208201526040810183905260a0810162001897606083018462001833565b95945050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b61012081016200051a8284620017a3565b6101408101620019428285620017a3565b826101208301529392505050565b6000610120820190508251825260208301516020830152604083015163ffffffff808216604085015280606086015116606085015250506080830151608083015260a083015160a083015260c083015160c083015260e083015160e08301526101008084015162000517828501826001600160a01b03169052565b8281526060810162000a88602083018462001833565b60008219821115620019f757620019f762001a59565b500190565b60008262001a1857634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161562001a3a5762001a3a62001a59565b500290565b60008282101562001a545762001a5462001a59565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114620010eb57600080fd5b63ffffffff81168114620010eb57600080fdfe608060405260405161098838038061098883398101604081905261002291610483565b61004d60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5161058e565b6000805160206109418339815191521461007757634e487b7160e01b600052600160045260246000fd5b6100838282600061008a565b50506105f3565b61009383610164565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100d45750805b1561015f5761015d836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561011557600080fd5b505afa158015610129573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014d9190610469565b8361030460201b6100291760201c565b505b505050565b6101778161033060201b6100551760201c565b6101d65760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b610259816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561021257600080fd5b505afa158015610226573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061024a9190610469565b61033060201b6100551760201c565b6102be5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101cd565b806102e360008051602061094183398151915260001b61033a60201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061032983836040518060600160405280602781526020016109616027913961033d565b9392505050565b803b15155b919050565b90565b606061034884610330565b6103a35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101cd565b600080856001600160a01b0316856040516103be919061053f565b600060405180830381855af49150503d80600081146103f9576040519150601f19603f3d011682016040523d82523d6000602084013e6103fe565b606091505b50909250905061040f828286610419565b9695505050505050565b60608315610428575081610329565b8251156104385782518084602001fd5b8160405162461bcd60e51b81526004016101cd919061055b565b80516001600160a01b038116811461033557600080fd5b60006020828403121561047a578081fd5b61032982610452565b60008060408385031215610495578081fd5b61049e83610452565b60208401519092506001600160401b03808211156104ba578283fd5b818501915085601f8301126104cd578283fd5b8151818111156104df576104df6105dd565b604051601f8201601f19908116603f01168101908382118183101715610507576105076105dd565b8160405282815288602084870101111561051f578586fd5b6105308360208301602088016105b1565b80955050505050509250929050565b600082516105518184602087016105b1565b9190910192915050565b600060208252825180602084015261057a8160408501602087016105b1565b601f01601f19169190910160400192915050565b6000828210156105ac57634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105cc5781810151838201526020016105b4565b8381111561015d5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f806106026000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b600060208252825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212204a80f67f834672aef157954081259064ac7743f0b7b6328e3ca40865d303479d64736f6c63430008030033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212208da3bebbc96775199fa1ffe47ef6e27d4360d4630dd7ff7e6994c06a45cb391c64736f6c63430008030033

Deployed Bytecode

0x60806040523480156200001157600080fd5b5060043610620001605760003560e01c80638da5cb5b11620000c9578063c4d66de81162000087578063c4d66de8146200032f578063e59694e71462000346578063ee5ea74b146200035d578063f1a8cf851462000383578063f2fde38b1462000397578063f3a3d7c414620003ae5762000160565b80638da5cb5b14620002b0578063a1db978214620002d6578063ba03c35914620002ed578063bff863ec1462000304578063c215dbf4146200031b5762000160565b80633a7b735611620001235780633a7b735614620002045780633b7b9bf4146200021b578063562c47841462000252578063715018a614620002785780638587be6e146200028257806389fb05ab14620002995762000160565b80630242958e14620001655780631ab971ab146200018f57806324a9d85314620001a85780632e1a7d4d14620001d657806333f50d2114620001ed575b600080fd5b6200017c6200017636600462001672565b620003c5565b6040519081526020015b60405180910390f35b620001a6620001a036600462001784565b62000520565b005b606554620001c090600160a01b900463ffffffff1681565b60405163ffffffff909116815260200162000186565b620001a6620001e7366004620016a1565b62000591565b620001a6620001fe36600462001497565b6200066f565b620001a6620002153660046200151a565b620006c5565b620002416200022c36600462001497565b60686020526000908152604090205460ff1681565b604051901515815260200162000186565b620002416200026336600462001497565b60676020526000908152604090205460ff1681565b620001a662000a17565b6200017c62000293366004620016d3565b62000a52565b620001a6620002aa36600462001497565b62000a8f565b6033546001600160a01b03165b6040516001600160a01b03909116815260200162000186565b620001a6620002e73660046200151a565b62000ae5565b620001a6620002fe36600462001497565b62000bc2565b620001a662000315366004620014d5565b62000c11565b606554620002bd906001600160a01b031681565b620001a66200034036600462001497565b62000eb4565b6200017c6200035736600462001653565b62000fb4565b620002416200036e36600462001497565b60666020526000908152604090205460ff1681565b606954620002bd906001600160a01b031681565b620001a6620003a836600462001497565b6200104c565b620002bd620003bf36600462001548565b620010ee565b600080731a4c2ac5d97f4f4dda2b880342b298ea58f2b80863a3d24fe485856040518363ffffffff1660e01b81526004016200040392919062001931565b60206040518083038186803b1580156200041c57600080fd5b505af415801562000431573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004579190620016ba565b90506000731a4c2ac5d97f4f4dda2b880342b298ea58f2b80863df9a33b7866040518263ffffffff1660e01b815260040162000494919062001920565b60206040518083038186803b158015620004ad57600080fd5b505af4158015620004c2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004e89190620016ba565b90508082146200050d57620005038264e8d4a5100062000a52565b925050506200051a565b91506200051a9050565b50505b92915050565b6033546001600160a01b03163314620005565760405162461bcd60e51b81526004016200054d90620018a0565b60405180910390fd5b6127108163ffffffff16106200056b57600080fd5b6065805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b6033546001600160a01b03163314620005be5760405162461bcd60e51b81526004016200054d90620018a0565b6000620005d36033546001600160a01b031690565b6001600160a01b03168260405160006040518083038185875af1925050503d80600081146200061f576040519150601f19603f3d011682016040523d82523d6000602084013e62000624565b606091505b50509050806200066b5760405162461bcd60e51b815260206004820152601160248201527031b0b73737ba1039b2b7321032ba3432b960791b60448201526064016200054d565b5050565b6033546001600160a01b031633146200069c5760405162461bcd60e51b81526004016200054d90620018a0565b6001600160a01b03166000908152606760205260409020805460ff19811660ff90911615179055565b60008290506000806000806000806000876001600160a01b031663bd5c569b8a6040518263ffffffff1660e01b81526004016200070491815260200190565b6101206040518083038186803b1580156200071e57600080fd5b505afa15801562000733573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620007599190620016f5565b5097509750975097505096509650965060006040518061012001604052808981526020018881526020018763ffffffff168152602001600063ffffffff16815260200186815260200185815260200184815260200183815260200160006001600160a01b031681525090506000731a4c2ac5d97f4f4dda2b880342b298ea58f2b80863d359b976836040518263ffffffff1660e01b8152600401620007ff919062001950565b604080518083038186803b1580156200081757600080fd5b505af41580156200082c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000852919062001618565b509050806200089d5760405162461bcd60e51b81526020600482015260166024820152754c6f616e206973206e6f74206c697175696461626c6560501b60448201526064016200054d565b896001600160a01b031663d7087bc18b6001600160a01b03166394bfd7b06040518163ffffffff1660e01b815260040160206040518083038186803b158015620008e657600080fd5b505afa158015620008fb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620009219190620014b6565b8d8d6001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200095c57600080fd5b505afa15801562000971573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620009979190620014b6565b60405160e085901b6001600160e01b03191681526001600160a01b0393841660048201526024810192909252909116604482015260016064820152608401600060405180830381600087803b158015620009f057600080fd5b505af115801562000a05573d6000803e3d6000fd5b50505050505050505050505050505050565b6033546001600160a01b0316331462000a445760405162461bcd60e51b81526004016200054d90620018a0565b62000a50600062001363565b565b60008180600162000a648287620019e1565b62000a70919062001a3f565b62000a7c9190620019fc565b62000a88919062001a1d565b9392505050565b6033546001600160a01b0316331462000abc5760405162461bcd60e51b81526004016200054d90620018a0565b6001600160a01b03166000908152606660205260409020805460ff19811660ff90911615179055565b6033546001600160a01b0316331462000b125760405162461bcd60e51b81526004016200054d90620018a0565b816001600160a01b031663a9059cbb62000b346033546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b15801562000b7d57600080fd5b505af115801562000b92573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000bb89190620015fb565b6200066b57600080fd5b6033546001600160a01b0316331462000bef5760405162461bcd60e51b81526004016200054d90620018a0565b606980546001600160a01b0319166001600160a01b0392909216919091179055565b6033546001600160a01b0316331462000c3e5760405162461bcd60e51b81526004016200054d90620018a0565b60008390506000806000806000806000876001600160a01b031663bd5c569b8a6040518263ffffffff1660e01b815260040162000c7d91815260200190565b6101206040518083038186803b15801562000c9757600080fd5b505afa15801562000cac573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000cd29190620016f5565b5097509750975097505096509650965060006040518061012001604052808981526020018881526020018763ffffffff168152602001600063ffffffff16815260200186815260200185815260200184815260200183815260200160006001600160a01b031681525090506000731a4c2ac5d97f4f4dda2b880342b298ea58f2b80863d4d30063836040518263ffffffff1660e01b815260040162000d78919062001950565b60206040518083038186803b15801562000d9157600080fd5b505af415801562000da6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000dcc9190620015fb565b9050801562000e0f5760405162461bcd60e51b815260206004820152600e60248201526d4c6f616e2069732061637469766560901b60448201526064016200054d565b896001600160a01b031663d7087bc18d8d62000e336033546001600160a01b031690565b60405160e085901b6001600160e01b03191681526001600160a01b0393841660048201526024810192909252909116604482015260006064820152608401600060405180830381600087803b15801562000e8c57600080fd5b505af115801562000ea1573d6000803e3d6000fd5b5050505050505050505050505050505050565b600054610100900460ff1662000ed15760005460ff161562000ed5565b303b155b62000f3a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016200054d565b600054610100900460ff1615801562000f5d576000805461ffff19166101011790555b606580546001600160c01b0319163063ffffffff60a01b1916179055606980546001600160a01b0319166001600160a01b03841617905562000f9e620013b5565b80156200066b576000805461ff00191690555050565b60405163df9a33b760e01b8152600090731a4c2ac5d97f4f4dda2b880342b298ea58f2b8089063df9a33b79062000ff090859060040162001920565b60206040518083038186803b1580156200100957600080fd5b505af41580156200101e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010449190620016ba565b90505b919050565b6033546001600160a01b03163314620010795760405162461bcd60e51b81526004016200054d90620018a0565b6001600160a01b038116620010e05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200054d565b620010eb8162001363565b50565b6001600160a01b03891660009081526067602052604081205460ff166200111457600080fd5b6000898b604051620011269062001452565b6001600160a01b0390911681526040602082018190526000908201526060018190604051809103906000f590508015801562001166573d6000803e3d6000fd5b506069546040516301460e3960e41b81526001600160a01b038c811660048301528b811660248301523060448301528a81166064830152898116608483015291821660a482015260c48101869052919250829190821690631460e3909060e401600060405180830381600087803b158015620011e157600080fd5b505af1158015620011f6573d6000803e3d6000fd5b5050604051636330074d60e11b81526001600160a01b038416925063c6600e9a91506200122a9089908990600401620019cb565b600060405180830381600087803b1580156200124557600080fd5b505af11580156200125a573d6000803e3d6000fd5b505060405163f2fde38b60e01b81523360048201526001600160a01b038416925063f2fde38b9150602401600060405180830381600087803b158015620012a057600080fd5b505af1158015620012b5573d6000803e3d6000fd5b50505050600160686000836001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550876001600160a01b03168a6001600160a01b0316826001600160a01b03167ffe735a4766d74f0c8b076be3f254cfc301a851f3ac49c4ae35e7d48ab75cd69d8f8b8b8b6040516200134c949392919062001869565b60405180910390a49b9a5050505050505050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620013df5760405162461bcd60e51b81526004016200054d90620018d5565b620013e9620013f3565b62000a506200141d565b600054610100900460ff1662000a505760405162461bcd60e51b81526004016200054d90620018d5565b600054610100900460ff16620014475760405162461bcd60e51b81526004016200054d90620018d5565b62000a503362001363565b6109888062001a9983390190565b8035620010478162001a6f565b805180151581146200104757600080fd5b6000610120828403121562001491578081fd5b50919050565b600060208284031215620014a9578081fd5b813562000a888162001a6f565b600060208284031215620014c8578081fd5b815162000a888162001a6f565b600080600060608486031215620014ea578182fd5b8335620014f78162001a6f565b92506020840135620015098162001a6f565b929592945050506040919091013590565b600080604083850312156200152d578182fd5b82356200153a8162001a6f565b946020939093013593505050565b6000806000806000806000806000898b0361014081121562001568578586fd5b8a35620015758162001a6f565b995060208b0135985060408b01356200158e8162001a6f565b975060608b0135620015a08162001a6f565b965060808b0135620015b28162001a6f565b955060a08b0135620015c48162001a6f565b945060c08b01359350604060df1982011215620015df578283fd5b5060e08a0191506101208a013590509295985092959850929598565b6000602082840312156200160d578081fd5b62000a88826200146d565b600080604083850312156200162b578182fd5b62001636836200146d565b91506020830151620016488162001a85565b809150509250929050565b6000610120828403121562001666578081fd5b62000a8883836200147e565b600080610140838503121562001686578182fd5b6200169284846200147e565b94610120939093013593505050565b600060208284031215620016b3578081fd5b5035919050565b600060208284031215620016cc578081fd5b5051919050565b60008060408385031215620016e6578182fd5b50508035926020909101359150565b60008060008060008060008060006101208a8c03121562001714578283fd5b8951985060208a0151975060408a01516200172f8162001a85565b60608b0151909750620017428162001a85565b8096505060808a0151945060a08a0151935060c08a0151925060e08a015191506101008a0151620017738162001a6f565b809150509295985092959850929598565b60006020828403121562001796578081fd5b813562000a888162001a85565b80358252602081013560208301526040810135620017c18162001a85565b63ffffffff1660408301526060810135620017dc8162001a85565b63ffffffff81166060840152506080810135608083015260a081013560a083015260c081013560c083015260e081013560e08301526101006200182181830162001460565b6001600160a01b031692019190915250565b8035620018408162001a85565b63ffffffff90811683526020820135906200185b8262001a85565b808216602085015250505050565b6001600160a01b038581168252841660208201526040810183905260a0810162001897606083018462001833565b95945050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b61012081016200051a8284620017a3565b6101408101620019428285620017a3565b826101208301529392505050565b6000610120820190508251825260208301516020830152604083015163ffffffff808216604085015280606086015116606085015250506080830151608083015260a083015160a083015260c083015160c083015260e083015160e08301526101008084015162000517828501826001600160a01b03169052565b8281526060810162000a88602083018462001833565b60008219821115620019f757620019f762001a59565b500190565b60008262001a1857634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161562001a3a5762001a3a62001a59565b500290565b60008282101562001a545762001a5462001a59565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114620010eb57600080fd5b63ffffffff81168114620010eb57600080fdfe608060405260405161098838038061098883398101604081905261002291610483565b61004d60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5161058e565b6000805160206109418339815191521461007757634e487b7160e01b600052600160045260246000fd5b6100838282600061008a565b50506105f3565b61009383610164565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100d45750805b1561015f5761015d836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561011557600080fd5b505afa158015610129573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014d9190610469565b8361030460201b6100291760201c565b505b505050565b6101778161033060201b6100551760201c565b6101d65760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b610259816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561021257600080fd5b505afa158015610226573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061024a9190610469565b61033060201b6100551760201c565b6102be5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101cd565b806102e360008051602061094183398151915260001b61033a60201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061032983836040518060600160405280602781526020016109616027913961033d565b9392505050565b803b15155b919050565b90565b606061034884610330565b6103a35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101cd565b600080856001600160a01b0316856040516103be919061053f565b600060405180830381855af49150503d80600081146103f9576040519150601f19603f3d011682016040523d82523d6000602084013e6103fe565b606091505b50909250905061040f828286610419565b9695505050505050565b60608315610428575081610329565b8251156104385782518084602001fd5b8160405162461bcd60e51b81526004016101cd919061055b565b80516001600160a01b038116811461033557600080fd5b60006020828403121561047a578081fd5b61032982610452565b60008060408385031215610495578081fd5b61049e83610452565b60208401519092506001600160401b03808211156104ba578283fd5b818501915085601f8301126104cd578283fd5b8151818111156104df576104df6105dd565b604051601f8201601f19908116603f01168101908382118183101715610507576105076105dd565b8160405282815288602084870101111561051f578586fd5b6105308360208301602088016105b1565b80955050505050509250929050565b600082516105518184602087016105b1565b9190910192915050565b600060208252825180602084015261057a8160408501602087016105b1565b601f01601f19169190910160400192915050565b6000828210156105ac57634e487b7160e01b81526011600452602481fd5b500390565b60005b838110156105cc5781810151838201526020016105b4565b8381111561015d5750506000910152565b634e487b7160e01b600052604160045260246000fd5b61033f806106026000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e36027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610263565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b8152600401610185919061027f565b60006020828403121561024d578081fd5b81516001600160a01b038116811461004e578182fd5b600082516102758184602087016102b2565b9190910192915050565b600060208252825180602084015261029e8160408501602087016102b2565b601f01601f19169190910160400192915050565b60005b838110156102cd5781810151838201526020016102b5565b838111156102dc576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212204a80f67f834672aef157954081259064ac7743f0b7b6328e3ca40865d303479d64736f6c63430008030033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212208da3bebbc96775199fa1ffe47ef6e27d4360d4630dd7ff7e6994c06a45cb391c64736f6c63430008030033

Libraries Used


Deployed Bytecode Sourcemap

83913:4863:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;84964:378;;;;;;:::i;:::-;;:::i;:::-;;;15082:25:1;;;15070:2;15055:18;84964:378:0;;;;;;;;84758:93;;;;;;:::i;:::-;;:::i;:::-;;84046:20;;;;;-1:-1:-1;;;84046:20:0;;;;;;;;;15634:10:1;15622:23;;;15604:42;;15592:2;15577:18;84046:20:0;15559:93:1;85517:170:0;;;;;;:::i;:::-;;:::i;88658:115::-;;;;;;:::i;:::-;;:::i;85890:621::-;;;;;;:::i;:::-;;:::i;84179:45::-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;10732:14:1;;10725:22;10707:41;;10695:2;10680:18;84179:45:0;10662:92:1;84134:40:0;;;;;;:::i;:::-;;;;;;;;;;;;;;;;62768:103;;;:::i;84857:101::-;;;;;;:::i;:::-;;:::i;84593:159::-;;;;;;:::i;:::-;;:::i;62117:87::-;62190:6;;-1:-1:-1;;;;;62190:6:0;62117:87;;;-1:-1:-1;;;;;8149:32:1;;;8131:51;;8119:2;8104:18;62117:87:0;8086:102:1;85693:142:0;;;;;;:::i;:::-;;:::i;84473:112::-;;;;;;:::i;:::-;;:::i;86517:577::-;;;;;;:::i;:::-;;:::i;84008:33::-;;;;;-1:-1:-1;;;;;84008:33:0;;;84264:203;;;;;;:::i;:::-;;:::i;85348:163::-;;;;;;:::i;:::-;;:::i;84071:58::-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;84229:28;;;;;-1:-1:-1;;;;;84229:28:0;;;63026:201;;;;;;:::i;:::-;;:::i;87353:1299::-;;;;;;:::i;:::-;;:::i;84964:378::-;85077:7;85093:14;85110:18;:30;85141:9;85152:13;85110:56;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;85093:73;;85173:8;85184:18;:30;85215:9;85184:41;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;85173:52;;85249:3;85236:9;:16;85232:105;;85270:26;85275:9;83990:13;85270:4;:26::i;:::-;85263:33;;;;;;85232:105;85326:3;-1:-1:-1;85319:10:0;;-1:-1:-1;85319:10:0;85232:105;84964:378;;;;;;;:::o;84758:93::-;62190:6;;-1:-1:-1;;;;;62190:6:0;60637:10;62337:23;62329:68;;;;-1:-1:-1;;;62329:68:0;;;;;;;:::i;:::-;;;;;;;;;84822:5:::1;84818:1;:9;;;84810:18;;;::::0;::::1;;84835:6;:10:::0;;::::1;::::0;;::::1;-1:-1:-1::0;;;84835:10:0::1;-1:-1:-1::0;;;;84835:10:0;;::::1;::::0;;;::::1;::::0;;84758:93::o;85517:170::-;62190:6;;-1:-1:-1;;;;;62190:6:0;60637:10;62337:23;62329:68;;;;-1:-1:-1;;;62329:68:0;;;;;;;:::i;:::-;85582:12:::1;85600:7;62190:6:::0;;-1:-1:-1;;;;;62190:6:0;62117:87;;85600:7:::1;-1:-1:-1::0;;;;;85600:12:0::1;85620:6;85600:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;85581:50;;;85650:7;85642:37;;;::::0;-1:-1:-1;;;85642:37:0;;11719:2:1;85642:37:0::1;::::0;::::1;11701:21:1::0;11758:2;11738:18;;;11731:30;-1:-1:-1;;;11777:18:1;;;11770:47;11834:18;;85642:37:0::1;11691:167:1::0;85642:37:0::1;62408:1;85517:170:::0;:::o;88658:115::-;62190:6;;-1:-1:-1;;;;;62190:6:0;60637:10;62337:23;62329:68;;;;-1:-1:-1;;;62329:68:0;;;;;;;:::i;:::-;-1:-1:-1;;;;;88752:15:0::1;;::::0;;;:7:::1;:15;::::0;;;;;;-1:-1:-1;;88733:34:0;::::1;88752:15;::::0;;::::1;88751:16;88733:34;::::0;;88658:115::o;85890:621::-;85968:24;86015:6;85968:54;;86060:9;86076;86092:8;86114:9;86130;86146;86162;86182:4;-1:-1:-1;;;;;86182:11:0;;86194:6;86182:19;;;;;;;;;;;;;15082:25:1;;15070:2;15055:18;;15037:76;86182:19:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;86059:142;;;;;;;;;;;;;;;;86208:38;86249:56;;;;;;;;86278:1;86249:56;;;;86280:1;86249:56;;;;86282:1;86249:56;;;;;;86284:1;86249:56;;;;;;86286:1;86249:56;;;;86288:1;86249:56;;;;86290:1;86249:56;;;;86292:1;86249:56;;;;86302:1;-1:-1:-1;;;;;86249:56:0;;;;86208:97;;86313:14;86333:18;:34;86368:2;86333:38;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;86312:59;;;86386:9;86378:44;;;;-1:-1:-1;;;86378:44:0;;11368:2:1;86378:44:0;;;11350:21:1;11407:2;11387:18;;;11380:30;-1:-1:-1;;;11426:18:1;;;11419:52;11488:18;;86378:44:0;11340:172:1;86378:44:0;86429:4;-1:-1:-1;;;;;86429:19:0;;86449:4;-1:-1:-1;;;;;86449:25:0;;:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;86478:6;86486:4;-1:-1:-1;;;;;86486:10:0;;:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;86429:76;;;;;;-1:-1:-1;;;;;;86429:76:0;;;-1:-1:-1;;;;;10386:15:1;;;86429:76:0;;;10368:34:1;10418:18;;;10411:34;;;;10481:15;;;10461:18;;;10454:43;86500:4:0;10513:18:1;;;10506:50;10302:19;;86429:76:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;85890:621;;;;;;;;;;;;:::o;62768:103::-;62190:6;;-1:-1:-1;;;;;62190:6:0;60637:10;62337:23;62329:68;;;;-1:-1:-1;;;62329:68:0;;;;;;;:::i;:::-;62833:30:::1;62860:1;62833:18;:30::i;:::-;62768:103::o:0;84857:101::-;84908:4;84951:1;;84941;84933:5;84951:1;84933;:5;:::i;:::-;:9;;;;:::i;:::-;84932:15;;;;:::i;:::-;84931:21;;;;:::i;:::-;84924:28;84857:101;-1:-1:-1;;;84857:101:0:o;84593:159::-;62190:6;;-1:-1:-1;;;;;62190:6:0;60637:10;62337:23;62329:68;;;;-1:-1:-1;;;62329:68:0;;;;;;;:::i;:::-;-1:-1:-1;;;;;84713:33:0::1;;::::0;;;:25:::1;:33;::::0;;;;;;-1:-1:-1;;84676:70:0;::::1;84713:33;::::0;;::::1;84712:34;84676:70;::::0;;84593:159::o;85693:142::-;62190:6;;-1:-1:-1;;;;;62190:6:0;60637:10;62337:23;62329:68;;;;-1:-1:-1;;;62329:68:0;;;;;;;:::i;:::-;85793:8:::1;-1:-1:-1::0;;;;;85786:25:0::1;;85812:7;62190:6:::0;;-1:-1:-1;;;;;62190:6:0;62117:87;;85812:7:::1;85786:42;::::0;-1:-1:-1;;;;;;85786:42:0::1;::::0;;;;;;-1:-1:-1;;;;;10018:32:1;;;85786:42:0::1;::::0;::::1;10000:51:1::0;10067:18;;;10060:34;;;9973:18;;85786:42:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;85778:51;;;::::0;::::1;84473:112:::0;62190:6;;-1:-1:-1;;;;;62190:6:0;60637:10;62337:23;62329:68;;;;-1:-1:-1;;;62329:68:0;;;;;;;:::i;:::-;84551:13:::1;:28:::0;;-1:-1:-1;;;;;;84551:28:0::1;-1:-1:-1::0;;;;;84551:28:0;;;::::1;::::0;;;::::1;::::0;;84473:112::o;86517:577::-;62190:6;;-1:-1:-1;;;;;62190:6:0;60637:10;62337:23;62329:68;;;;-1:-1:-1;;;62329:68:0;;;;;;;:::i;:::-;86613:24:::1;86660:6;86613:54;;86705:9;86721::::0;86737:8:::1;86759:9:::0;86775::::1;86791::::0;86807::::1;86827:4;-1:-1:-1::0;;;;;86827:11:0::1;;86839:2;86827:15;;;;;;;;;;;;;15082:25:1::0;;15070:2;15055:18;;15037:76;86827:15:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;86704:138;;;;;;;;;;;;;;;;86849:38;86890:56;;;;;;;;86919:1;86890:56;;;;86921:1;86890:56;;;;86923:1;86890:56;;;;;;86925:1;86890:56;;;;;;86927:1;86890:56;;;;86929:1;86890:56;;;;86931:1;86890:56;;;;86933:1;86890:56;;;;86943:1;-1:-1:-1::0;;;;;86890:56:0::1;;;::::0;86849:97:::1;;86954:8;86966:18;:29;86996:2;86966:33;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;86953:46;;87015:3;87014:4;87006:31;;;::::0;-1:-1:-1;;;87006:31:0;;13253:2:1;87006:31:0::1;::::0;::::1;13235:21:1::0;13292:2;13272:18;;;13265:30;-1:-1:-1;;;13311:18:1;;;13304:44;13365:18;;87006:31:0::1;13225:164:1::0;87006:31:0::1;87044:4;-1:-1:-1::0;;;;;87044:19:0::1;;87064:3;87069:2;87073:7;62190:6:::0;;-1:-1:-1;;;;;62190:6:0;62117:87;;87073:7:::1;87044:44;::::0;::::1;::::0;;;-1:-1:-1;;;;;;87044:44:0;;;-1:-1:-1;;;;;10386:15:1;;;87044:44:0::1;::::0;::::1;10368:34:1::0;10418:18;;;10411:34;;;;10481:15;;;10461:18;;;10454:43;-1:-1:-1;10513:18:1;;;10506:50;10302:19;;87044:44:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;62408:1;;;;;;;;;;86517:577:::0;;;:::o;84264:203::-;55799:13;;;;;;;:48;;55835:12;;;;55834:13;55799:48;;;56602:4;47368:20;47416:8;55815:16;55791:107;;;;-1:-1:-1;;;55791:107:0;;12065:2:1;55791:107:0;;;12047:21:1;12104:2;12084:18;;;12077:30;12143:34;12123:18;;;12116:62;-1:-1:-1;;;12194:18:1;;;12187:44;12248:19;;55791:107:0;12037:236:1;55791:107:0;55911:19;55934:13;;;;;;55933:14;55958:101;;;;55993:13;:20;;-1:-1:-1;;56028:19:0;;;;;55958:101;84346:18:::1;:34:::0;;-1:-1:-1;;;;;;84389:10:0;84375:4:::1;-1:-1:-1::0;;;;84389:10:0;;;;84408:13:::1;:28:::0;;-1:-1:-1;;;;;;84408:28:0::1;-1:-1:-1::0;;;;;84408:28:0;::::1;;::::0;;84445:16:::1;:14;:16::i;:::-;56089:14:::0;56085:68;;;56136:5;56120:21;;-1:-1:-1;;56120:21:0;;;84264:203;;:::o;85348:163::-;85464:41;;-1:-1:-1;;;85464:41:0;;85441:7;;85464:18;;:30;;:41;;85495:9;;85464:41;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;85457:48;;85348:163;;;;:::o;63026:201::-;62190:6;;-1:-1:-1;;;;;62190:6:0;60637:10;62337:23;62329:68;;;;-1:-1:-1;;;62329:68:0;;;;;;;:::i;:::-;-1:-1:-1;;;;;63115:22:0;::::1;63107:73;;;::::0;-1:-1:-1;;;63107:73:0;;10961:2:1;63107:73:0::1;::::0;::::1;10943:21:1::0;11000:2;10980:18;;;10973:30;11039:34;11019:18;;;11012:62;-1:-1:-1;;;11090:18:1;;;11083:36;11136:19;;63107:73:0::1;10933:228:1::0;63107:73:0::1;63191:28;63210:8;63191:18;:28::i;:::-;63026:201:::0;:::o;87353:1299::-;-1:-1:-1;;;;;87633:15:0;;87602:14;87633:15;;;:7;:15;;;;;;;;87625:24;;;;;;88060:14;88099:4;88105:6;88077:39;;;;;:::i;:::-;-1:-1:-1;;;;;9667:32:1;;;9649:51;;9736:2;9731;9716:18;;9709:30;;;-1:-1:-1;9755:18:1;;;9748:32;9812:2;9797:18;88077:39:0;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;88304:13:0;;88180:148;;-1:-1:-1;;;88180:148:0;;-1:-1:-1;;;;;8564:15:1;;;88180:148:0;;;8546:34:1;8616:15;;;8596:18;;;8589:43;88266:4:0;8648:18:1;;;8641:43;8720:15;;;8700:18;;;8693:43;8773:15;;;8752:19;;;8745:44;88304:13:0;;;8805:19:1;;;8798:44;8858:19;;;8851:35;;;88060:56:0;;-1:-1:-1;88060:56:0;;88180:39;;;;;;8480:19:1;;88180:148:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;88358:60:0;;-1:-1:-1;;;88358:60:0;;-1:-1:-1;;;;;88358:45:0;;;-1:-1:-1;88358:45:0;;-1:-1:-1;88358:60:0;;88404:8;;88414:3;;88358:60;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;88425:58:0;;-1:-1:-1;;;88425:58:0;;88472:10;88425:58;;;8131:51:1;-1:-1:-1;;;;;88425:46:0;;;-1:-1:-1;88425:46:0;;-1:-1:-1;8104:18:1;;88425:58:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;88514:4;88490:12;:21;88503:7;-1:-1:-1;;;;;88490:21:0;-1:-1:-1;;;;;88490:21:0;;;;;;;;;;;;;:28;;;;;;;;;;;;;;;;;;88572:17;-1:-1:-1;;;;;88530:95:0;88551:19;-1:-1:-1;;;;;88530:95:0;88542:7;-1:-1:-1;;;;;88530:95:0;;88591:6;88599:10;88611:8;88621:3;88530:95;;;;;;;;;:::i;:::-;;;;;;;;88639:7;87353:1299;-1:-1:-1;;;;;;;;;;;87353:1299:0:o;63387:191::-;63480:6;;;-1:-1:-1;;;;;63497:17:0;;;-1:-1:-1;;;;;;63497:17:0;;;;;;;63530:40;;63480:6;;;63497:17;63480:6;;63530:40;;63461:16;;63530:40;63387:191;;:::o;61781:134::-;56402:13;;;;;;;56394:69;;;;-1:-1:-1;;;56394:69:0;;;;;;;:::i;:::-;61844:26:::1;:24;:26::i;:::-;61881;:24;:26::i;60481:70::-:0;56402:13;;;;;;;56394:69;;;;-1:-1:-1;;;56394:69:0;;;;;;;:::i;61923:113::-;56402:13;;;;;;;56394:69;;;;-1:-1:-1;;;56394:69:0;;;;;;;:::i;:::-;61996:32:::1;60637:10:::0;61996:18:::1;:32::i;-1:-1:-1:-:0;;;;;;;;:::o;14:134:1:-;82:20;;111:31;82:20;111:31;:::i;153:164::-;229:13;;278;;271:21;261:32;;251:2;;307:1;304;297:12;322:166;;429:3;420:6;415:3;411:16;407:26;404:2;;;450:5;443;436:20;404:2;-1:-1:-1;476:6:1;394:94;-1:-1:-1;394:94:1:o;493:257::-;;605:2;593:9;584:7;580:23;576:32;573:2;;;626:6;618;611:22;573:2;670:9;657:23;689:31;714:5;689:31;:::i;755:261::-;;878:2;866:9;857:7;853:23;849:32;846:2;;;899:6;891;884:22;846:2;936:9;930:16;955:31;980:5;955:31;:::i;1021:474::-;;;;1175:2;1163:9;1154:7;1150:23;1146:32;1143:2;;;1196:6;1188;1181:22;1143:2;1240:9;1227:23;1259:31;1284:5;1259:31;:::i;:::-;1309:5;-1:-1:-1;1366:2:1;1351:18;;1338:32;1379:33;1338:32;1379:33;:::i;:::-;1133:362;;1431:7;;-1:-1:-1;;;1485:2:1;1470:18;;;;1457:32;;1133:362::o;1500:333::-;;;1637:2;1625:9;1616:7;1612:23;1608:32;1605:2;;;1658:6;1650;1643:22;1605:2;1702:9;1689:23;1721:31;1746:5;1721:31;:::i;:::-;1771:5;1823:2;1808:18;;;;1795:32;;-1:-1:-1;;;1595:238:1:o;1838:1201::-;;;;;;;;;;2107:9;2098:7;2094:23;2137:3;2133:2;2129:12;2126:2;;;2159:6;2151;2144:22;2126:2;2203:9;2190:23;2222:31;2247:5;2222:31;:::i;:::-;2272:5;-1:-1:-1;2324:2:1;2309:18;;2296:32;;-1:-1:-1;2380:2:1;2365:18;;2352:32;2393:33;2352:32;2393:33;:::i;:::-;2445:7;-1:-1:-1;2504:2:1;2489:18;;2476:32;2517:33;2476:32;2517:33;:::i;:::-;2569:7;-1:-1:-1;2628:3:1;2613:19;;2600:33;2642;2600;2642;:::i;:::-;2694:7;-1:-1:-1;2753:3:1;2738:19;;2725:33;2767;2725;2767;:::i;:::-;2819:7;-1:-1:-1;2873:3:1;2858:19;;2845:33;;-1:-1:-1;2913:2:1;-1:-1:-1;;2894:17:1;;2890:26;2887:2;;;2934:6;2926;2919:22;2887:2;;2977:3;2966:9;2962:19;2952:29;;3028:3;3017:9;3013:19;3000:33;2990:43;;2074:965;;;;;;;;;;;:::o;3374:212::-;;3494:2;3482:9;3473:7;3469:23;3465:32;3462:2;;;3515:6;3507;3500:22;3462:2;3543:37;3570:9;3543:37;:::i;3591:338::-;;;3727:2;3715:9;3706:7;3702:23;3698:32;3695:2;;;3748:6;3740;3733:22;3695:2;3776:37;3803:9;3776:37;:::i;:::-;3766:47;;3856:2;3845:9;3841:18;3835:25;3869:30;3893:5;3869:30;:::i;:::-;3918:5;3908:15;;;3685:244;;;;;:::o;3934:252::-;;4074:3;4062:9;4053:7;4049:23;4045:33;4042:2;;;4096:6;4088;4081:22;4042:2;4124:56;4172:7;4161:9;4124:56;:::i;4191:321::-;;;4348:3;4336:9;4327:7;4323:23;4319:33;4316:2;;;4370:6;4362;4355:22;4316:2;4398:56;4446:7;4435:9;4398:56;:::i;:::-;4388:66;4501:3;4486:19;;;;4473:33;;-1:-1:-1;;;4306:206:1:o;4517:190::-;;4629:2;4617:9;4608:7;4604:23;4600:32;4597:2;;;4650:6;4642;4635:22;4597:2;-1:-1:-1;4678:23:1;;4587:120;-1:-1:-1;4587:120:1:o;4712:194::-;;4835:2;4823:9;4814:7;4810:23;4806:32;4803:2;;;4856:6;4848;4841:22;4803:2;-1:-1:-1;4884:16:1;;4793:113;-1:-1:-1;4793:113:1:o;4911:258::-;;;5040:2;5028:9;5019:7;5015:23;5011:32;5008:2;;;5061:6;5053;5046:22;5008:2;-1:-1:-1;;5089:23:1;;;5159:2;5144:18;;;5131:32;;-1:-1:-1;4998:171:1:o;5174:897::-;;;;;;;;;;5431:3;5419:9;5410:7;5406:23;5402:33;5399:2;;;5453:6;5445;5438:22;5399:2;5487:9;5481:16;5471:26;;5537:2;5526:9;5522:18;5516:25;5506:35;;5584:2;5573:9;5569:18;5563:25;5597:30;5621:5;5597:30;:::i;:::-;5696:2;5681:18;;5675:25;5646:5;;-1:-1:-1;5709:32:1;5675:25;5709:32;:::i;:::-;5760:7;5750:17;;;5807:3;5796:9;5792:19;5786:26;5776:36;;5852:3;5841:9;5837:19;5831:26;5821:36;;5897:3;5886:9;5882:19;5876:26;5866:36;;5942:3;5931:9;5927:19;5921:26;5911:36;;5992:3;5981:9;5977:19;5971:26;6006:33;6031:7;6006:33;:::i;:::-;6058:7;6048:17;;;5389:682;;;;;;;;;;;:::o;6076:255::-;;6187:2;6175:9;6166:7;6162:23;6158:32;6155:2;;;6208:6;6200;6193:22;6155:2;6252:9;6239:23;6271:30;6295:5;6271:30;:::i;6445:856::-;6542:5;6529:19;6524:3;6517:32;6605:4;6598:5;6594:16;6581:30;6574:4;6569:3;6565:14;6558:54;6660:4;6653:5;6649:16;6636:30;6675:32;6699:7;6675:32;:::i;:::-;6752:10;6739:24;6732:4;6723:14;;6716:48;6812:4;6801:16;;6788:30;6827:32;6788:30;6827:32;:::i;:::-;7752:10;7741:22;;6904:4;6895:14;;7729:35;6868:42;6966:4;6959:5;6955:16;6942:30;6935:4;6930:3;6926:14;6919:54;7029:4;7022:5;7018:16;7005:30;6998:4;6993:3;6989:14;6982:54;7092:4;7085:5;7081:16;7068:30;7061:4;7056:3;7052:14;7045:54;7155:4;7148:5;7144:16;7131:30;7124:4;7119:3;7115:14;7108:54;7181:6;7211:34;7241:2;7234:5;7230:14;7211:34;:::i;:::-;-1:-1:-1;;;;;6402:31:1;7282:12;;6390:44;;;;-1:-1:-1;6507:794:1:o;7306:365::-;7407:5;7394:19;7422:32;7446:7;7422:32;:::i;:::-;7473:10;7504:16;;;7492:29;;7569:4;7558:16;;7545:30;;7584:32;7545:30;7584:32;:::i;:::-;7661:2;7652:7;7648:16;7641:4;7636:3;7632:14;7625:40;;;7369:302;;:::o;8897:536::-;-1:-1:-1;;;;;9242:15:1;;;9224:34;;9294:15;;9289:2;9274:18;;9267:43;9341:2;9326:18;;9319:34;;;9173:3;9158:19;;9362:65;9423:2;9408:18;;9400:6;9362:65;:::i;:::-;9140:293;;;;;;;:::o;12278:356::-;12480:2;12462:21;;;12499:18;;;12492:30;12558:34;12553:2;12538:18;;12531:62;12625:2;12610:18;;12452:182::o;12639:407::-;12841:2;12823:21;;;12880:2;12860:18;;;12853:30;12919:34;12914:2;12899:18;;12892:62;-1:-1:-1;;;12985:2:1;12970:18;;12963:41;13036:3;13021:19;;12813:233::o;13394:270::-;13590:3;13575:19;;13603:55;13579:9;13640:6;13603:55;:::i;13669:342::-;13893:3;13878:19;;13906:55;13882:9;13943:6;13906:55;:::i;:::-;13998:6;13992:3;13981:9;13977:19;13970:35;13860:151;;;;;:::o;14016:915::-;;14210:3;14199:9;14195:19;14187:27;;14247:6;14241:13;14230:9;14223:32;14311:4;14303:6;14299:17;14293:24;14286:4;14275:9;14271:20;14264:54;14365:4;14357:6;14353:17;14347:24;14390:10;14456:2;14442:12;14438:21;14431:4;14420:9;14416:20;14409:51;14528:2;14520:4;14512:6;14508:17;14502:24;14498:33;14491:4;14480:9;14476:20;14469:63;;;14588:4;14580:6;14576:17;14570:24;14563:4;14552:9;14548:20;14541:54;14651:4;14643:6;14639:17;14633:24;14626:4;14615:9;14611:20;14604:54;14714:4;14706:6;14702:17;14696:24;14689:4;14678:9;14674:20;14667:54;14777:4;14769:6;14765:17;14759:24;14752:4;14741:9;14737:20;14730:54;14803:6;14858:2;14850:6;14846:15;14840:22;14871:54;14921:2;14910:9;14906:18;14890:14;-1:-1:-1;;;;;6402:31:1;6390:44;;6380:60;15118:337;15350:25;;;15338:2;15323:18;;15384:65;15445:2;15430:18;;15422:6;15384:65;:::i;15657:128::-;;15728:1;15724:6;15721:1;15718:13;15715:2;;;15734:18;;:::i;:::-;-1:-1:-1;15770:9:1;;15705:80::o;15790:217::-;;15856:1;15846:2;;-1:-1:-1;;;15881:31:1;;15935:4;15932:1;15925:15;15963:4;15888:1;15953:15;15846:2;-1:-1:-1;15992:9:1;;15836:171::o;16012:168::-;;16118:1;16114;16110:6;16106:14;16103:1;16100:21;16095:1;16088:9;16081:17;16077:45;16074:2;;;16125:18;;:::i;:::-;-1:-1:-1;16165:9:1;;16064:116::o;16185:125::-;;16253:1;16250;16247:8;16244:2;;;16258:18;;:::i;:::-;-1:-1:-1;16295:9:1;;16234:76::o;16315:127::-;16376:10;16371:3;16367:20;16364:1;16357:31;16407:4;16404:1;16397:15;16431:4;16428:1;16421:15;16447:131;-1:-1:-1;;;;;16522:31:1;;16512:42;;16502:2;;16568:1;16565;16558:12;16583:121;16668:10;16661:5;16657:22;16650:5;16647:33;16637:2;;16694:1;16691;16684:12

Swarm Source

ipfs://8da3bebbc96775199fa1ffe47ef6e27d4360d4630dd7ff7e6994c06a45cb391c

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.