ETH Price: $3,248.93 (+4.76%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Loan Length ...213046312024-12-01 2:19:4760 days ago1733019587IN
0x90482AD3...7bAD5B24D
0 ETH0.0004332712.01548626
Set Loan Amount ...213046292024-12-01 2:19:2360 days ago1733019563IN
0x90482AD3...7bAD5B24D
0 ETH0.0004843413.52664621
Set Loan Length ...208134792024-09-23 13:07:59129 days ago1727096879IN
0x90482AD3...7bAD5B24D
0 ETH0.0007160621.44810695
Set Loan Authori...208102262024-09-23 2:13:35129 days ago1727057615IN
0x90482AD3...7bAD5B24D
0 ETH0.000330686.88348983

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block
From
To
208102202024-09-23 2:12:23129 days ago1727057543  Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
X7InitialLiquidityLoanTerm005

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 800 runs

Other Settings:
istanbul EvmVersion
File 1 of 1 : X7InitialLiquidityLoanTerm005.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity =0.8.15;

/*

 /$$   /$$ /$$$$$$$$       /$$$$$$$$ /$$
| $$  / $$|_____ $$/      | $$_____/|__/
|  $$/ $$/     /$$/       | $$       /$$ /$$$$$$$   /$$$$$$  /$$$$$$$   /$$$$$$$  /$$$$$$
 \  $$$$/     /$$/        | $$$$$   | $$| $$__  $$ |____  $$| $$__  $$ /$$_____/ /$$__  $$
  >$$  $$    /$$/         | $$__/   | $$| $$  \ $$  /$$$$$$$| $$  \ $$| $$      | $$$$$$$$
 /$$/\  $$  /$$/          | $$      | $$| $$  | $$ /$$__  $$| $$  | $$| $$      | $$_____/
| $$  \ $$ /$$/           | $$      | $$| $$  | $$|  $$$$$$$| $$  | $$|  $$$$$$$|  $$$$$$$
|__/  |__/|__/            |__/      |__/|__/  |__/ \_______/|__/  |__/ \_______/ \_______/

Contract: X7 Initial Liquidity Loan Term (005) - "X7ILL005"

Name: Fixed Origination Fee
Loan Origination Fee: 0.01 ether (contract default)
Loan Leverage: 100x leverage
Loan Retention Premium: 0%
Principal Repayment Condition: 100% due by end of loan term
Liquidation Conditions: Failure to pay the principal by the end of the loan will result in liquidation

This contract uses an abstract base contract shared among all our standard Initial Liquidity Loan Terms. Although this contract only allows a small number of configuration changes (namely minimum and maximum loan amounts and durations), variations can be deployed and added to the Active Loan terms of the Lending Pool.

This contract will NOT be renounced.

The following are the only functions that can be called on the contract that affect the contract:

    function setLoanAuthority(address contractAddress, bool isAuthority) external onlyOwner {
        require(loanAuthorities[contractAddress] != isAuthority);
        loanAuthorities[contractAddress] = isAuthority;
    }

    function setBaseURI(string memory baseURI_) external onlyOwner {
        require(keccak256(abi.encodePacked(internalBaseURI)) != keccak256(abi.encodePacked(baseURI_)));
        string memory oldBaseURI = internalBaseURI;
        internalBaseURI = baseURI_;
        emit BaseURISet(oldBaseURI, baseURI_);
    }

    function setUseBaseURIOnly(bool shouldUse) external onlyOwner {
        require(useBaseURIOnly != shouldUse);
        useBaseURIOnly = shouldUse;
        emit UseBaseURIOnlySet(shouldUse);
    }

    function setFixedOriginationFee(bool state) external onlyOwner {
        _setFixedOriginationFee(state);
    }

    function setOriginationFeeNumerator(feeNumerator) external onlyOwner({
        _setOriginationFeeNumerator(feeNumerator);
    }

    function setLoanLengthLimits(uint256 minimumSeconds, uint256 maximumSeconds) external onlyOwner {
        _setLoanLengthLimits(minimumSeconds, maximumSeconds);
    }

    function setLoanAmountLimits(uint256 minimum, uint256 maximum) external onlyOwner {
        _setLoanAmountLimits(minimum, maximum);
    }

These functions will be passed to DAO governance once the ecosystem stabilizes.

*/

interface IX7InitialLiquidityLoanTerm {
    enum LiquidationPolicy {
        NONE,
        LIQUIDATE_INCREMENTAL,
        LIQUIDATE_IN_FULL
    }

    enum LoanState {
        ACTIVE,
        COMPLETE
    }

    event BaseURISet(string oldURI, string newURI);
    event UseBaseURIOnlySet(bool shouldUseBaseURIOnly);
    event LoanLengthLimitsSet(uint256 oldMinSeconds, uint256 oldMaxSeconds, uint256 minSeconds, uint256 maxSeconds);
    event LoanAmountLimitsSet(uint256 oldMinAmount, uint256 oldMaxAmount, uint256 minAmount, uint256 maxAmount);
    event LoanAuthoritySet(address contractAddress, bool isAuthority);
    event LoanOriginated(uint256 indexed loanID);
    event LoanComplete(uint256 indexed loanID);

    function ownerOf(uint256 tokenId) external view returns (address owner);
    function internalBaseURI() external view returns (string memory);
    function useBaseURIOnly() external view returns (bool);
    function loanAuthorities(address) external view returns (bool);
    function principleFractionDenominator() external view returns (uint16);
    function loanPrecision() external view returns (uint256);
    function repaymentPeriodIndices(uint256) external view returns (uint8);
    function premiumPeriodIndices(uint256) external view returns (uint8);
    function originationFeeNumerator() external view returns (uint16);
    function minimumLoanAmount() external view returns (uint256);
    function maximumLoanAmount() external view returns (uint256);
    function minimumLoanLengthSeconds() external view returns (uint256);
    function maximumLoanLengthSeconds() external view returns (uint256);
    function repaymentFractions(uint8 period) external view returns (uint16);
    function premiumFractions(uint8 period) external view returns (uint16);
    function liquidationPolicy() external view returns (LiquidationPolicy);
    function loanAmount(uint256 loanID) external view returns (uint256);
    function premiumAmountPaid(uint256 loanID) external view returns (uint256);
    function principalAmountPaid(uint256 loanID) external view returns (uint256);
    function premiumAmount(uint256 loanID) external view returns (uint256);
    function premiumModifierNumerator(uint256 loanID) external view returns (uint256);
    function originationFeeModifierNumerator(uint256 loanID) external view returns (uint256);
    function originationFeeCollected(uint256 loanID) external view returns (uint256);
    function loanLengthSeconds(uint256 loanID) external view returns (uint256);
    function loanStartTime(uint256 loanID) external view returns (uint256);
    function loanState(uint256 loanID) external view returns (LoanState);
    function numberOfRepaymentPeriods() external view returns (uint256);
    function numberOfPremiumPeriods() external view returns (uint256);
    function getOriginationAmounts(
        uint256 loanAmount_
    ) external view returns (uint256 loanAmountRounded, uint256 originationFee);
    function isComplete(uint256 loanID) external view returns (bool);
    function liquidationAmount(uint256 loanID) external view returns (uint256);
    function getQuote(
        uint256 loanAmount_
    ) external view returns (uint256 loanAmountRounded, uint256 originationFee, uint256 totalPremium);
    function getDiscountedQuote(
        uint256 loanAmount_,
        uint256 premiumFeeModifier,
        uint256 originationFeeModifier
    ) external view returns (uint256 loanAmountRounded, uint256 originationFee, uint256 totalPremium);
    function getPrincipalDue(uint256 loanID, uint256 asOf) external view returns (uint256);
    function getPremiumsDue(uint256 loanID, uint256 asOf) external view returns (uint256);
    function getTotalDue(uint256 loanID, uint256 asOf) external view returns (uint256);
    function getRemainingLiability(uint256 loanID) external view returns (uint256);
    function getPremiumPaymentSchedule(uint256 loanID) external view returns (uint256[] memory, uint256[] memory);
    function getPrincipalPaymentSchedule(uint256 loanID) external view returns (uint256[] memory, uint256[] memory);
    function tokenURI(uint256 tokenId) external view returns (string memory);

    function setLoanAuthority(address contractAddress, bool isAuthority) external;
    function setBaseURI(string memory baseURI_) external;
    function setUseBaseURIOnly(bool shouldUse) external;
    function originateLoan(
        uint256 loanAmount_,
        uint256 originationFee,
        uint256 loanLengthSeconds_,
        uint256 premiumFeeModifierNumerator_,
        uint256 originationFeeModifierNumerator_,
        address receiver,
        uint256 tokenId
    ) external returns (uint256);
    function recordPayment(
        uint256 loanID,
        uint256 amount
    ) external returns (uint256 premiumPaid, uint256 principalPaid, uint256 refundAmount, uint256 remainingLiability);
    function recordPrincipalRepayment(
        uint256 loanID,
        uint256 amount
    ) external returns (uint256 premiumPaid, uint256 principalPaid, uint256 refundAmount, uint256 remainingLiability);
}

abstract contract Ownable {
    address private _owner;

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

    constructor(address owner_) {
        _transferOwnership(owner_);
    }

    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    function owner() public view virtual returns (address) {
        return _owner;
    }

    function _checkOwner() internal view virtual {
        require(owner() == msg.sender, "Ownable: caller is not the owner");
    }

    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

/**
 * @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 `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

/**
 * @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);
}

/**
 * @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`.
     *
     * 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;

    /**
     * @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 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 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 the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @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);
}

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

/**
 * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 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
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

/**
 * @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 Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

/**
 * @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;
    }
}

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: address zero is not a valid owner");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: invalid token ID");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        _requireMinted(tokenId);

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not token owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(address from, address to, uint256 tokenId) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");
        _safeTransfer(from, to, tokenId, data);
    }

    /**
     * @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.
     *
     * `data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);

        _afterTokenTransfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);

        _afterTokenTransfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(address from, address to, uint256 tokenId) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits an {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(address from, address to, uint256 tokenId) internal virtual {}
}

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
        return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _allTokens.length;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override {
        super._beforeTokenTransfer(from, to, tokenId);

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
}

/**
 * @dev Implementation of the {IERC721Receiver} interface.
 *
 * Accepts all token transfers.
 * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
 */
contract ERC721Holder is IERC721Receiver {
    /**
     * @dev See {IERC721Receiver-onERC721Received}.
     *
     * Always returns `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) {
        return this.onERC721Received.selector;
    }
}

abstract contract X7InitialLiquidityLoanTerm is ERC721Enumerable, ERC721Holder, Ownable {
    enum LiquidationPolicy {
        NONE,
        LIQUIDATE_INCREMENTAL,
        LIQUIDATE_IN_FULL
    }

    enum LoanState {
        ACTIVE,
        COMPLETE
    }

    struct LoanQuote {
        uint256 loanAmount;
        uint256 originationFee;
        uint256 totalPremiumFee;
    }

    string public internalBaseURI;
    bool public useBaseURIOnly;
    bool public fixedOriginationFee;

    mapping(address => bool) public loanAuthorities;
    uint16 public principleFractionDenominator = 10000;
    uint256 public loanPrecision = 1 gwei;

    uint8[] public repaymentPeriodIndices;
    uint8[] public premiumPeriodIndices;

    uint16 public originationFeeNumerator;

    // Minimum and Maximum Loan Amounts in WEI
    uint256 public minimumLoanAmount;
    uint256 public maximumLoanAmount;

    uint256 public minimumLoanLengthSeconds;
    uint256 public maximumLoanLengthSeconds;

    // Period (1-60) => fraction of principle that must be paid.
    // values in this mapping MUST equal 10,000
    // For example, if 10% must be paid on the half way through, and then the remainder at the end, the expected values would be:
    //      repaymentFractions[30] = 1000;
    //      repaymentFractions[60] = 9000;
    mapping(uint8 => uint16) public repaymentFractions;

    // Period (1-60) => fraction of principle that must be paid on or before that period.
    mapping(uint8 => uint16) public premiumFractions;

    LiquidationPolicy liquidationPolicy;

    // tokenID => loanAmount
    mapping(uint256 => uint256) public loanAmount;
    mapping(uint256 => uint256) public premiumAmountPaid;
    mapping(uint256 => uint256) public principalAmountPaid;
    mapping(uint256 => uint256) public premiumAmount;
    mapping(uint256 => uint256) public premiumModifierNumerator;
    mapping(uint256 => uint256) public originationFeeModifierNumerator;
    mapping(uint256 => uint256) public originationFeeCollected;
    mapping(uint256 => uint256) public loanLengthSeconds;
    mapping(uint256 => uint256) public loanStartTime;
    mapping(uint256 => LoanState) public loanState;

    event BaseURISet(string oldURI, string newURI);
    event UseBaseURIOnlySet(bool shouldUseBaseURIOnly);
    event LoanLengthLimitsSet(uint256 oldMinSeconds, uint256 oldMaxSeconds, uint256 minSeconds, uint256 maxSeconds);
    event LoanAmountLimitsSet(uint256 oldMinAmount, uint256 oldMaxAmount, uint256 minAmount, uint256 maxAmount);
    event LoanAuthoritySet(address contractAddress, bool isAuthority);

    event LoanOriginated(uint256 indexed loanID);
    event LoanComplete(uint256 indexed loanID);
    event OriginationFeeNumeratorSet(uint16 oldFeeNumerator, uint16 newFeeNumerator);

    modifier onlyLoanAuthority() {
        require(loanAuthorities[msg.sender], "X7: FORBIDDEN");
        _;
    }

    function setLoanAuthority(address contractAddress, bool isAuthority) external onlyOwner {
        require(loanAuthorities[contractAddress] != isAuthority);
        loanAuthorities[contractAddress] = isAuthority;
        emit LoanAuthoritySet(contractAddress, isAuthority);
    }

    function setBaseURI(string memory baseURI_) external onlyOwner {
        require(keccak256(abi.encodePacked(internalBaseURI)) != keccak256(abi.encodePacked(baseURI_)));
        string memory oldBaseURI = internalBaseURI;
        internalBaseURI = baseURI_;
        emit BaseURISet(oldBaseURI, baseURI_);
    }

    function setUseBaseURIOnly(bool shouldUse) external onlyOwner {
        require(useBaseURIOnly != shouldUse);
        useBaseURIOnly = shouldUse;
        emit UseBaseURIOnlySet(shouldUse);
    }

    function numberOfRepaymentPeriods() external view returns (uint256) {
        return repaymentPeriodIndices.length;
    }

    function numberOfPremiumPeriods() external view returns (uint256) {
        return premiumPeriodIndices.length;
    }

    function getOriginationAmounts(
        uint256 loanAmount_
    ) external view returns (uint256 loanAmountRounded, uint256 originationFee) {
        (loanAmountRounded, originationFee) = _getOriginationAmounts(loanAmount_);
    }

    function isComplete(uint256 loanID) external view returns (bool) {
        return loanState[loanID] == LoanState.COMPLETE;
    }

    function liquidationAmount(uint256 loanID) external view returns (uint256) {
        require(loanState[loanID] == LoanState.ACTIVE);
        uint256 premiumsDue = _getPremiumsDue(loanID, block.timestamp);
        uint256 principalDue = _getPrincipalDue(loanID, block.timestamp);

        uint256 totalDue = premiumsDue + principalDue;

        if (totalDue == 0) {
            return 0;
        }

        uint256 remainingInitialCapital = loanAmount[loanID] - principalAmountPaid[loanID];

        if (liquidationPolicy == LiquidationPolicy.LIQUIDATE_INCREMENTAL) {
            if (totalDue >= remainingInitialCapital) {
                return remainingInitialCapital;
            } else {
                return totalDue;
            }
        } else if (liquidationPolicy == LiquidationPolicy.LIQUIDATE_IN_FULL) {
            return remainingInitialCapital;
        } else {
            revert("Invalid repayment policy");
        }
    }

    function getQuote(
        uint256 loanAmount_
    ) external view returns (uint256 loanAmountRounded, uint256 originationFee, uint256 totalPremium) {
        (loanAmountRounded, originationFee) = _getOriginationAmounts(loanAmount_);

        // Provide a non discounted quote
        totalPremium = _getTotalPremium(loanAmount_, principleFractionDenominator);

        return (loanAmountRounded, originationFee, totalPremium);
    }

    function getDiscountedQuote(
        uint256 loanAmount_,
        uint256 premiumFeeModifier,
        uint256 originationFeeModifier
    ) external view returns (uint256 loanAmountRounded, uint256 originationFee, uint256 totalPremium) {
        (loanAmountRounded, originationFee) = _getOriginationAmounts(loanAmount_);

        // Modify origination fee to include a rounded discount
        // check if origination fee is fixed or not
        if (fixedOriginationFee == false) {
            originationFee =
                ((originationFee * originationFeeModifier) / principleFractionDenominator / loanPrecision) *
                loanPrecision;
        } else {
            originationFee =
                (((1 ether / principleFractionDenominator) * originationFeeNumerator) / loanPrecision) *
                loanPrecision;
        }

        // Provide a discounted quote
        totalPremium = _getTotalPremium(loanAmount_, premiumFeeModifier);

        return (loanAmountRounded, originationFee, totalPremium);
    }

    function getPrincipalDue(uint256 loanID, uint256 asOf) external view returns (uint256) {
        require(loanAmount[loanID] > 0);
        return _getPrincipalDue(loanID, asOf);
    }

    function getPremiumsDue(uint256 loanID, uint256 asOf) external view returns (uint256) {
        require(loanAmount[loanID] > 0);
        return _getPremiumsDue(loanID, asOf);
    }

    function getTotalDue(uint256 loanID, uint256 asOf) external view returns (uint256) {
        require(loanAmount[loanID] > 0);
        return _getPrincipalDue(loanID, asOf) + _getPremiumsDue(loanID, asOf);
    }

    function getRemainingLiability(uint256 loanID) external view returns (uint256) {
        require(loanAmount[loanID] > 0);

        return premiumAmount[loanID] - premiumAmountPaid[loanID] + loanAmount[loanID] - principalAmountPaid[loanID];
    }

    function getPremiumPaymentSchedule(uint256 loanID) external view returns (uint256[] memory, uint256[] memory) {
        uint256 startTime = loanStartTime[loanID];
        uint256 durationSeconds = loanLengthSeconds[loanID];
        uint256 loanAmount_ = loanAmount[loanID];

        require(loanAmount_ > 0);

        uint256[] memory dueDates = new uint256[](premiumPeriodIndices.length);
        uint256[] memory paymentAmounts = new uint256[](premiumPeriodIndices.length);

        for (uint i = 0; i < premiumPeriodIndices.length; i++) {
            dueDates[i] = ((durationSeconds * premiumPeriodIndices[i]) / 60) + startTime;
            paymentAmounts[i] =
                (((loanAmount_ * premiumFractions[premiumPeriodIndices[i]]) / principleFractionDenominator) /
                    loanPrecision) *
                loanPrecision;
        }

        return (dueDates, paymentAmounts);
    }

    function getPrincipalPaymentSchedule(uint256 loanID) external view returns (uint256[] memory, uint256[] memory) {
        uint256 startTime = loanStartTime[loanID];
        uint256 durationSeconds = loanLengthSeconds[loanID];
        uint256 loanAmount_ = loanAmount[loanID];

        require(loanAmount_ > 0);

        uint256[] memory dueDates = new uint256[](repaymentPeriodIndices.length);
        uint256[] memory paymentAmounts = new uint256[](repaymentPeriodIndices.length);

        for (uint i = 0; i < repaymentPeriodIndices.length; i++) {
            dueDates[i] = ((durationSeconds * repaymentPeriodIndices[i]) / 60) + startTime;
            paymentAmounts[i] =
                (((loanAmount_ * repaymentFractions[repaymentPeriodIndices[i]]) / principleFractionDenominator) /
                    loanPrecision) *
                loanPrecision;
        }

        return (dueDates, paymentAmounts);
    }

    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        if (useBaseURIOnly) {
            return _baseURI();
        } else {
            return super.tokenURI(tokenId);
        }
    }

    function originateLoan(
        uint256 loanAmount_,
        uint256 originationFee,
        uint256 loanLengthSeconds_,
        // 10000 == no discount 9000 == 10% discount
        uint256 premiumFeeModifierNumerator_,
        uint256 originationFeeModifierNumerator_,
        address receiver,
        uint256 tokenId
    ) external onlyLoanAuthority returns (uint256) {
        (uint256 expectedLoanAmount, uint256 expectedOriginationFee) = _getOriginationAmounts(loanAmount_);
        uint256 discountedOriginationFee = ((expectedOriginationFee * originationFeeModifierNumerator_) /
            principleFractionDenominator /
            loanPrecision) * loanPrecision;

        // Check the loan conforms to the loan terms of this contract
        require(expectedLoanAmount == loanAmount_, "Loan amounts must be rounded");
        require(loanAmount_ >= minimumLoanAmount && loanAmount_ <= maximumLoanAmount, "Invalid loan Amount");
        require(
            loanLengthSeconds_ >= minimumLoanLengthSeconds && loanLengthSeconds_ <= maximumLoanLengthSeconds,
            "Invalid loan length"
        );
        require(originationFee == discountedOriginationFee, "Insufficient origination fee collected");

        loanAmount[tokenId] = loanAmount_;
        originationFeeCollected[tokenId] = originationFee;
        premiumModifierNumerator[tokenId] = premiumFeeModifierNumerator_;
        originationFeeModifierNumerator[tokenId] = originationFeeModifierNumerator_;
        premiumAmount[tokenId] = _getTotalPremium(loanAmount_, premiumFeeModifierNumerator_);

        loanLengthSeconds[tokenId] = loanLengthSeconds_;
        loanState[tokenId] = LoanState.ACTIVE;

        loanStartTime[tokenId] = block.timestamp;

        _mint(receiver, tokenId);

        emit LoanOriginated(tokenId);

        return tokenId;
    }

    /*
        Payments are applied in the following manner:

            1. Premium Due (based on time)
            2. Principal Due (based on time)
            3. Premium Due (total)
            4. Principal Due (total)
    */
    function recordPayment(
        uint256 loanID,
        uint256 amount
    )
        external
        onlyLoanAuthority
        returns (uint256 premiumPaid, uint256 principalPaid, uint256 refundAmount, uint256 remainingLiability)
    {
        if (loanState[loanID] == LoanState.COMPLETE) {
            refundAmount = amount;
            return (premiumPaid, principalPaid, refundAmount, remainingLiability);
        }

        uint256 premiumDue = _getPremiumsDue(loanID, block.timestamp);
        uint256 principalDue = _getPrincipalDue(loanID, block.timestamp);

        uint256 remaining = amount;

        if (premiumDue > 0) {
            if (remaining >= premiumDue) {
                remaining -= premiumDue;
                premiumPaid = premiumDue;
            } else {
                premiumPaid = amount;
                remaining = 0;
            }
        }

        if (principalDue > 0 && remaining > 0) {
            if (remaining >= principalDue) {
                principalPaid = principalDue;
                remaining -= principalDue;
            } else {
                principalPaid = remaining;
                remaining = 0;
            }
        }

        uint256 excessAmount = _recordPremiumPayment(loanID, premiumPaid + remaining);
        premiumPaid = premiumPaid + remaining - excessAmount;

        refundAmount = _recordPrincipalPayment(loanID, principalPaid + excessAmount);
        principalPaid = principalPaid + excessAmount - refundAmount;

        remainingLiability =
            premiumAmount[loanID] -
            premiumAmountPaid[loanID] +
            loanAmount[loanID] -
            principalAmountPaid[loanID];

        if (remainingLiability == 0) {
            loanState[loanID] = LoanState.COMPLETE;
            emit LoanComplete(loanID);
        }
    }

    function recordPrincipalRepayment(
        uint256 loanID,
        uint256 amount
    )
        external
        onlyLoanAuthority
        returns (uint256 premiumPaid, uint256 principalPaid, uint256 refundAmount, uint256 remainingLiability)
    {
        uint256 excessAmount = _recordPrincipalPayment(loanID, amount);

        if (excessAmount > 0) {
            refundAmount = _recordPremiumPayment(loanID, excessAmount);
        }
        principalPaid = amount - excessAmount;
        premiumPaid = excessAmount - refundAmount;

        remainingLiability =
            premiumAmount[loanID] -
            premiumAmountPaid[loanID] +
            loanAmount[loanID] -
            principalAmountPaid[loanID];

        if (remainingLiability == 0) {
            loanState[loanID] = LoanState.COMPLETE;
            emit LoanComplete(loanID);
        }
    }

    function _getOriginationAmounts(
        uint256 loanAmount_
    ) internal view returns (uint256 loanAmountRounded, uint256 originationFee) {
        for (uint i = 0; i < repaymentPeriodIndices.length; i++) {
            loanAmountRounded +=
                (((loanAmount_ * repaymentFractions[repaymentPeriodIndices[i]]) / principleFractionDenominator) /
                    loanPrecision) *
                loanPrecision;
        }

        require(loanAmountRounded > 0);
        // check if origination fee is fixed or not
        if (fixedOriginationFee == false) {
            originationFee =
                (((loanAmountRounded * originationFeeNumerator) / principleFractionDenominator) / loanPrecision) *
                loanPrecision;
        } else {
            originationFee =
                (((1 ether / principleFractionDenominator) * originationFeeNumerator) / loanPrecision) *
                loanPrecision;
        }
    }

    function _getTotalPremium(uint256 loanAmount_, uint256 discountModifier) internal view returns (uint256) {
        uint256 totalPremium;

        for (uint i = 0; i < premiumPeriodIndices.length; i++) {
            totalPremium +=
                ((((loanAmount_ * premiumFractions[premiumPeriodIndices[i]]) / principleFractionDenominator) *
                    discountModifier) /
                    principleFractionDenominator /
                    loanPrecision) *
                loanPrecision;
        }

        return totalPremium;
    }

    function _getPrincipalDue(uint256 loanID, uint256 asOf) internal view returns (uint256) {
        uint256 startTime = loanStartTime[loanID];
        uint256 durationSeconds = loanLengthSeconds[loanID];
        uint256 loanAmount_ = loanAmount[loanID];

        uint256 totalRepaymentDue;

        for (uint i = 0; i < repaymentPeriodIndices.length; i++) {
            if (((durationSeconds * repaymentPeriodIndices[i]) / 60) + startTime > asOf) {
                break;
            }

            totalRepaymentDue +=
                (((loanAmount_ * repaymentFractions[repaymentPeriodIndices[i]]) / principleFractionDenominator) /
                    loanPrecision) *
                loanPrecision;
        }

        if (principalAmountPaid[loanID] >= totalRepaymentDue) {
            return 0;
        } else {
            return totalRepaymentDue - principalAmountPaid[loanID];
        }
    }

    function _getPremiumsDue(uint256 loanID, uint256 asOf) internal view returns (uint256) {
        uint256 startTime = loanStartTime[loanID];
        uint256 durationSeconds = loanLengthSeconds[loanID];
        uint256 loanAmount_ = loanAmount[loanID];

        uint256 totalPremiumsDue;

        for (uint i = 0; i < premiumPeriodIndices.length; i++) {
            if (((durationSeconds * premiumPeriodIndices[i]) / 60) + startTime > asOf) {
                break;
            }

            totalPremiumsDue +=
                ((((loanAmount_ * premiumFractions[premiumPeriodIndices[i]]) / principleFractionDenominator) *
                    premiumModifierNumerator[loanID]) /
                    principleFractionDenominator /
                    loanPrecision) *
                loanPrecision;
        }

        if (premiumAmountPaid[loanID] >= totalPremiumsDue) {
            return 0;
        } else {
            return totalPremiumsDue - premiumAmountPaid[loanID];
        }
    }

    function _recordPremiumPayment(uint256 loanID, uint256 amount) internal returns (uint256 refundAmount) {
        if (amount == 0) {
            return 0;
        }
        uint256 owedAmount = premiumAmount[loanID] - premiumAmountPaid[loanID];

        if (owedAmount > 0) {
            if (owedAmount <= amount) {
                premiumAmountPaid[loanID] += owedAmount;
                refundAmount = amount - owedAmount;
            } else {
                premiumAmountPaid[loanID] += amount;
            }
        } else {
            refundAmount = amount;
        }
    }

    function _recordPrincipalPayment(uint256 loanID, uint256 amount) internal returns (uint256 refundAmount) {
        if (amount == 0) {
            return 0;
        }

        uint256 owedAmount = loanAmount[loanID] - principalAmountPaid[loanID];

        if (owedAmount > 0) {
            if (owedAmount <= amount) {
                principalAmountPaid[loanID] += owedAmount;
                refundAmount = amount - owedAmount;
            } else {
                principalAmountPaid[loanID] += amount;
            }
        } else {
            refundAmount = amount;
        }
    }

    function _setRepaymentTerms(uint16[60] memory fractions) internal {
        uint256 totalFraction;
        uint8 period;
        uint16 fraction;

        for (uint8 i = 0; i < fractions.length; i++) {
            if (fractions[i] == 0) {
                continue;
            }

            period = i + 1;
            fraction = fractions[i];
            require(period > 0 && period <= 60);

            totalFraction += fraction;
            repaymentFractions[period] = fraction;
            repaymentPeriodIndices.push(period);
        }

        require(totalFraction == principleFractionDenominator);
    }

    function _setPremiumTerms(uint16[60] memory fractions) internal {
        uint256 totalFraction;
        uint8 period;
        uint16 fraction;

        for (uint8 i = 0; i < fractions.length; i++) {
            if (fractions[i] == 0) {
                continue;
            }
            period = i + 1;
            fraction = fractions[i];
            require(period > 0 && period <= 60);

            totalFraction += fraction;
            premiumFractions[period] = fraction;
            premiumPeriodIndices.push(period);
        }
    }

    function _setOriginationFeeNumerator(uint16 feeNumerator) internal {
        require(feeNumerator < principleFractionDenominator);
        uint16 oldFeeNumerator = originationFeeNumerator;
        originationFeeNumerator = feeNumerator;

        emit OriginationFeeNumeratorSet(oldFeeNumerator, originationFeeNumerator);
    }

    function _setLoanAmountLimits(uint256 minimumAmount, uint256 maximumAmount) internal {
        require(minimumAmount < maximumAmount);
        require(minimumAmount != minimumLoanAmount || maximumAmount != maximumLoanAmount);
        uint256 oldMinimumAmount = minimumLoanAmount;
        uint256 oldMaxiimumAmount = maximumLoanAmount;
        minimumLoanAmount = (minimumAmount / loanPrecision) * loanPrecision;
        maximumLoanAmount = (maximumAmount / loanPrecision) * loanPrecision;

        emit LoanAmountLimitsSet(oldMinimumAmount, oldMaxiimumAmount, minimumAmount, maximumAmount);
    }

    function _setLiquidationPolicy(LiquidationPolicy liquidationPolicy_) internal {
        require(liquidationPolicy_ != LiquidationPolicy.NONE);
        liquidationPolicy = liquidationPolicy_;
    }

    function _setLoanLengthLimits(uint256 minimumSeconds, uint256 maximumSeconds) internal {
        require(minimumSeconds <= maximumSeconds);
        require(minimumSeconds != minimumLoanLengthSeconds || maximumSeconds != maximumLoanLengthSeconds);
        uint256 oldMinimumSeconds = minimumLoanLengthSeconds;
        uint256 oldMaximumSeconds = maximumLoanLengthSeconds;
        minimumLoanLengthSeconds = minimumSeconds;
        maximumLoanLengthSeconds = maximumSeconds;

        emit LoanLengthLimitsSet(oldMinimumSeconds, oldMaximumSeconds, minimumSeconds, maximumSeconds);
    }

    function _setFixedOriginationFee(bool state) internal {
        fixedOriginationFee = state;
    }

    function _baseURI() internal view override returns (string memory) {
        return internalBaseURI;
    }
}

contract X7InitialLiquidityLoanTerm005 is X7InitialLiquidityLoanTerm {
    constructor(address _owner) Ownable(_owner) ERC721("X7 Initial Liquidity Loan Term (005)", "X7ILL005") {
        _setLiquidationPolicy(LiquidationPolicy.LIQUIDATE_IN_FULL);

        // This can be changed post deploy
        _setLoanAmountLimits(
            // 0.5 ETH, 5 ETH
            (1 ether * 5) / 10,
            5 ether
        );

        // This can be changed post deploy
        _setLoanLengthLimits(
            // 1 day
            24 * 60 * 60,
            // 7 days
            28 * 24 * 60 * 60
        );

        _setOriginationFeeNumerator(
            // 1% loan origination fee
            100
        );

        _setFixedOriginationFee(true);

        // No premium terms
        // _setPremiumTerms();

        // 100% of principal due by end of loan term
        uint16[60] memory repaymentPeriodFraction;
        repaymentPeriodFraction[59] = 10000;

        _setRepaymentTerms(repaymentPeriodFraction);
    }

    function setFixedOriginationFee(bool state) external onlyOwner {
        _setFixedOriginationFee(state);
    }

    function setOriginationFeeNumerator(uint16 feeNumerator) external onlyOwner {
        _setOriginationFeeNumerator(feeNumerator);
    }

    function setLoanLengthLimits(uint256 minimumSeconds, uint256 maximumSeconds) external onlyOwner {
        _setLoanLengthLimits(minimumSeconds, maximumSeconds);
    }

    function setLoanAmountLimits(uint256 minimum, uint256 maximum) external onlyOwner {
        _setLoanAmountLimits(minimum, maximum);
    }
}

Settings
{
  "evmVersion": "istanbul",
  "optimizer": {
    "enabled": true,
    "runs": 800
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"oldURI","type":"string"},{"indexed":false,"internalType":"string","name":"newURI","type":"string"}],"name":"BaseURISet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldMinAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"oldMaxAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"minAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxAmount","type":"uint256"}],"name":"LoanAmountLimitsSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"contractAddress","type":"address"},{"indexed":false,"internalType":"bool","name":"isAuthority","type":"bool"}],"name":"LoanAuthoritySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"loanID","type":"uint256"}],"name":"LoanComplete","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldMinSeconds","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"oldMaxSeconds","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"minSeconds","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxSeconds","type":"uint256"}],"name":"LoanLengthLimitsSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"loanID","type":"uint256"}],"name":"LoanOriginated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"oldFeeNumerator","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"newFeeNumerator","type":"uint16"}],"name":"OriginationFeeNumeratorSet","type":"event"},{"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":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"shouldUseBaseURIOnly","type":"bool"}],"name":"UseBaseURIOnlySet","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fixedOriginationFee","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"loanAmount_","type":"uint256"},{"internalType":"uint256","name":"premiumFeeModifier","type":"uint256"},{"internalType":"uint256","name":"originationFeeModifier","type":"uint256"}],"name":"getDiscountedQuote","outputs":[{"internalType":"uint256","name":"loanAmountRounded","type":"uint256"},{"internalType":"uint256","name":"originationFee","type":"uint256"},{"internalType":"uint256","name":"totalPremium","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"loanAmount_","type":"uint256"}],"name":"getOriginationAmounts","outputs":[{"internalType":"uint256","name":"loanAmountRounded","type":"uint256"},{"internalType":"uint256","name":"originationFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"loanID","type":"uint256"}],"name":"getPremiumPaymentSchedule","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"loanID","type":"uint256"},{"internalType":"uint256","name":"asOf","type":"uint256"}],"name":"getPremiumsDue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"loanID","type":"uint256"},{"internalType":"uint256","name":"asOf","type":"uint256"}],"name":"getPrincipalDue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"loanID","type":"uint256"}],"name":"getPrincipalPaymentSchedule","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"loanAmount_","type":"uint256"}],"name":"getQuote","outputs":[{"internalType":"uint256","name":"loanAmountRounded","type":"uint256"},{"internalType":"uint256","name":"originationFee","type":"uint256"},{"internalType":"uint256","name":"totalPremium","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"loanID","type":"uint256"}],"name":"getRemainingLiability","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"loanID","type":"uint256"},{"internalType":"uint256","name":"asOf","type":"uint256"}],"name":"getTotalDue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"internalBaseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"loanID","type":"uint256"}],"name":"isComplete","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"loanID","type":"uint256"}],"name":"liquidationAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"loanAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"loanAuthorities","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"loanLengthSeconds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"loanPrecision","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"loanStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"loanState","outputs":[{"internalType":"enum X7InitialLiquidityLoanTerm.LoanState","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maximumLoanAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maximumLoanLengthSeconds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumLoanAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumLoanLengthSeconds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numberOfPremiumPeriods","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numberOfRepaymentPeriods","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"loanAmount_","type":"uint256"},{"internalType":"uint256","name":"originationFee","type":"uint256"},{"internalType":"uint256","name":"loanLengthSeconds_","type":"uint256"},{"internalType":"uint256","name":"premiumFeeModifierNumerator_","type":"uint256"},{"internalType":"uint256","name":"originationFeeModifierNumerator_","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"originateLoan","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"originationFeeCollected","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"originationFeeModifierNumerator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"originationFeeNumerator","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"premiumAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"premiumAmountPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"premiumFractions","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"premiumModifierNumerator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"premiumPeriodIndices","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"principalAmountPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"principleFractionDenominator","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"loanID","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"recordPayment","outputs":[{"internalType":"uint256","name":"premiumPaid","type":"uint256"},{"internalType":"uint256","name":"principalPaid","type":"uint256"},{"internalType":"uint256","name":"refundAmount","type":"uint256"},{"internalType":"uint256","name":"remainingLiability","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"loanID","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"recordPrincipalRepayment","outputs":[{"internalType":"uint256","name":"premiumPaid","type":"uint256"},{"internalType":"uint256","name":"principalPaid","type":"uint256"},{"internalType":"uint256","name":"refundAmount","type":"uint256"},{"internalType":"uint256","name":"remainingLiability","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"repaymentFractions","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"repaymentPeriodIndices","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"state","type":"bool"}],"name":"setFixedOriginationFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minimum","type":"uint256"},{"internalType":"uint256","name":"maximum","type":"uint256"}],"name":"setLoanAmountLimits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"bool","name":"isAuthority","type":"bool"}],"name":"setLoanAuthority","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minimumSeconds","type":"uint256"},{"internalType":"uint256","name":"maximumSeconds","type":"uint256"}],"name":"setLoanLengthLimits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"feeNumerator","type":"uint16"}],"name":"setOriginationFeeNumerator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"shouldUse","type":"bool"}],"name":"setUseBaseURIOnly","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"useBaseURIOnly","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

6080604052600e805461ffff1916612710179055633b9aca00600f553480156200002857600080fd5b506040516200459f3803806200459f8339810160408190526200004b91620004d6565b806040518060600160405280602481526020016200457b602491396040805180820190915260088152675837494c4c30303560c01b60208201526000620000938382620005ad565b506001620000a28282620005ad565b505050620000b6816200013260201b60201c565b50620000c3600262000184565b620000df6706f05b59d3b20000674563918244f40000620001d0565b620000f1620151806224ea006200028c565b620000fd606462000310565b600c805461ff00191661010017905562000116620004b7565b6127106107608201526200012a816200037e565b505062000765565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008160028111156200019b576200019b6200068f565b03620001a657600080fd5b6019805482919060ff19166001836002811115620001c857620001c86200068f565b021790555050565b808210620001dd57600080fd5b60135482141580620001f157506014548114155b620001fb57600080fd5b601354601454600f54620002108186620006bb565b6200021c9190620006de565b601355600f546200022e8185620006bb565b6200023a9190620006de565b6014556040805183815260208101839052908101859052606081018490527f19ca7434d30d4232591d62b3a60e5ff2b5bfd61d05c36845e9339e6db4658345906080015b60405180910390a150505050565b808211156200029a57600080fd5b60155482141580620002ae57506016548114155b620002b857600080fd5b6015805460168054928590558390556040805182815260208101849052908101859052606081018490529091907ff72779de7d913c6133f8c9bdf6e47e70d7fd993f6c671d33b522e37f91b299f0906080016200027e565b600e5461ffff908116908216106200032757600080fd5b6012805461ffff83811661ffff1983168117909355604080519190921680825260208201939093527fea8a9b607534d99a5509fb74baa48b4a9cbc7d4d284604319069d6341c6ec93a910160405180910390a15050565b60008080805b603c8160ff1610156200049d57848160ff16603c8110620003a957620003a962000679565b602002015161ffff16156200048857620003c581600162000700565b9250848160ff16603c8110620003df57620003df62000679565b6020020151915060008360ff16118015620003fe5750603c8360ff1611155b6200040857600080fd5b6200041861ffff83168562000728565b60ff80851660008181526017602090815260408220805461ffff891661ffff1990911617905560108054600181018255925281047f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae672018054601f9092166101000a92830292909302191617905593505b80620004948162000743565b91505062000384565b50600e5461ffff168314620004b157600080fd5b50505050565b604051806107800160405280603c906020820280368337509192915050565b600060208284031215620004e957600080fd5b81516001600160a01b03811681146200050157600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200053357607f821691505b6020821081036200055457634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620005a857600081815260208120601f850160051c81016020861015620005835750805b601f850160051c820191505b81811015620005a4578281556001016200058f565b5050505b505050565b81516001600160401b03811115620005c957620005c962000508565b620005e181620005da84546200051e565b846200055a565b602080601f831160018114620006195760008415620006005750858301515b600019600386901b1c1916600185901b178555620005a4565b600085815260208120601f198616915b828110156200064a5788860151825594840194600190910190840162000629565b5085821015620006695787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082620006d957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615620006fb57620006fb620006a5565b500290565b600060ff821660ff84168060ff03821115620007205762000720620006a5565b019392505050565b600082198211156200073e576200073e620006a5565b500190565b600060ff821660ff81036200075c576200075c620006a5565b60010192915050565b613e0680620007756000396000f3fe608060405234801561001057600080fd5b506004361061043c5760003560e01c80635b272de011610235578063b01660ae11610135578063cd59e39d116100c8578063dee04bb911610097578063f2278f921161007c578063f2278f9214610a3a578063f2fde38b14610a5a578063fb38f71b14610a6d57600080fd5b8063dee04bb9146109eb578063e985e9c5146109fe57600080fd5b8063cd59e39d1461099f578063cf39918e146109b2578063d920cd66146109c5578063d9fc2f63146109d857600080fd5b8063b88d4fde11610104578063b88d4fde14610945578063bd2e0f2f14610958578063c35d8afa14610979578063c87b56dd1461098c57600080fd5b8063b01660ae146108ce578063b12e3683146108f6578063b185782214610904578063b63396a91461093257600080fd5b806378cb2570116101c85780638da5cb5b11610197578063949677d31161017c578063949677d3146108aa57806395d89b41146108b3578063a22cb465146108bb57600080fd5b80638da5cb5b1461087957806391d970c11461088a57600080fd5b806378cb25701461084d5780637bd2b6cf146108555780638a3df4cb1461085e5780638ac4e26c1461087157600080fd5b806370a082311161020457806370a0823114610800578063715018a61461081357806375dd473d1461081b57806376cd093b1461082957600080fd5b80635b272de0146107b2578063608bc657146107c55780636280279c146107e55780636352211e146107ed57600080fd5b80631a3118731161034057806341c73801116102d35780634a26a71b116102a25780634f6ccce7116102875780634f6ccce71461076c57806355f804b31461077f578063584109ad1461079257600080fd5b80634a26a71b146107395780634c83c2061461075957600080fd5b806341c73801146106d057806342842e0e146106e357806343d93523146106f657806349b274ed1461070957600080fd5b80632f745c591161030f5780632f745c591461067757806332e202721461068a5780633a0be1a61461069d57806340488883146106b057600080fd5b80631a311873146105eb57806323b872dd1461060e57806327023b7514610621578063273a47131461065857600080fd5b80630a6efc19116103d357806313108e0b116103a257806318160ddd1161038757806318160ddd146105ab57806318d99c72146105b35780631977ace4146105c657600080fd5b806313108e0b14610576578063150b7a021461057f57600080fd5b80630a6efc19146105075780630b879bc2146105275780630dcfd8781461055a5780630f9d0ab61461056357600080fd5b8063081812fc1161040f578063081812fc146104a5578063095ea7b3146104d057806309bc289b146104e357806309e71201146104f057600080fd5b806301ffc9a71461044157806303d7cbcd14610469578063055bd22c1461047b57806306fdde0314610490575b600080fd5b61045461044f366004613561565b610a8d565b60405190151581526020015b60405180910390f35b600c5461045490610100900460ff1681565b61048e61048936600461358e565b610ab8565b005b610498610b1e565b6040516104609190613601565b6104b86104b3366004613614565b610bb0565b6040516001600160a01b039091168152602001610460565b61048e6104de366004613644565b610bd7565b600c546104549060ff1681565b6104f960155481565b604051908152602001610460565b6104f9610515366004613614565b601a6020526000908152604090205481565b61053a61053536600461366e565b610cf1565b604080519485526020850193909352918301526060820152608001610460565b6104f960145481565b61048e610571366004613690565b610ef4565b6104f960135481565b61059261058d366004613740565b610f08565b6040516001600160e01b03199091168152602001610460565b6008546104f9565b6104f96105c1366004613614565b610f19565b6105d96105d4366004613614565b610f7c565b60405160ff9091168152602001610460565b6104546105f93660046137bc565b600d6020526000908152604090205460ff1681565b61048e61061c3660046137d7565b610fb0565b61064561062f366004613813565b60176020526000908152604090205461ffff1681565b60405161ffff9091168152602001610460565b6104f9610666366004613614565b602080526000908152604090205481565b6104f9610685366004613644565b611028565b61048e610698366004613836565b6110d0565b6104546106ab366004613614565b611169565b6104f96106be366004613614565b601b6020526000908152604090205481565b6104f96106de366004613614565b611197565b61048e6106f13660046137d7565b6112d0565b6104f961070436600461366e565b6112eb565b61072c610717366004613614565b60236020526000908152604090205460ff1681565b604051610460919061387f565b6104f9610747366004613614565b60226020526000908152604090205481565b61048e61076736600461366e565b611328565b6104f961077a366004613614565b61133e565b61048e61078d3660046138a7565b6113e2565b6104f96107a0366004613614565b601f6020526000908152604090205481565b61048e6107c036600461366e565b611513565b6104f96107d3366004613614565b601e6020526000908152604090205481565b6011546104f9565b6104b86107fb366004613614565b611525565b6104f961080e3660046137bc565b61158a565b61048e611624565b600e546106459061ffff1681565b610645610837366004613813565b60186020526000908152604090205461ffff1681565b610498611638565b6104f960165481565b6104f961086c36600461366e565b6116c6565b6010546104f9565b600a546001600160a01b03166104b8565b6104f9610898366004613614565b60216020526000908152604090205481565b6104f9600f5481565b6104986116e8565b61048e6108c9366004613836565b6116f7565b6108e16108dc366004613614565b611702565b60408051928352602083019190915201610460565b6012546106459061ffff1681565b6109176109123660046138f0565b611718565b60408051938452602084019290925290820152606001610460565b61053a61094036600461366e565b6117df565b61048e610953366004613740565b61190f565b61096b610966366004613614565b61198e565b604051610460929190613957565b6105d9610987366004613614565b611b8f565b61049861099a366004613614565b611b9f565b6104f96109ad366004613985565b611bc3565b6109176109c0366004613614565b611e96565b6104f96109d336600461366e565b611ec3565b61096b6109e6366004613614565b611ee5565b61048e6109f936600461358e565b6120d8565b610454610a0c3660046139e1565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6104f9610a48366004613614565b601d6020526000908152604090205481565b61048e610a683660046137bc565b6120f6565b6104f9610a7b366004613614565b601c6020526000908152604090205481565b60006001600160e01b0319821663780e9d6360e01b1480610ab25750610ab282612183565b92915050565b610ac06121d3565b600c5481151560ff909116151503610ad757600080fd5b600c805460ff19168215159081179091556040519081527f4c633e4e836ceb7b06d20d58cfe507ffc55e4c2f6d9b572be63e75208c7cae719060200160405180910390a150565b606060008054610b2d90613a0b565b80601f0160208091040260200160405190810160405280929190818152602001828054610b5990613a0b565b8015610ba65780601f10610b7b57610100808354040283529160200191610ba6565b820191906000526020600020905b815481529060010190602001808311610b8957829003601f168201915b5050505050905090565b6000610bbb8261223c565b506000908152600460205260409020546001600160a01b031690565b6000610be282611525565b9050806001600160a01b0316836001600160a01b031603610c545760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610c705750610c708133610a0c565b610ce25760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610c4b565b610cec83836122a0565b505050565b336000908152600d602052604081205481908190819060ff16610d465760405162461bcd60e51b815260206004820152600d60248201526c2c1b9d102327a92124a22222a760991b6044820152606401610c4b565b600160008781526023602052604090205460ff166001811115610d6b57610d6b613869565b03610d7857849150610eeb565b6000610d84874261230e565b90506000610d92884261249f565b9050868215610dbd57828110610db657610dac8382613a5b565b9050829650610dbd565b5086955060005b600082118015610dcd5750600081115b15610df457818110610def578195508181610de89190613a5b565b9050610df4565b945060005b6000610e098a610e04848b613a72565b612604565b905080610e16838a613a72565b610e209190613a5b565b9750610e358a610e30838a613a72565b6126b2565b955085610e428289613a72565b610e4c9190613a5b565b60008b8152601c6020908152604080832054601a835281842054601b845282852054601d9094529190932054939a509192610e879190613a5b565b610e919190613a72565b610e9b9190613a5b565b945084600003610ee65760008a815260236020526040808220805460ff19166001179055518b917f8fd2f6536279e29da11ed87593eebd3397e0ad2825b24845f64fcf3fec34139b91a25b505050505b92959194509250565b610efc6121d3565b610f0581612733565b50565b630a85bd0160e11b5b949350505050565b6000818152601a6020526040812054610f3157600080fd5b6000828152601c6020908152604080832054601a835281842054601b845282852054601d90945291909320549091610f6891613a5b565b610f729190613a72565b610ab29190613a5b565b60108181548110610f8c57600080fd5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b610fba3382612799565b61101d5760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526d1c881b9bdc88185c1c1c9bdd995960921b6064820152608401610c4b565b610cec838383612817565b60006110338361158a565b82106110a75760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e64730000000000000000000000000000000000000000006064820152608401610c4b565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6110d86121d3565b6001600160a01b0382166000908152600d602052604090205481151560ff90911615150361110557600080fd5b6001600160a01b0382166000818152600d6020908152604091829020805460ff19168515159081179091558251938452908301527fd04337d59551c0c291fcbbe87bf1620fe04d214105b94e64e3bb0606a98eaa7891015b60405180910390a15050565b6000600160008381526023602052604090205460ff16600181111561119057611190613869565b1492915050565b60008060008381526023602052604090205460ff1660018111156111bd576111bd613869565b146111c757600080fd5b60006111d3834261230e565b905060006111e1844261249f565b905060006111ef8284613a72565b90508060000361120457506000949350505050565b6000858152601c6020908152604080832054601a9092528220546112289190613a5b565b9050600160195460ff16600281111561124357611243613869565b03611261578082106112585795945050505050565b50949350505050565b600260195460ff16600281111561127a5761127a613869565b036112885795945050505050565b60405162461bcd60e51b815260206004820152601860248201527f496e76616c69642072657061796d656e7420706f6c69637900000000000000006044820152606401610c4b565b610cec8383836040518060200160405280600081525061190f565b6000828152601a602052604081205461130357600080fd5b61130d838361230e565b611317848461249f565b6113219190613a72565b9392505050565b6113306121d3565b61133a82826129d6565b5050565b600061134960085490565b82106113bd5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e647300000000000000000000000000000000000000006064820152608401610c4b565b600882815481106113d0576113d0613a8a565b90600052602060002001549050919050565b6113ea6121d3565b806040516020016113fb9190613aa0565b60405160208183030381529060405280519060200120600b6040516020016114239190613abc565b604051602081830303815290604052805190602001200361144357600080fd5b6000600b805461145290613a0b565b80601f016020809104026020016040519081016040528092919081815260200182805461147e90613a0b565b80156114cb5780601f106114a0576101008083540402835291602001916114cb565b820191906000526020600020905b8154815290600101906020018083116114ae57829003601f168201915b5050505050905081600b90816114e19190613b80565b507f2e0a5b969d96a99aee0b35787d9a60516a02ca6f528a5f66d3f936468d8f0382818360405161115d929190613c40565b61151b6121d3565b61133a8282612a60565b6000818152600260205260408120546001600160a01b031680610ab25760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610c4b565b60006001600160a01b0382166116085760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610c4b565b506001600160a01b031660009081526003602052604090205490565b61162c6121d3565b6116366000612b07565b565b600b805461164590613a0b565b80601f016020809104026020016040519081016040528092919081815260200182805461167190613a0b565b80156116be5780601f10611693576101008083540402835291602001916116be565b820191906000526020600020905b8154815290600101906020018083116116a157829003601f168201915b505050505081565b6000828152601a60205260408120546116de57600080fd5b611321838361230e565b606060018054610b2d90613a0b565b61133a338383612b59565b60008061170e83612c27565b9094909350915050565b600080600061172686612c27565b600c549194509250610100900460ff16151560000361177a57600f54600e54819061ffff166117558786613c65565b61175f9190613c9a565b6117699190613c9a565b6117739190613c65565b91506117ca565b600f54601254600e54829161ffff9081169161179f9116670de0b6b3a7640000613cae565b6117a99190613cd5565b67ffffffffffffffff166117bd9190613c9a565b6117c79190613c65565b91505b6117d48686612d7c565b905093509350939050565b336000908152600d602052604081205481908190819060ff166118345760405162461bcd60e51b815260206004820152600d60248201526c2c1b9d102327a92124a22222a760991b6044820152606401610c4b565b600061184087876126b2565b90508015611855576118528782612604565b92505b61185f8187613a5b565b935061186b8382613a5b565b6000888152601c6020908152604080832054601a835281842054601b845282852054601d909452919093205493985091926118a69190613a5b565b6118b09190613a72565b6118ba9190613a5b565b91508160000361190557600087815260236020526040808220805460ff191660011790555188917f8fd2f6536279e29da11ed87593eebd3397e0ad2825b24845f64fcf3fec34139b91a25b5092959194509250565b6119193383612799565b61197c5760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526d1c881b9bdc88185c1c1c9bdd995960921b6064820152608401610c4b565b61198884848484612e4a565b50505050565b6000818152602260209081526040808320546021835281842054601a90935292205460609283929091806119c157600080fd5b60105460009067ffffffffffffffff8111156119df576119df6136b4565b604051908082528060200260200182016040528015611a08578160200160208202803683370190505b5060105490915060009067ffffffffffffffff811115611a2a57611a2a6136b4565b604051908082528060200260200182016040528015611a53578160200160208202803683370190505b50905060005b601054811015611b815785603c60108381548110611a7957611a79613a8a565b600091825260209182902091810490910154611aa191601f166101000a900460ff1688613c65565b611aab9190613c9a565b611ab59190613a72565b838281518110611ac757611ac7613a8a565b6020908102919091010152600f54600e5460108054839261ffff16916017916000919087908110611afa57611afa613a8a565b600091825260208083208183040154601f9092166101000a90910460ff168352820192909252604001902054611b349061ffff1688613c65565b611b3e9190613c9a565b611b489190613c9a565b611b529190613c65565b828281518110611b6457611b64613a8a565b602090810291909101015280611b7981613d05565b915050611a59565b509097909650945050505050565b60118181548110610f8c57600080fd5b600c5460609060ff1615611bb557610ab2612ed3565b610ab282612ee2565b919050565b336000908152600d602052604081205460ff16611c125760405162461bcd60e51b815260206004820152600d60248201526c2c1b9d102327a92124a22222a760991b6044820152606401610c4b565b600080611c1e8a612c27565b600f54600e54929450909250600091819061ffff16611c3d8a86613c65565b611c479190613c9a565b611c519190613c9a565b611c5b9190613c65565b90508a8314611cac5760405162461bcd60e51b815260206004820152601c60248201527f4c6f616e20616d6f756e7473206d75737420626520726f756e646564000000006044820152606401610c4b565b6013548b10158015611cc057506014548b11155b611d0c5760405162461bcd60e51b815260206004820152601360248201527f496e76616c6964206c6f616e20416d6f756e74000000000000000000000000006044820152606401610c4b565b6015548910158015611d2057506016548911155b611d6c5760405162461bcd60e51b815260206004820152601360248201527f496e76616c6964206c6f616e206c656e677468000000000000000000000000006044820152606401610c4b565b808a14611de15760405162461bcd60e51b815260206004820152602660248201527f496e73756666696369656e74206f726967696e6174696f6e2066656520636f6c60448201527f6c656374656400000000000000000000000000000000000000000000000000006064820152608401610c4b565b6000858152601a602090815260408083208e90558180528083208d9055601e82528083208b9055601f9091529020879055611e1c8b89612d7c565b6000868152601d6020908152604080832093909355602181528282208c905560238152828220805460ff191690556022905220429055611e5c8686612f48565b60405185907f9980a8fc1cf57eb968aa07b8cb6dea81a9f9a849bf4e38889fe9905e1ff075d990600090a250929998505050505050505050565b6000806000611ea484612c27565b600e549194509250611ebb90859061ffff16612d7c565b929491935050565b6000828152601a6020526040812054611edb57600080fd5b611321838361249f565b6000818152602260209081526040808320546021835281842054601a9093529220546060928392909180611f1857600080fd5b60115460009067ffffffffffffffff811115611f3657611f366136b4565b604051908082528060200260200182016040528015611f5f578160200160208202803683370190505b5060115490915060009067ffffffffffffffff811115611f8157611f816136b4565b604051908082528060200260200182016040528015611faa578160200160208202803683370190505b50905060005b601154811015611b815785603c60118381548110611fd057611fd0613a8a565b600091825260209182902091810490910154611ff891601f166101000a900460ff1688613c65565b6120029190613c9a565b61200c9190613a72565b83828151811061201e5761201e613a8a565b6020908102919091010152600f54600e5460118054839261ffff1691601891600091908790811061205157612051613a8a565b600091825260208083208183040154601f9092166101000a90910460ff16835282019290925260400190205461208b9061ffff1688613c65565b6120959190613c9a565b61209f9190613c9a565b6120a99190613c65565b8282815181106120bb576120bb613a8a565b6020908102919091010152806120d081613d05565b915050611fb0565b6120e06121d3565b600c805461ff0019166101008315150217905550565b6120fe6121d3565b6001600160a01b03811661217a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610c4b565b610f0581612b07565b60006001600160e01b031982166380ac58cd60e01b14806121b457506001600160e01b03198216635b5e139f60e01b145b80610ab257506301ffc9a760e01b6001600160e01b0319831614610ab2565b336121e6600a546001600160a01b031690565b6001600160a01b0316146116365760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c4b565b6000818152600260205260409020546001600160a01b0316610f055760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610c4b565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906122d582611525565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000828152602260209081526040808320546021835281842054601a9093529083205490919083805b601154811015612458578685603c6011848154811061235857612358613a8a565b60009182526020918290209181049091015461238091601f166101000a900460ff1688613c65565b61238a9190613c9a565b6123949190613a72565b1161245857600f54600e5460008a8152601e602052604081205460118054859461ffff16938492601892899081106123ce576123ce613a8a565b600091825260208083208183040154601f9092166101000a90910460ff1683528201929092526040019020546124089061ffff1689613c65565b6124129190613c9a565b61241c9190613c65565b6124269190613c9a565b6124309190613c9a565b61243a9190613c65565b6124449083613a72565b91508061245081613d05565b915050612337565b506000878152601b6020526040902054811161247b576000945050505050610ab2565b6000878152601b60205260409020546124949082613a5b565b945050505050610ab2565b6000828152602260209081526040808320546021835281842054601a9093529083205490919083805b6010548110156125c8578685603c601084815481106124e9576124e9613a8a565b60009182526020918290209181049091015461251191601f166101000a900460ff1688613c65565b61251b9190613c9a565b6125259190613a72565b116125c857600f54600e5460108054839261ffff1691601791600091908790811061255257612552613a8a565b600091825260208083208183040154601f9092166101000a90910460ff16835282019290925260400190205461258c9061ffff1687613c65565b6125969190613c9a565b6125a09190613c9a565b6125aa9190613c65565b6125b49083613a72565b9150806125c081613d05565b9150506124c8565b506000878152601c602052604090205481116125eb576000945050505050610ab2565b6000878152601c60205260409020546124949082613a5b565b60008160000361261657506000610ab2565b6000838152601b6020908152604080832054601d90925282205461263a9190613a5b565b905080156126a75782811161267e576000848152601b602052604081208054839290612667908490613a72565b9091555061267790508184613a5b565b91506126ab565b6000848152601b60205260408120805485929061269c908490613a72565b909155506126ab9050565b8291505b5092915050565b6000816000036126c457506000610ab2565b6000838152601c6020908152604080832054601a9092528220546126e89190613a5b565b905080156126a757828111612715576000848152601c602052604081208054839290612667908490613a72565b6000848152601c60205260408120805485929061269c908490613a72565b600e5461ffff9081169082161061274957600080fd5b6012805461ffff83811661ffff1983168117909355604080519190921680825260208201939093527fea8a9b607534d99a5509fb74baa48b4a9cbc7d4d284604319069d6341c6ec93a910161115d565b6000806127a583611525565b9050806001600160a01b0316846001600160a01b031614806127ec57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80610f115750836001600160a01b031661280584610bb0565b6001600160a01b031614949350505050565b826001600160a01b031661282a82611525565b6001600160a01b0316146128a65760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610c4b565b6001600160a01b0382166129085760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610c4b565b612913838383613096565b61291e6000826122a0565b6001600160a01b0383166000908152600360205260408120805460019290612947908490613a5b565b90915550506001600160a01b0382166000908152600360205260408120805460019290612975908490613a72565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b808211156129e357600080fd5b601554821415806129f657506016548114155b6129ff57600080fd5b6015805460168054928590558390556040805182815260208101849052908101859052606081018490529091907ff72779de7d913c6133f8c9bdf6e47e70d7fd993f6c671d33b522e37f91b299f0906080015b60405180910390a150505050565b808210612a6c57600080fd5b60135482141580612a7f57506014548114155b612a8857600080fd5b601354601454600f54612a9b8186613c9a565b612aa59190613c65565b601355600f54612ab58185613c9a565b612abf9190613c65565b6014556040805183815260208101839052908101859052606081018490527f19ca7434d30d4232591d62b3a60e5ff2b5bfd61d05c36845e9339e6db465834590608001612a52565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031603612bba5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610c4b565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60008060005b601054811015612cd557600f54600e5460108054839261ffff16916017916000919087908110612c5f57612c5f613a8a565b600091825260208083208183040154601f9092166101000a90910460ff168352820192909252604001902054612c999061ffff1688613c65565b612ca39190613c9a565b612cad9190613c9a565b612cb79190613c65565b612cc19084613a72565b925080612ccd81613d05565b915050612c2d565b5060008211612ce357600080fd5b600c54610100900460ff161515600003612d3957600f54600e54601254829161ffff90811691612d14911686613c65565b612d1e9190613c9a565b612d289190613c9a565b612d329190613c65565b9050915091565b600f54601254600e54829161ffff90811691612d5e9116670de0b6b3a7640000613cae565b612d689190613cd5565b67ffffffffffffffff16612d289190613c9a565b60008060005b601154811015612e4257600f54600e5460118054839261ffff1691889183916018916000919089908110612db857612db8613a8a565b600091825260208083208183040154601f9092166101000a90910460ff168352820192909252604001902054612df29061ffff168b613c65565b612dfc9190613c9a565b612e069190613c65565b612e109190613c9a565b612e1a9190613c9a565b612e249190613c65565b612e2e9083613a72565b915080612e3a81613d05565b915050612d82565b509392505050565b612e55848484612817565b612e618484848461314e565b6119885760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610c4b565b6060600b8054610b2d90613a0b565b6060612eed8261223c565b6000612ef7612ed3565b90506000815111612f175760405180602001604052806000815250611321565b80612f21846132a2565b604051602001612f32929190613d1e565b6040516020818303038152906040529392505050565b6001600160a01b038216612f9e5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c4b565b6000818152600260205260409020546001600160a01b0316156130035760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c4b565b61300f60008383613096565b6001600160a01b0382166000908152600360205260408120805460019290613038908490613a72565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160a01b0383166130f1576130ec81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b613114565b816001600160a01b0316836001600160a01b0316146131145761311483826133bb565b6001600160a01b03821661312b57610cec81613458565b826001600160a01b0316826001600160a01b031614610cec57610cec8282613507565b60006001600160a01b0384163b1561329a57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613192903390899088908890600401613d4d565b6020604051808303816000875af19250505080156131cd575060408051601f3d908101601f191682019092526131ca91810190613d89565b60015b613280573d8080156131fb576040519150601f19603f3d011682016040523d82523d6000602084013e613200565b606091505b5080516000036132785760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610c4b565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610f11565b506001610f11565b6060816000036132c95750506040805180820190915260018152600360fc1b602082015290565b8160005b81156132f357806132dd81613d05565b91506132ec9050600a83613c9a565b91506132cd565b60008167ffffffffffffffff81111561330e5761330e6136b4565b6040519080825280601f01601f191660200182016040528015613338576020820181803683370190505b5090505b8415610f115761334d600183613a5b565b915061335a600a86613da6565b613365906030613a72565b60f81b81838151811061337a5761337a613a8a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506133b4600a86613c9a565b945061333c565b600060016133c88461158a565b6133d29190613a5b565b600083815260076020526040902054909150808214613425576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061346a90600190613a5b565b6000838152600960205260408120546008805493945090928490811061349257613492613a8a565b9060005260206000200154905080600883815481106134b3576134b3613a8a565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806134eb576134eb613dba565b6001900381819060005260206000200160009055905550505050565b60006135128361158a565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160e01b031981168114610f0557600080fd5b60006020828403121561357357600080fd5b81356113218161354b565b80358015158114611bbe57600080fd5b6000602082840312156135a057600080fd5b6113218261357e565b60005b838110156135c45781810151838201526020016135ac565b838111156119885750506000910152565b600081518084526135ed8160208601602086016135a9565b601f01601f19169290920160200192915050565b60208152600061132160208301846135d5565b60006020828403121561362657600080fd5b5035919050565b80356001600160a01b0381168114611bbe57600080fd5b6000806040838503121561365757600080fd5b6136608361362d565b946020939093013593505050565b6000806040838503121561368157600080fd5b50508035926020909101359150565b6000602082840312156136a257600080fd5b813561ffff8116811461132157600080fd5b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156136e5576136e56136b4565b604051601f8501601f19908116603f0116810190828211818310171561370d5761370d6136b4565b8160405280935085815286868601111561372657600080fd5b858560208301376000602087830101525050509392505050565b6000806000806080858703121561375657600080fd5b61375f8561362d565b935061376d6020860161362d565b925060408501359150606085013567ffffffffffffffff81111561379057600080fd5b8501601f810187136137a157600080fd5b6137b0878235602084016136ca565b91505092959194509250565b6000602082840312156137ce57600080fd5b6113218261362d565b6000806000606084860312156137ec57600080fd5b6137f58461362d565b92506138036020850161362d565b9150604084013590509250925092565b60006020828403121561382557600080fd5b813560ff8116811461132157600080fd5b6000806040838503121561384957600080fd5b6138528361362d565b91506138606020840161357e565b90509250929050565b634e487b7160e01b600052602160045260246000fd5b60208101600283106138a157634e487b7160e01b600052602160045260246000fd5b91905290565b6000602082840312156138b957600080fd5b813567ffffffffffffffff8111156138d057600080fd5b8201601f810184136138e157600080fd5b610f11848235602084016136ca565b60008060006060848603121561390557600080fd5b505081359360208301359350604090920135919050565b600081518084526020808501945080840160005b8381101561394c57815187529582019590820190600101613930565b509495945050505050565b60408152600061396a604083018561391c565b828103602084015261397c818561391c565b95945050505050565b600080600080600080600060e0888a0312156139a057600080fd5b87359650602088013595506040880135945060608801359350608088013592506139cc60a0890161362d565b915060c0880135905092959891949750929550565b600080604083850312156139f457600080fd5b6139fd8361362d565b91506138606020840161362d565b600181811c90821680613a1f57607f821691505b602082108103613a3f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082821015613a6d57613a6d613a45565b500390565b60008219821115613a8557613a85613a45565b500190565b634e487b7160e01b600052603260045260246000fd5b60008251613ab28184602087016135a9565b9190910192915050565b6000808354613aca81613a0b565b60018281168015613ae25760018114613af757613b26565b60ff1984168752821515830287019450613b26565b8760005260208060002060005b85811015613b1d5781548a820152908401908201613b04565b50505082870194505b50929695505050505050565b601f821115610cec57600081815260208120601f850160051c81016020861015613b595750805b601f850160051c820191505b81811015613b7857828155600101613b65565b505050505050565b815167ffffffffffffffff811115613b9a57613b9a6136b4565b613bae81613ba88454613a0b565b84613b32565b602080601f831160018114613be35760008415613bcb5750858301515b600019600386901b1c1916600185901b178555613b78565b600085815260208120601f198616915b82811015613c1257888601518255948401946001909101908401613bf3565b5085821015613c305787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b604081526000613c5360408301856135d5565b828103602084015261397c81856135d5565b6000816000190483118215151615613c7f57613c7f613a45565b500290565b634e487b7160e01b600052601260045260246000fd5b600082613ca957613ca9613c84565b500490565b600067ffffffffffffffff80841680613cc957613cc9613c84565b92169190910492915050565b600067ffffffffffffffff80831681851681830481118215151615613cfc57613cfc613a45565b02949350505050565b600060018201613d1757613d17613a45565b5060010190565b60008351613d308184602088016135a9565b835190830190613d448183602088016135a9565b01949350505050565b60006001600160a01b03808716835280861660208401525083604083015260806060830152613d7f60808301846135d5565b9695505050505050565b600060208284031215613d9b57600080fd5b81516113218161354b565b600082613db557613db5613c84565b500690565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220c7602377388deb0953a90b4b6e254f14f2496c88353a91f423fac8f9bf11fb1364736f6c634300080f0033583720496e697469616c204c6971756964697479204c6f616e205465726d202830303529000000000000000000000000f7c5c8bdd689767e039c631ad42482128bd54ba3

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061043c5760003560e01c80635b272de011610235578063b01660ae11610135578063cd59e39d116100c8578063dee04bb911610097578063f2278f921161007c578063f2278f9214610a3a578063f2fde38b14610a5a578063fb38f71b14610a6d57600080fd5b8063dee04bb9146109eb578063e985e9c5146109fe57600080fd5b8063cd59e39d1461099f578063cf39918e146109b2578063d920cd66146109c5578063d9fc2f63146109d857600080fd5b8063b88d4fde11610104578063b88d4fde14610945578063bd2e0f2f14610958578063c35d8afa14610979578063c87b56dd1461098c57600080fd5b8063b01660ae146108ce578063b12e3683146108f6578063b185782214610904578063b63396a91461093257600080fd5b806378cb2570116101c85780638da5cb5b11610197578063949677d31161017c578063949677d3146108aa57806395d89b41146108b3578063a22cb465146108bb57600080fd5b80638da5cb5b1461087957806391d970c11461088a57600080fd5b806378cb25701461084d5780637bd2b6cf146108555780638a3df4cb1461085e5780638ac4e26c1461087157600080fd5b806370a082311161020457806370a0823114610800578063715018a61461081357806375dd473d1461081b57806376cd093b1461082957600080fd5b80635b272de0146107b2578063608bc657146107c55780636280279c146107e55780636352211e146107ed57600080fd5b80631a3118731161034057806341c73801116102d35780634a26a71b116102a25780634f6ccce7116102875780634f6ccce71461076c57806355f804b31461077f578063584109ad1461079257600080fd5b80634a26a71b146107395780634c83c2061461075957600080fd5b806341c73801146106d057806342842e0e146106e357806343d93523146106f657806349b274ed1461070957600080fd5b80632f745c591161030f5780632f745c591461067757806332e202721461068a5780633a0be1a61461069d57806340488883146106b057600080fd5b80631a311873146105eb57806323b872dd1461060e57806327023b7514610621578063273a47131461065857600080fd5b80630a6efc19116103d357806313108e0b116103a257806318160ddd1161038757806318160ddd146105ab57806318d99c72146105b35780631977ace4146105c657600080fd5b806313108e0b14610576578063150b7a021461057f57600080fd5b80630a6efc19146105075780630b879bc2146105275780630dcfd8781461055a5780630f9d0ab61461056357600080fd5b8063081812fc1161040f578063081812fc146104a5578063095ea7b3146104d057806309bc289b146104e357806309e71201146104f057600080fd5b806301ffc9a71461044157806303d7cbcd14610469578063055bd22c1461047b57806306fdde0314610490575b600080fd5b61045461044f366004613561565b610a8d565b60405190151581526020015b60405180910390f35b600c5461045490610100900460ff1681565b61048e61048936600461358e565b610ab8565b005b610498610b1e565b6040516104609190613601565b6104b86104b3366004613614565b610bb0565b6040516001600160a01b039091168152602001610460565b61048e6104de366004613644565b610bd7565b600c546104549060ff1681565b6104f960155481565b604051908152602001610460565b6104f9610515366004613614565b601a6020526000908152604090205481565b61053a61053536600461366e565b610cf1565b604080519485526020850193909352918301526060820152608001610460565b6104f960145481565b61048e610571366004613690565b610ef4565b6104f960135481565b61059261058d366004613740565b610f08565b6040516001600160e01b03199091168152602001610460565b6008546104f9565b6104f96105c1366004613614565b610f19565b6105d96105d4366004613614565b610f7c565b60405160ff9091168152602001610460565b6104546105f93660046137bc565b600d6020526000908152604090205460ff1681565b61048e61061c3660046137d7565b610fb0565b61064561062f366004613813565b60176020526000908152604090205461ffff1681565b60405161ffff9091168152602001610460565b6104f9610666366004613614565b602080526000908152604090205481565b6104f9610685366004613644565b611028565b61048e610698366004613836565b6110d0565b6104546106ab366004613614565b611169565b6104f96106be366004613614565b601b6020526000908152604090205481565b6104f96106de366004613614565b611197565b61048e6106f13660046137d7565b6112d0565b6104f961070436600461366e565b6112eb565b61072c610717366004613614565b60236020526000908152604090205460ff1681565b604051610460919061387f565b6104f9610747366004613614565b60226020526000908152604090205481565b61048e61076736600461366e565b611328565b6104f961077a366004613614565b61133e565b61048e61078d3660046138a7565b6113e2565b6104f96107a0366004613614565b601f6020526000908152604090205481565b61048e6107c036600461366e565b611513565b6104f96107d3366004613614565b601e6020526000908152604090205481565b6011546104f9565b6104b86107fb366004613614565b611525565b6104f961080e3660046137bc565b61158a565b61048e611624565b600e546106459061ffff1681565b610645610837366004613813565b60186020526000908152604090205461ffff1681565b610498611638565b6104f960165481565b6104f961086c36600461366e565b6116c6565b6010546104f9565b600a546001600160a01b03166104b8565b6104f9610898366004613614565b60216020526000908152604090205481565b6104f9600f5481565b6104986116e8565b61048e6108c9366004613836565b6116f7565b6108e16108dc366004613614565b611702565b60408051928352602083019190915201610460565b6012546106459061ffff1681565b6109176109123660046138f0565b611718565b60408051938452602084019290925290820152606001610460565b61053a61094036600461366e565b6117df565b61048e610953366004613740565b61190f565b61096b610966366004613614565b61198e565b604051610460929190613957565b6105d9610987366004613614565b611b8f565b61049861099a366004613614565b611b9f565b6104f96109ad366004613985565b611bc3565b6109176109c0366004613614565b611e96565b6104f96109d336600461366e565b611ec3565b61096b6109e6366004613614565b611ee5565b61048e6109f936600461358e565b6120d8565b610454610a0c3660046139e1565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6104f9610a48366004613614565b601d6020526000908152604090205481565b61048e610a683660046137bc565b6120f6565b6104f9610a7b366004613614565b601c6020526000908152604090205481565b60006001600160e01b0319821663780e9d6360e01b1480610ab25750610ab282612183565b92915050565b610ac06121d3565b600c5481151560ff909116151503610ad757600080fd5b600c805460ff19168215159081179091556040519081527f4c633e4e836ceb7b06d20d58cfe507ffc55e4c2f6d9b572be63e75208c7cae719060200160405180910390a150565b606060008054610b2d90613a0b565b80601f0160208091040260200160405190810160405280929190818152602001828054610b5990613a0b565b8015610ba65780601f10610b7b57610100808354040283529160200191610ba6565b820191906000526020600020905b815481529060010190602001808311610b8957829003601f168201915b5050505050905090565b6000610bbb8261223c565b506000908152600460205260409020546001600160a01b031690565b6000610be282611525565b9050806001600160a01b0316836001600160a01b031603610c545760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610c705750610c708133610a0c565b610ce25760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610c4b565b610cec83836122a0565b505050565b336000908152600d602052604081205481908190819060ff16610d465760405162461bcd60e51b815260206004820152600d60248201526c2c1b9d102327a92124a22222a760991b6044820152606401610c4b565b600160008781526023602052604090205460ff166001811115610d6b57610d6b613869565b03610d7857849150610eeb565b6000610d84874261230e565b90506000610d92884261249f565b9050868215610dbd57828110610db657610dac8382613a5b565b9050829650610dbd565b5086955060005b600082118015610dcd5750600081115b15610df457818110610def578195508181610de89190613a5b565b9050610df4565b945060005b6000610e098a610e04848b613a72565b612604565b905080610e16838a613a72565b610e209190613a5b565b9750610e358a610e30838a613a72565b6126b2565b955085610e428289613a72565b610e4c9190613a5b565b60008b8152601c6020908152604080832054601a835281842054601b845282852054601d9094529190932054939a509192610e879190613a5b565b610e919190613a72565b610e9b9190613a5b565b945084600003610ee65760008a815260236020526040808220805460ff19166001179055518b917f8fd2f6536279e29da11ed87593eebd3397e0ad2825b24845f64fcf3fec34139b91a25b505050505b92959194509250565b610efc6121d3565b610f0581612733565b50565b630a85bd0160e11b5b949350505050565b6000818152601a6020526040812054610f3157600080fd5b6000828152601c6020908152604080832054601a835281842054601b845282852054601d90945291909320549091610f6891613a5b565b610f729190613a72565b610ab29190613a5b565b60108181548110610f8c57600080fd5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b610fba3382612799565b61101d5760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526d1c881b9bdc88185c1c1c9bdd995960921b6064820152608401610c4b565b610cec838383612817565b60006110338361158a565b82106110a75760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e64730000000000000000000000000000000000000000006064820152608401610c4b565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6110d86121d3565b6001600160a01b0382166000908152600d602052604090205481151560ff90911615150361110557600080fd5b6001600160a01b0382166000818152600d6020908152604091829020805460ff19168515159081179091558251938452908301527fd04337d59551c0c291fcbbe87bf1620fe04d214105b94e64e3bb0606a98eaa7891015b60405180910390a15050565b6000600160008381526023602052604090205460ff16600181111561119057611190613869565b1492915050565b60008060008381526023602052604090205460ff1660018111156111bd576111bd613869565b146111c757600080fd5b60006111d3834261230e565b905060006111e1844261249f565b905060006111ef8284613a72565b90508060000361120457506000949350505050565b6000858152601c6020908152604080832054601a9092528220546112289190613a5b565b9050600160195460ff16600281111561124357611243613869565b03611261578082106112585795945050505050565b50949350505050565b600260195460ff16600281111561127a5761127a613869565b036112885795945050505050565b60405162461bcd60e51b815260206004820152601860248201527f496e76616c69642072657061796d656e7420706f6c69637900000000000000006044820152606401610c4b565b610cec8383836040518060200160405280600081525061190f565b6000828152601a602052604081205461130357600080fd5b61130d838361230e565b611317848461249f565b6113219190613a72565b9392505050565b6113306121d3565b61133a82826129d6565b5050565b600061134960085490565b82106113bd5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e647300000000000000000000000000000000000000006064820152608401610c4b565b600882815481106113d0576113d0613a8a565b90600052602060002001549050919050565b6113ea6121d3565b806040516020016113fb9190613aa0565b60405160208183030381529060405280519060200120600b6040516020016114239190613abc565b604051602081830303815290604052805190602001200361144357600080fd5b6000600b805461145290613a0b565b80601f016020809104026020016040519081016040528092919081815260200182805461147e90613a0b565b80156114cb5780601f106114a0576101008083540402835291602001916114cb565b820191906000526020600020905b8154815290600101906020018083116114ae57829003601f168201915b5050505050905081600b90816114e19190613b80565b507f2e0a5b969d96a99aee0b35787d9a60516a02ca6f528a5f66d3f936468d8f0382818360405161115d929190613c40565b61151b6121d3565b61133a8282612a60565b6000818152600260205260408120546001600160a01b031680610ab25760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610c4b565b60006001600160a01b0382166116085760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610c4b565b506001600160a01b031660009081526003602052604090205490565b61162c6121d3565b6116366000612b07565b565b600b805461164590613a0b565b80601f016020809104026020016040519081016040528092919081815260200182805461167190613a0b565b80156116be5780601f10611693576101008083540402835291602001916116be565b820191906000526020600020905b8154815290600101906020018083116116a157829003601f168201915b505050505081565b6000828152601a60205260408120546116de57600080fd5b611321838361230e565b606060018054610b2d90613a0b565b61133a338383612b59565b60008061170e83612c27565b9094909350915050565b600080600061172686612c27565b600c549194509250610100900460ff16151560000361177a57600f54600e54819061ffff166117558786613c65565b61175f9190613c9a565b6117699190613c9a565b6117739190613c65565b91506117ca565b600f54601254600e54829161ffff9081169161179f9116670de0b6b3a7640000613cae565b6117a99190613cd5565b67ffffffffffffffff166117bd9190613c9a565b6117c79190613c65565b91505b6117d48686612d7c565b905093509350939050565b336000908152600d602052604081205481908190819060ff166118345760405162461bcd60e51b815260206004820152600d60248201526c2c1b9d102327a92124a22222a760991b6044820152606401610c4b565b600061184087876126b2565b90508015611855576118528782612604565b92505b61185f8187613a5b565b935061186b8382613a5b565b6000888152601c6020908152604080832054601a835281842054601b845282852054601d909452919093205493985091926118a69190613a5b565b6118b09190613a72565b6118ba9190613a5b565b91508160000361190557600087815260236020526040808220805460ff191660011790555188917f8fd2f6536279e29da11ed87593eebd3397e0ad2825b24845f64fcf3fec34139b91a25b5092959194509250565b6119193383612799565b61197c5760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526d1c881b9bdc88185c1c1c9bdd995960921b6064820152608401610c4b565b61198884848484612e4a565b50505050565b6000818152602260209081526040808320546021835281842054601a90935292205460609283929091806119c157600080fd5b60105460009067ffffffffffffffff8111156119df576119df6136b4565b604051908082528060200260200182016040528015611a08578160200160208202803683370190505b5060105490915060009067ffffffffffffffff811115611a2a57611a2a6136b4565b604051908082528060200260200182016040528015611a53578160200160208202803683370190505b50905060005b601054811015611b815785603c60108381548110611a7957611a79613a8a565b600091825260209182902091810490910154611aa191601f166101000a900460ff1688613c65565b611aab9190613c9a565b611ab59190613a72565b838281518110611ac757611ac7613a8a565b6020908102919091010152600f54600e5460108054839261ffff16916017916000919087908110611afa57611afa613a8a565b600091825260208083208183040154601f9092166101000a90910460ff168352820192909252604001902054611b349061ffff1688613c65565b611b3e9190613c9a565b611b489190613c9a565b611b529190613c65565b828281518110611b6457611b64613a8a565b602090810291909101015280611b7981613d05565b915050611a59565b509097909650945050505050565b60118181548110610f8c57600080fd5b600c5460609060ff1615611bb557610ab2612ed3565b610ab282612ee2565b919050565b336000908152600d602052604081205460ff16611c125760405162461bcd60e51b815260206004820152600d60248201526c2c1b9d102327a92124a22222a760991b6044820152606401610c4b565b600080611c1e8a612c27565b600f54600e54929450909250600091819061ffff16611c3d8a86613c65565b611c479190613c9a565b611c519190613c9a565b611c5b9190613c65565b90508a8314611cac5760405162461bcd60e51b815260206004820152601c60248201527f4c6f616e20616d6f756e7473206d75737420626520726f756e646564000000006044820152606401610c4b565b6013548b10158015611cc057506014548b11155b611d0c5760405162461bcd60e51b815260206004820152601360248201527f496e76616c6964206c6f616e20416d6f756e74000000000000000000000000006044820152606401610c4b565b6015548910158015611d2057506016548911155b611d6c5760405162461bcd60e51b815260206004820152601360248201527f496e76616c6964206c6f616e206c656e677468000000000000000000000000006044820152606401610c4b565b808a14611de15760405162461bcd60e51b815260206004820152602660248201527f496e73756666696369656e74206f726967696e6174696f6e2066656520636f6c60448201527f6c656374656400000000000000000000000000000000000000000000000000006064820152608401610c4b565b6000858152601a602090815260408083208e90558180528083208d9055601e82528083208b9055601f9091529020879055611e1c8b89612d7c565b6000868152601d6020908152604080832093909355602181528282208c905560238152828220805460ff191690556022905220429055611e5c8686612f48565b60405185907f9980a8fc1cf57eb968aa07b8cb6dea81a9f9a849bf4e38889fe9905e1ff075d990600090a250929998505050505050505050565b6000806000611ea484612c27565b600e549194509250611ebb90859061ffff16612d7c565b929491935050565b6000828152601a6020526040812054611edb57600080fd5b611321838361249f565b6000818152602260209081526040808320546021835281842054601a9093529220546060928392909180611f1857600080fd5b60115460009067ffffffffffffffff811115611f3657611f366136b4565b604051908082528060200260200182016040528015611f5f578160200160208202803683370190505b5060115490915060009067ffffffffffffffff811115611f8157611f816136b4565b604051908082528060200260200182016040528015611faa578160200160208202803683370190505b50905060005b601154811015611b815785603c60118381548110611fd057611fd0613a8a565b600091825260209182902091810490910154611ff891601f166101000a900460ff1688613c65565b6120029190613c9a565b61200c9190613a72565b83828151811061201e5761201e613a8a565b6020908102919091010152600f54600e5460118054839261ffff1691601891600091908790811061205157612051613a8a565b600091825260208083208183040154601f9092166101000a90910460ff16835282019290925260400190205461208b9061ffff1688613c65565b6120959190613c9a565b61209f9190613c9a565b6120a99190613c65565b8282815181106120bb576120bb613a8a565b6020908102919091010152806120d081613d05565b915050611fb0565b6120e06121d3565b600c805461ff0019166101008315150217905550565b6120fe6121d3565b6001600160a01b03811661217a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610c4b565b610f0581612b07565b60006001600160e01b031982166380ac58cd60e01b14806121b457506001600160e01b03198216635b5e139f60e01b145b80610ab257506301ffc9a760e01b6001600160e01b0319831614610ab2565b336121e6600a546001600160a01b031690565b6001600160a01b0316146116365760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c4b565b6000818152600260205260409020546001600160a01b0316610f055760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610c4b565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906122d582611525565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000828152602260209081526040808320546021835281842054601a9093529083205490919083805b601154811015612458578685603c6011848154811061235857612358613a8a565b60009182526020918290209181049091015461238091601f166101000a900460ff1688613c65565b61238a9190613c9a565b6123949190613a72565b1161245857600f54600e5460008a8152601e602052604081205460118054859461ffff16938492601892899081106123ce576123ce613a8a565b600091825260208083208183040154601f9092166101000a90910460ff1683528201929092526040019020546124089061ffff1689613c65565b6124129190613c9a565b61241c9190613c65565b6124269190613c9a565b6124309190613c9a565b61243a9190613c65565b6124449083613a72565b91508061245081613d05565b915050612337565b506000878152601b6020526040902054811161247b576000945050505050610ab2565b6000878152601b60205260409020546124949082613a5b565b945050505050610ab2565b6000828152602260209081526040808320546021835281842054601a9093529083205490919083805b6010548110156125c8578685603c601084815481106124e9576124e9613a8a565b60009182526020918290209181049091015461251191601f166101000a900460ff1688613c65565b61251b9190613c9a565b6125259190613a72565b116125c857600f54600e5460108054839261ffff1691601791600091908790811061255257612552613a8a565b600091825260208083208183040154601f9092166101000a90910460ff16835282019290925260400190205461258c9061ffff1687613c65565b6125969190613c9a565b6125a09190613c9a565b6125aa9190613c65565b6125b49083613a72565b9150806125c081613d05565b9150506124c8565b506000878152601c602052604090205481116125eb576000945050505050610ab2565b6000878152601c60205260409020546124949082613a5b565b60008160000361261657506000610ab2565b6000838152601b6020908152604080832054601d90925282205461263a9190613a5b565b905080156126a75782811161267e576000848152601b602052604081208054839290612667908490613a72565b9091555061267790508184613a5b565b91506126ab565b6000848152601b60205260408120805485929061269c908490613a72565b909155506126ab9050565b8291505b5092915050565b6000816000036126c457506000610ab2565b6000838152601c6020908152604080832054601a9092528220546126e89190613a5b565b905080156126a757828111612715576000848152601c602052604081208054839290612667908490613a72565b6000848152601c60205260408120805485929061269c908490613a72565b600e5461ffff9081169082161061274957600080fd5b6012805461ffff83811661ffff1983168117909355604080519190921680825260208201939093527fea8a9b607534d99a5509fb74baa48b4a9cbc7d4d284604319069d6341c6ec93a910161115d565b6000806127a583611525565b9050806001600160a01b0316846001600160a01b031614806127ec57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80610f115750836001600160a01b031661280584610bb0565b6001600160a01b031614949350505050565b826001600160a01b031661282a82611525565b6001600160a01b0316146128a65760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610c4b565b6001600160a01b0382166129085760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610c4b565b612913838383613096565b61291e6000826122a0565b6001600160a01b0383166000908152600360205260408120805460019290612947908490613a5b565b90915550506001600160a01b0382166000908152600360205260408120805460019290612975908490613a72565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b808211156129e357600080fd5b601554821415806129f657506016548114155b6129ff57600080fd5b6015805460168054928590558390556040805182815260208101849052908101859052606081018490529091907ff72779de7d913c6133f8c9bdf6e47e70d7fd993f6c671d33b522e37f91b299f0906080015b60405180910390a150505050565b808210612a6c57600080fd5b60135482141580612a7f57506014548114155b612a8857600080fd5b601354601454600f54612a9b8186613c9a565b612aa59190613c65565b601355600f54612ab58185613c9a565b612abf9190613c65565b6014556040805183815260208101839052908101859052606081018490527f19ca7434d30d4232591d62b3a60e5ff2b5bfd61d05c36845e9339e6db465834590608001612a52565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031603612bba5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610c4b565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60008060005b601054811015612cd557600f54600e5460108054839261ffff16916017916000919087908110612c5f57612c5f613a8a565b600091825260208083208183040154601f9092166101000a90910460ff168352820192909252604001902054612c999061ffff1688613c65565b612ca39190613c9a565b612cad9190613c9a565b612cb79190613c65565b612cc19084613a72565b925080612ccd81613d05565b915050612c2d565b5060008211612ce357600080fd5b600c54610100900460ff161515600003612d3957600f54600e54601254829161ffff90811691612d14911686613c65565b612d1e9190613c9a565b612d289190613c9a565b612d329190613c65565b9050915091565b600f54601254600e54829161ffff90811691612d5e9116670de0b6b3a7640000613cae565b612d689190613cd5565b67ffffffffffffffff16612d289190613c9a565b60008060005b601154811015612e4257600f54600e5460118054839261ffff1691889183916018916000919089908110612db857612db8613a8a565b600091825260208083208183040154601f9092166101000a90910460ff168352820192909252604001902054612df29061ffff168b613c65565b612dfc9190613c9a565b612e069190613c65565b612e109190613c9a565b612e1a9190613c9a565b612e249190613c65565b612e2e9083613a72565b915080612e3a81613d05565b915050612d82565b509392505050565b612e55848484612817565b612e618484848461314e565b6119885760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610c4b565b6060600b8054610b2d90613a0b565b6060612eed8261223c565b6000612ef7612ed3565b90506000815111612f175760405180602001604052806000815250611321565b80612f21846132a2565b604051602001612f32929190613d1e565b6040516020818303038152906040529392505050565b6001600160a01b038216612f9e5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c4b565b6000818152600260205260409020546001600160a01b0316156130035760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c4b565b61300f60008383613096565b6001600160a01b0382166000908152600360205260408120805460019290613038908490613a72565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160a01b0383166130f1576130ec81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b613114565b816001600160a01b0316836001600160a01b0316146131145761311483826133bb565b6001600160a01b03821661312b57610cec81613458565b826001600160a01b0316826001600160a01b031614610cec57610cec8282613507565b60006001600160a01b0384163b1561329a57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613192903390899088908890600401613d4d565b6020604051808303816000875af19250505080156131cd575060408051601f3d908101601f191682019092526131ca91810190613d89565b60015b613280573d8080156131fb576040519150601f19603f3d011682016040523d82523d6000602084013e613200565b606091505b5080516000036132785760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610c4b565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610f11565b506001610f11565b6060816000036132c95750506040805180820190915260018152600360fc1b602082015290565b8160005b81156132f357806132dd81613d05565b91506132ec9050600a83613c9a565b91506132cd565b60008167ffffffffffffffff81111561330e5761330e6136b4565b6040519080825280601f01601f191660200182016040528015613338576020820181803683370190505b5090505b8415610f115761334d600183613a5b565b915061335a600a86613da6565b613365906030613a72565b60f81b81838151811061337a5761337a613a8a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506133b4600a86613c9a565b945061333c565b600060016133c88461158a565b6133d29190613a5b565b600083815260076020526040902054909150808214613425576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061346a90600190613a5b565b6000838152600960205260408120546008805493945090928490811061349257613492613a8a565b9060005260206000200154905080600883815481106134b3576134b3613a8a565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806134eb576134eb613dba565b6001900381819060005260206000200160009055905550505050565b60006135128361158a565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160e01b031981168114610f0557600080fd5b60006020828403121561357357600080fd5b81356113218161354b565b80358015158114611bbe57600080fd5b6000602082840312156135a057600080fd5b6113218261357e565b60005b838110156135c45781810151838201526020016135ac565b838111156119885750506000910152565b600081518084526135ed8160208601602086016135a9565b601f01601f19169290920160200192915050565b60208152600061132160208301846135d5565b60006020828403121561362657600080fd5b5035919050565b80356001600160a01b0381168114611bbe57600080fd5b6000806040838503121561365757600080fd5b6136608361362d565b946020939093013593505050565b6000806040838503121561368157600080fd5b50508035926020909101359150565b6000602082840312156136a257600080fd5b813561ffff8116811461132157600080fd5b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156136e5576136e56136b4565b604051601f8501601f19908116603f0116810190828211818310171561370d5761370d6136b4565b8160405280935085815286868601111561372657600080fd5b858560208301376000602087830101525050509392505050565b6000806000806080858703121561375657600080fd5b61375f8561362d565b935061376d6020860161362d565b925060408501359150606085013567ffffffffffffffff81111561379057600080fd5b8501601f810187136137a157600080fd5b6137b0878235602084016136ca565b91505092959194509250565b6000602082840312156137ce57600080fd5b6113218261362d565b6000806000606084860312156137ec57600080fd5b6137f58461362d565b92506138036020850161362d565b9150604084013590509250925092565b60006020828403121561382557600080fd5b813560ff8116811461132157600080fd5b6000806040838503121561384957600080fd5b6138528361362d565b91506138606020840161357e565b90509250929050565b634e487b7160e01b600052602160045260246000fd5b60208101600283106138a157634e487b7160e01b600052602160045260246000fd5b91905290565b6000602082840312156138b957600080fd5b813567ffffffffffffffff8111156138d057600080fd5b8201601f810184136138e157600080fd5b610f11848235602084016136ca565b60008060006060848603121561390557600080fd5b505081359360208301359350604090920135919050565b600081518084526020808501945080840160005b8381101561394c57815187529582019590820190600101613930565b509495945050505050565b60408152600061396a604083018561391c565b828103602084015261397c818561391c565b95945050505050565b600080600080600080600060e0888a0312156139a057600080fd5b87359650602088013595506040880135945060608801359350608088013592506139cc60a0890161362d565b915060c0880135905092959891949750929550565b600080604083850312156139f457600080fd5b6139fd8361362d565b91506138606020840161362d565b600181811c90821680613a1f57607f821691505b602082108103613a3f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082821015613a6d57613a6d613a45565b500390565b60008219821115613a8557613a85613a45565b500190565b634e487b7160e01b600052603260045260246000fd5b60008251613ab28184602087016135a9565b9190910192915050565b6000808354613aca81613a0b565b60018281168015613ae25760018114613af757613b26565b60ff1984168752821515830287019450613b26565b8760005260208060002060005b85811015613b1d5781548a820152908401908201613b04565b50505082870194505b50929695505050505050565b601f821115610cec57600081815260208120601f850160051c81016020861015613b595750805b601f850160051c820191505b81811015613b7857828155600101613b65565b505050505050565b815167ffffffffffffffff811115613b9a57613b9a6136b4565b613bae81613ba88454613a0b565b84613b32565b602080601f831160018114613be35760008415613bcb5750858301515b600019600386901b1c1916600185901b178555613b78565b600085815260208120601f198616915b82811015613c1257888601518255948401946001909101908401613bf3565b5085821015613c305787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b604081526000613c5360408301856135d5565b828103602084015261397c81856135d5565b6000816000190483118215151615613c7f57613c7f613a45565b500290565b634e487b7160e01b600052601260045260246000fd5b600082613ca957613ca9613c84565b500490565b600067ffffffffffffffff80841680613cc957613cc9613c84565b92169190910492915050565b600067ffffffffffffffff80831681851681830481118215151615613cfc57613cfc613a45565b02949350505050565b600060018201613d1757613d17613a45565b5060010190565b60008351613d308184602088016135a9565b835190830190613d448183602088016135a9565b01949350505050565b60006001600160a01b03808716835280861660208401525083604083015260806060830152613d7f60808301846135d5565b9695505050505050565b600060208284031215613d9b57600080fd5b81516113218161354b565b600082613db557613db5613c84565b500690565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220c7602377388deb0953a90b4b6e254f14f2496c88353a91f423fac8f9bf11fb1364736f6c634300080f0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000f7c5c8bdd689767e039c631ad42482128bd54ba3

-----Decoded View---------------
Arg [0] : _owner (address): 0xf7c5c8Bdd689767e039c631Ad42482128BD54Ba3

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000f7c5c8bdd689767e039c631ad42482128bd54ba3


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  ]
[ 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.