ETH Price: $3,597.88 (+1.15%)
Gas: 61 Gwei

NFTfi Promissory Note (NFTfi)
 

Overview

TokenID

384

Total Transfers

-

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

NFTfi is a simple peer to peer marketplace for NFT collateralised loans. Users can put their NFT assets up as collateral for a loan, or offer loans to other users on their non-fungible tokens.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
NFTfi

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2020-05-11
*/

pragma solidity ^0.5.16;
// File: contracts/NFTfi/v1/openzeppelin/Ownable.sol



/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
    address private _owner;

    event OwnershipTransferred(address previousOwner, address newOwner);

    /**
     * @dev The Ownable constructor sets the original `owner` of the contract to the sender
     * account.
     */
    constructor () internal {
        _owner = msg.sender;
        emit OwnershipTransferred(address(0), _owner);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(isOwner());
        _;
    }

    /**
     * @return true if `msg.sender` is the owner of the contract.
     */
    function isOwner() public view returns (bool) {
        return msg.sender == _owner;
    }

    /**
     * @dev Allows the current owner to relinquish control of the contract.
     * @notice Renouncing to ownership will leave the contract without an owner.
     * It will not be possible to call the functions with the `onlyOwner`
     * modifier anymore.
     */
    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Allows the current owner to transfer control of the contract to a newOwner.
     * @param newOwner The address to transfer ownership to.
     */
    function transferOwnership(address newOwner) public onlyOwner {
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers control of the contract to a newOwner.
     * @param newOwner The address to transfer ownership to.
     */
    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0));
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

// File: contracts/NFTfi/v1/openzeppelin/Roles.sol



/**
 * @title Roles
 * @dev Library for managing addresses assigned to a Role.
 */
library Roles {
    struct Role {
        mapping (address => bool) bearer;
    }

    /**
     * @dev give an account access to this role
     */
    function add(Role storage role, address account) internal {
        require(account != address(0));
        require(!has(role, account));

        role.bearer[account] = true;
    }

    /**
     * @dev remove an account's access to this role
     */
    function remove(Role storage role, address account) internal {
        require(account != address(0));
        require(has(role, account));

        role.bearer[account] = false;
    }

    /**
     * @dev check if an account has this role
     * @return bool
     */
    function has(Role storage role, address account) internal view returns (bool) {
        require(account != address(0));
        return role.bearer[account];
    }
}

// File: contracts/NFTfi/v1/openzeppelin/PauserRole.sol




contract PauserRole {
    using Roles for Roles.Role;

    event PauserAdded(address indexed account);
    event PauserRemoved(address indexed account);

    Roles.Role private _pausers;

    constructor () internal {
        _addPauser(msg.sender);
    }

    modifier onlyPauser() {
        require(isPauser(msg.sender));
        _;
    }

    function isPauser(address account) public view returns (bool) {
        return _pausers.has(account);
    }

    function addPauser(address account) public onlyPauser {
        _addPauser(account);
    }

    function renouncePauser() public {
        _removePauser(msg.sender);
    }

    function _addPauser(address account) internal {
        _pausers.add(account);
        emit PauserAdded(account);
    }

    function _removePauser(address account) internal {
        _pausers.remove(account);
        emit PauserRemoved(account);
    }
}

// File: contracts/NFTfi/v1/openzeppelin/Pausable.sol




/**
 * @title Pausable
 * @dev Base contract which allows children to implement an emergency stop mechanism.
 */
contract Pausable is PauserRole {
    event Paused(address account);
    event Unpaused(address account);

    bool private _paused;

    constructor () internal {
        _paused = false;
    }

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

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     */
    modifier whenNotPaused() {
        require(!_paused);
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     */
    modifier whenPaused() {
        require(_paused);
        _;
    }

    /**
     * @dev called by the owner to pause, triggers stopped state
     */
    function pause() public onlyPauser whenNotPaused {
        _paused = true;
        emit Paused(msg.sender);
    }

    /**
     * @dev called by the owner to unpause, returns to normal state
     */
    function unpause() public onlyPauser whenPaused {
        _paused = false;
        emit Unpaused(msg.sender);
    }
}

// File: contracts/NFTfi/v1/openzeppelin/ReentrancyGuard.sol



/**
 * @title Helps contracts guard against reentrancy attacks.
 * @author Remco Bloemen <remco@2π.com>, Eenae <[email protected]>
 * @dev If you mark a function `nonReentrant`, you should also
 * mark it `external`.
 */
contract ReentrancyGuard {
    /// @dev counter to allow mutex lock with only one SSTORE operation
    uint256 private _guardCounter;

    constructor() public {
        // The counter starts at one to prevent changing it from zero to a non-zero
        // value, which is a more expensive operation.
        _guardCounter = 1;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _guardCounter += 1;
        uint256 localCounter = _guardCounter;
        _;
        require(localCounter == _guardCounter);
    }
}

// File: contracts/NFTfi/v1/NFTfiAdmin.sol

pragma solidity ^0.5.16;




// @title Admin contract for NFTfi. Holds owner-only functions to adjust
//        contract-wide fees, parameters, etc.
// @author smartcontractdev.eth, creator of wrappedkitties.eth, cwhelper.eth, and
//         kittybounties.eth
contract NFTfiAdmin is Ownable, Pausable, ReentrancyGuard {

    /* ****** */
    /* EVENTS */
    /* ****** */

    // @notice This event is fired whenever the admins change the percent of
    //         interest rates earned that they charge as a fee. Note that
    //         newAdminFee can never exceed 10,000, since the fee is measured
    //         in basis points.
    // @param  newAdminFee - The new admin fee measured in basis points. This
    //         is a percent of the interest paid upon a loan's completion that
    //         go to the contract admins.
    event AdminFeeUpdated(
        uint256 newAdminFee
    );

    /* ******* */
    /* STORAGE */
    /* ******* */

    // @notice A mapping from from an ERC20 currency address to whether that
    //         currency is whitelisted to be used by this contract. Note that
    //         NFTfi only supports loans that use ERC20 currencies that are
    //         whitelisted, all other calls to beginLoan() will fail.
    mapping (address => bool) public erc20CurrencyIsWhitelisted;

    // @notice A mapping from from an NFT contract's address to whether that
    //         contract is whitelisted to be used by this contract. Note that
    //         NFTfi only supports loans that use NFT collateral from contracts
    //         that are whitelisted, all other calls to beginLoan() will fail.
    mapping (address => bool) public nftContractIsWhitelisted;

    // @notice The maximum duration of any loan started on this platform,
    //         measured in seconds. This is both a sanity-check for borrowers
    //         and an upper limit on how long admins will have to support v1 of
    //         this contract if they eventually deprecate it, as well as a check
    //         to ensure that the loan duration never exceeds the space alotted
    //         for it in the loan struct.
    uint256 public maximumLoanDuration = 53 weeks;

    // @notice The maximum number of active loans allowed on this platform.
    //         This parameter is used to limit the risk that NFTfi faces while
    //         the project is first getting started.
    uint256 public maximumNumberOfActiveLoans = 100;

    // @notice The percentage of interest earned by lenders on this platform
    //         that is taken by the contract admin's as a fee, measured in
    //         basis points (hundreths of a percent).
    uint256 public adminFeeInBasisPoints = 25;

    /* *********** */
    /* CONSTRUCTOR */
    /* *********** */

    constructor() internal {
        // Whitelist mainnet WETH
        erc20CurrencyIsWhitelisted[address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2)] = true;

        // Whitelist mainnet DAI
        erc20CurrencyIsWhitelisted[address(0x6B175474E89094C44Da98b954EedeAC495271d0F)] = true;

        // Whitelist mainnet CryptoKitties
        nftContractIsWhitelisted[address(0x06012c8cf97BEaD5deAe237070F9587f8E7A266d)] = true;
    }

    /* ********* */
    /* FUNCTIONS */
    /* ********* */

    /**
     * @dev Gets the token name
     * @return string representing the token name
     */
    function name() external pure returns (string memory) {
        return "NFTfi Promissory Note";
    }

    /**
     * @dev Gets the token symbol
     * @return string representing the token symbol
     */
    function symbol() external pure returns (string memory) {
        return "NFTfi";
    }

    // @notice This function can be called by admins to change the whitelist
    //         status of an ERC20 currency. This includes both adding an ERC20
    //         currency to the whitelist and removing it.
    // @param  _erc20Currency - The address of the ERC20 currency whose whitelist
    //         status changed.
    // @param  _setAsWhitelisted - The new status of whether the currency is
    //         whitelisted or not.
    function whitelistERC20Currency(address _erc20Currency, bool _setAsWhitelisted) external onlyOwner {
        erc20CurrencyIsWhitelisted[_erc20Currency] = _setAsWhitelisted;
    }

    // @notice This function can be called by admins to change the whitelist
    //         status of an NFT contract. This includes both adding an NFT
    //         contract to the whitelist and removing it.
    // @param  _nftContract - The address of the NFT contract whose whitelist
    //         status changed.
    // @param  _setAsWhitelisted - The new status of whether the contract is
    //         whitelisted or not.
    function whitelistNFTContract(address _nftContract, bool _setAsWhitelisted) external onlyOwner {
        nftContractIsWhitelisted[_nftContract] = _setAsWhitelisted;
    }

    // @notice This function can be called by admins to change the
    //         maximumLoanDuration. Note that they can never change
    //         maximumLoanDuration to be greater than UINT32_MAX, since that's
    //         the maximum space alotted for the duration in the loan struct.
    // @param  _newMaximumLoanDuration - The new maximum loan duration, measured
    //         in seconds.
    function updateMaximumLoanDuration(uint256 _newMaximumLoanDuration) external onlyOwner {
        require(_newMaximumLoanDuration <= uint256(~uint32(0)), 'loan duration cannot exceed space alotted in struct');
        maximumLoanDuration = _newMaximumLoanDuration;
    }

    // @notice This function can be called by admins to change the
    //         maximumNumberOfActiveLoans. 
    // @param  _newMaximumNumberOfActiveLoans - The new maximum number of
    //         active loans, used to limit the risk that NFTfi faces while the
    //         project is first getting started.
    function updateMaximumNumberOfActiveLoans(uint256 _newMaximumNumberOfActiveLoans) external onlyOwner {
        maximumNumberOfActiveLoans = _newMaximumNumberOfActiveLoans;
    }

    // @notice This function can be called by admins to change the percent of
    //         interest rates earned that they charge as a fee. Note that
    //         newAdminFee can never exceed 10,000, since the fee is measured
    //         in basis points.
    // @param  _newAdminFeeInBasisPoints - The new admin fee measured in basis points. This
    //         is a percent of the interest paid upon a loan's completion that
    //         go to the contract admins.
    function updateAdminFee(uint256 _newAdminFeeInBasisPoints) external onlyOwner {
        require(_newAdminFeeInBasisPoints <= 10000, 'By definition, basis points cannot exceed 10000');
        adminFeeInBasisPoints = _newAdminFeeInBasisPoints;
        emit AdminFeeUpdated(_newAdminFeeInBasisPoints);
    }
}

// File: contracts/NFTfi/v1/openzeppelin/ECDSA.sol



/**
 * @title Elliptic curve signature operations
 * @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d
 * TODO Remove this library once solidity supports passing a signature to ecrecover.
 * See https://github.com/ethereum/solidity/issues/864
 */

library ECDSA {
    /**
     * @dev Recover signer address from a message by using their signature
     * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.
     * @param signature bytes signature, the signature is generated using web3.eth.sign()
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        bytes32 r;
        bytes32 s;
        uint8 v;

        // Check the signature length
        if (signature.length != 65) {
            return (address(0));
        }

        // Divide the signature in r, s and v variables
        // ecrecover takes the signature parameters, and the only way to get them
        // currently is to use assembly.
        // solhint-disable-next-line no-inline-assembly
        assembly {
            r := mload(add(signature, 0x20))
            s := mload(add(signature, 0x40))
            v := byte(0, mload(add(signature, 0x60)))
        }

        // Version of signature should be 27 or 28, but 0 and 1 are also possible versions
        if (v < 27) {
            v += 27;
        }

        // If the version is correct return the signer address
        if (v != 27 && v != 28) {
            return (address(0));
        } else {
            return ecrecover(hash, v, r, s);
        }
    }

    /**
     * toEthSignedMessageHash
     * @dev prefix a bytes32 value with "\x19Ethereum Signed Message:"
     * and hash the result
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }
}

// File: contracts/NFTfi/v1/NFTfiSigningUtils.sol

pragma solidity ^0.5.16;


// @title  Helper contract for NFTfi. This contract manages verifying signatures
//         from off-chain NFTfi orders.
// @author smartcontractdev.eth, creator of wrappedkitties.eth, cwhelper.eth,
//         and kittybounties.eth
// @notice Cite: I found the following article very insightful while creating
//         this contract:
//         https://dzone.com/articles/signing-and-verifying-ethereum-signatures
// @notice Cite: I also relied on this article somewhat:
//         https://forum.openzeppelin.com/t/sign-it-like-you-mean-it-creating-and-verifying-ethereum-signatures/697
contract NFTfiSigningUtils {

    /* *********** */
    /* CONSTRUCTOR */
    /* *********** */

    constructor() internal {}

    /* ********* */
    /* FUNCTIONS */
    /* ********* */

    // @notice OpenZeppelin's ECDSA library is used to call all ECDSA functions
    //         directly on the bytes32 variables themselves.
    using ECDSA for bytes32;

    // @notice This function gets the current chain ID.
    function getChainID() public view returns (uint256) {
        uint256 id;
        assembly {
            id := chainid()
        }
        return id;
    }

    // @notice This function is called in NFTfi.beginLoan() to validate the
    //         borrower's signature that the borrower provided off-chain to
    //         verify that they did indeed want to use this NFT for this loan.
    // @param  _nftCollateralId - The ID within the NFTCollateralContract for
    //         the NFT being used as collateral for this loan. The NFT is
    //         stored within this contract during the duration of the loan.
    // @param  _borrowerNonce - The nonce referred to here
    //         is not the same as an Ethereum account's nonce. We are referring
    //         instead to nonces that are used by both the lender and the
    //         borrower when they are first signing off-chain NFTfi orders.
    //         These nonces can be any uint256 value that the user has not
    //         previously used to sign an off-chain order. Each nonce can be
    //         used at most once per user within NFTfi, regardless of whether
    //         they are the lender or the borrower in that situation. This
    //         serves two purposes. First, it prevents replay attacks where an
    //         attacker would submit a user's off-chain order more than once.
    //         Second, it allows a user to cancel an off-chain order by calling
    //         NFTfi.cancelLoanCommitmentBeforeLoanHasBegun(), which marks the
    //         nonce as used and prevents any future loan from using the user's
    //         off-chain order that contains that nonce.
    // @param  _nftCollateralContract - The ERC721 contract of the NFT
    //         collateral
    // @param  _borrower - The address of the borrower.
    // @param  _borrowerSignature - The ECDSA signature of the borrower,
    //         obtained off-chain ahead of time, signing the following
    //         combination of parameters: _nftCollateralId, _borrowerNonce,
    //         _nftCollateralContract, _borrower.
    // @return A bool representing whether verification succeeded, showing that
    //         this signature matched this address and parameters.
    function isValidBorrowerSignature(
        uint256 _nftCollateralId,
        uint256 _borrowerNonce,
        address _nftCollateralContract,
        address _borrower,
        bytes memory _borrowerSignature
    ) public view returns(bool) {
        if(_borrower == address(0)){
            return false;
        } else {
            uint256 chainId;
            chainId = getChainID();
            bytes32 message = keccak256(abi.encodePacked(
                _nftCollateralId,
                _borrowerNonce,
                _nftCollateralContract,
                _borrower,
                chainId
            ));

            bytes32 messageWithEthSignPrefix = message.toEthSignedMessageHash();

            return (messageWithEthSignPrefix.recover(_borrowerSignature) == _borrower);
        }
    }

    // @notice This function is called in NFTfi.beginLoan() to validate the
    //         lender's signature that the lender provided off-chain to
    //         verify that they did indeed want to agree to this loan according
    //         to these terms.
    // @param  _loanPrincipalAmount - The original sum of money transferred
    //         from lender to borrower at the beginning of the loan, measured
    //         in loanERC20Denomination's smallest units.
    // @param  _maximumRepaymentAmount - The maximum amount of money that the
    //         borrower would be required to retrieve their collateral. If
    //         interestIsProRated is set to false, then the borrower will
    //         always have to pay this amount to retrieve their collateral.
    // @param  _nftCollateralId - The ID within the NFTCollateralContract for
    //         the NFT being used as collateral for this loan. The NFT is
    //         stored within this contract during the duration of the loan.
    // @param  _loanDuration - The amount of time (measured in seconds) that can
    //         elapse before the lender can liquidate the loan and seize the
    //         underlying collateral NFT.
    // @param  _loanInterestRateForDurationInBasisPoints - The interest rate
    //         (measured in basis points, e.g. hundreths of a percent) for the
    //         loan, that must be repaid pro-rata by the borrower at the
    //         conclusion of the loan or risk seizure of their nft collateral.
    // @param  _adminFeeInBasisPoints - The percent (measured in basis
    //         points) of the interest earned that will be taken as a fee by
    //         the contract admins when the loan is repaid. The fee is stored
    //         in the loan struct to prevent an attack where the contract
    //         admins could adjust the fee right before a loan is repaid, and
    //         take all of the interest earned.
    // @param  _lenderNonce - The nonce referred to here
    //         is not the same as an Ethereum account's nonce. We are referring
    //         instead to nonces that are used by both the lender and the
    //         borrower when they are first signing off-chain NFTfi orders.
    //         These nonces can be any uint256 value that the user has not
    //         previously used to sign an off-chain order. Each nonce can be
    //         used at most once per user within NFTfi, regardless of whether
    //         they are the lender or the borrower in that situation. This
    //         serves two purposes. First, it prevents replay attacks where an
    //         attacker would submit a user's off-chain order more than once.
    //         Second, it allows a user to cancel an off-chain order by calling
    //         NFTfi.cancelLoanCommitmentBeforeLoanHasBegun(), which marks the
    //         nonce as used and prevents any future loan from using the user's
    //         off-chain order that contains that nonce.
    // @param  _nftCollateralContract - The ERC721 contract of the NFT
    //         collateral
    // @param  _loanERC20Denomination - The ERC20 contract of the currency being
    //         used as principal/interest for this loan.
    // @param  _lender - The address of the lender. The lender can change their
    //         address by transferring the NFTfi ERC721 token that they
    //         received when the loan began.
    // @param  _interestIsProRated - A boolean value determining whether the
    //         interest will be pro-rated if the loan is repaid early, or
    //         whether the borrower will simply pay maximumRepaymentAmount.
    // @param  _lenderSignature - The ECDSA signature of the lender,
    //         obtained off-chain ahead of time, signing the following
    //         combination of parameters: _loanPrincipalAmount,
    //         _maximumRepaymentAmount _nftCollateralId, _loanDuration,
    //         _loanInterestRateForDurationInBasisPoints, _lenderNonce,
    //         _nftCollateralContract, _loanERC20Denomination, _lender,
    //         _interestIsProRated.
    // @return A bool representing whether verification succeeded, showing that
    //         this signature matched this address and parameters.
    function isValidLenderSignature(
        uint256 _loanPrincipalAmount,
        uint256 _maximumRepaymentAmount,
        uint256 _nftCollateralId,
        uint256 _loanDuration,
        uint256 _loanInterestRateForDurationInBasisPoints,
        uint256 _adminFeeInBasisPoints,
        uint256 _lenderNonce,
        address _nftCollateralContract,
        address _loanERC20Denomination,
        address _lender,
        bool _interestIsProRated,
        bytes memory _lenderSignature
    ) public view returns(bool) {
        if(_lender == address(0)){
            return false;
        } else {
            uint256 chainId;
            chainId = getChainID();
            bytes32 message = keccak256(abi.encodePacked(
                _loanPrincipalAmount,
                _maximumRepaymentAmount,
                _nftCollateralId,
                _loanDuration,
                _loanInterestRateForDurationInBasisPoints,
                _adminFeeInBasisPoints,
                _lenderNonce,
                _nftCollateralContract,
                _loanERC20Denomination,
                _lender,
                _interestIsProRated,
                chainId
            ));

            bytes32 messageWithEthSignPrefix = message.toEthSignedMessageHash();

            return (messageWithEthSignPrefix.recover(_lenderSignature) == _lender);
        }
    }
}

// File: contracts/NFTfi/v1/openzeppelin/IERC165.sol



/**
 * @title IERC165
 * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md
 */
interface IERC165 {
    /**
     * @notice Query if a contract implements an interface
     * @param interfaceId The interface identifier, as specified in ERC-165
     * @dev Interface identification is specified in ERC-165. This function
     * uses less than 30,000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

// File: contracts/NFTfi/v1/openzeppelin/IERC721.sol




/**
 * @title ERC721 Non-Fungible Token Standard basic interface
 * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract IERC721 is IERC165 {
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    function balanceOf(address owner) public view returns (uint256 balance);
    function ownerOf(uint256 tokenId) public view returns (address owner);

    function approve(address to, uint256 tokenId) public;
    function getApproved(uint256 tokenId) public view returns (address operator);

    function setApprovalForAll(address operator, bool _approved) public;
    function isApprovedForAll(address owner, address operator) public view returns (bool);

    function transferFrom(address from, address to, uint256 tokenId) public;
    function safeTransferFrom(address from, address to, uint256 tokenId) public;

    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public;
}

// File: contracts/NFTfi/v1/openzeppelin/IERC721Receiver.sol



/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
contract IERC721Receiver {
    /**
     * @notice Handle the receipt of an NFT
     * @dev The ERC721 smart contract calls this function on the recipient
     * after a `safeTransfer`. This function MUST return the function selector,
     * otherwise the caller will revert the transaction. The selector to be
     * returned can be obtained as `this.onERC721Received.selector`. This
     * function MAY throw to revert and reject the transfer.
     * Note: the ERC721 contract address is always the message sender.
     * @param operator The address which called `safeTransferFrom` function
     * @param from The address which previously owned the token
     * @param tokenId The NFT identifier which is being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
     */
    function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data)
    public returns (bytes4);
}

// File: contracts/NFTfi/v1/openzeppelin/SafeMath.sol



/**
 * @title SafeMath
 * @dev Unsigned math operations with safety checks that revert on error
 */
library SafeMath {
    /**
    * @dev Multiplies two unsigned integers, reverts on overflow.
    */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b);

        return c;
    }

    /**
    * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
    */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
    * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
    */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a);
        uint256 c = a - b;

        return c;
    }

    /**
    * @dev Adds two unsigned integers, reverts on overflow.
    */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a);

        return c;
    }

    /**
    * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
    * reverts when dividing by zero.
    */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b != 0);
        return a % b;
    }
}

// File: contracts/NFTfi/v1/openzeppelin/Address.sol



/**
 * Utility library of inline functions on addresses
 */
library Address {
    /**
     * Returns whether the target address is a contract
     * @dev This function will return false if invoked during the constructor of a contract,
     * as the code is not actually created until after the constructor finishes.
     * @param account address of the account to check
     * @return whether the target address is a contract
     */
    function isContract(address account) internal view returns (bool) {
        uint256 size;
        // XXX Currently there is no better way to check if there is a contract in an address
        // than to check the size of the code at that address.
        // See https://ethereum.stackexchange.com/a/14016/36603
        // for more details about how this works.
        // TODO Check this again before the Serenity release, because all addresses will be
        // contracts then.
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }
}

// File: contracts/NFTfi/v1/openzeppelin/ERC165.sol




/**
 * @title ERC165
 * @author Matt Condon (@shrugs)
 * @dev Implements ERC165 using a lookup table.
 */
contract ERC165 is IERC165 {
    bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;
    /**
     * 0x01ffc9a7 ===
     *     bytes4(keccak256('supportsInterface(bytes4)'))
     */

    /**
     * @dev a mapping of interface id to whether or not it's supported
     */
    mapping(bytes4 => bool) private _supportedInterfaces;

    /**
     * @dev A contract implementing SupportsInterfaceWithLookup
     * implement ERC165 itself
     */
    constructor () internal {
        _registerInterface(_INTERFACE_ID_ERC165);
    }

    /**
     * @dev implement supportsInterface(bytes4) using a lookup table
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool) {
        return _supportedInterfaces[interfaceId];
    }

    /**
     * @dev internal method for registering an interface
     */
    function _registerInterface(bytes4 interfaceId) internal {
        require(interfaceId != 0xffffffff);
        _supportedInterfaces[interfaceId] = true;
    }
}

// File: contracts/NFTfi/v1/openzeppelin/ERC721.sol








/**
 * @title ERC721 Non-Fungible Token Standard basic implementation
 * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract ERC721 is ERC165, IERC721 {
    using SafeMath for uint256;
    using Address for address;

    // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
    // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector`
    bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;

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

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

    // Mapping from owner to number of owned token
    mapping (address => uint256) private _ownedTokensCount;

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

    bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;
    /*
     * 0x80ac58cd ===
     *     bytes4(keccak256('balanceOf(address)')) ^
     *     bytes4(keccak256('ownerOf(uint256)')) ^
     *     bytes4(keccak256('approve(address,uint256)')) ^
     *     bytes4(keccak256('getApproved(uint256)')) ^
     *     bytes4(keccak256('setApprovalForAll(address,bool)')) ^
     *     bytes4(keccak256('isApprovedForAll(address,address)')) ^
     *     bytes4(keccak256('transferFrom(address,address,uint256)')) ^
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256)')) ^
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)'))
     */

    constructor () public {
        // register the supported interfaces to conform to ERC721 via ERC165
        _registerInterface(_INTERFACE_ID_ERC721);
    }

    /**
     * @dev Gets the balance of the specified address
     * @param owner address to query the balance of
     * @return uint256 representing the amount owned by the passed address
     */
    function balanceOf(address owner) public view returns (uint256) {
        require(owner != address(0));
        return _ownedTokensCount[owner];
    }

    /**
     * @dev Gets the owner of the specified token ID
     * @param tokenId uint256 ID of the token to query the owner of
     * @return owner address currently marked as the owner of the given token ID
     */
    function ownerOf(uint256 tokenId) public view returns (address) {
        address owner = _tokenOwner[tokenId];
        require(owner != address(0));
        return owner;
    }

    /**
     * @dev Approves another address to transfer the given token ID
     * The zero address indicates there is no approved address.
     * There can only be one approved address per token at a given time.
     * Can only be called by the token owner or an approved operator.
     * @param to address to be approved for the given token ID
     * @param tokenId uint256 ID of the token to be approved
     */
    function approve(address to, uint256 tokenId) public {
        address owner = ownerOf(tokenId);
        require(to != owner);
        require(msg.sender == owner || isApprovedForAll(owner, msg.sender));

        _tokenApprovals[tokenId] = to;
        emit Approval(owner, to, tokenId);
    }

    /**
     * @dev Gets the approved address for a token ID, or zero if no address set
     * Reverts if the token ID does not exist.
     * @param tokenId uint256 ID of the token to query the approval of
     * @return address currently approved for the given token ID
     */
    function getApproved(uint256 tokenId) public view returns (address) {
        require(_exists(tokenId));
        return _tokenApprovals[tokenId];
    }

    /**
     * @dev Sets or unsets the approval of a given operator
     * An operator is allowed to transfer all tokens of the sender on their behalf
     * @param to operator address to set the approval
     * @param approved representing the status of the approval to be set
     */
    function setApprovalForAll(address to, bool approved) public {
        require(to != msg.sender);
        _operatorApprovals[msg.sender][to] = approved;
        emit ApprovalForAll(msg.sender, to, approved);
    }

    /**
     * @dev Tells whether an operator is approved by a given owner
     * @param owner owner address which you want to query the approval of
     * @param operator operator address which you want to query the approval of
     * @return bool whether the given operator is approved by the given owner
     */
    function isApprovedForAll(address owner, address operator) public view returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev Transfers the ownership of a given token ID to another address
     * Usage of this method is discouraged, use `safeTransferFrom` whenever possible
     * Requires the msg sender to be the owner, approved, or operator
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
    */
    function transferFrom(address from, address to, uint256 tokenId) public {
        require(_isApprovedOrOwner(msg.sender, tokenId));

        _transferFrom(from, to, tokenId);
    }

    /**
     * @dev Safely transfers the ownership of a given token ID to another address
     * If the target address is a contract, it must implement `onERC721Received`,
     * which is called upon a safe transfer, and return the magic value
     * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
     * the transfer is reverted.
     *
     * Requires the msg sender to be the owner, approved, or operator
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
    */
    function safeTransferFrom(address from, address to, uint256 tokenId) public {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev Safely transfers the ownership of a given token ID to another address
     * If the target address is a contract, it must implement `onERC721Received`,
     * which is called upon a safe transfer, and return the magic value
     * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
     * the transfer is reverted.
     * Requires the msg sender to be the owner, approved, or operator
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes data to send along with a safe transfer check
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public {
        transferFrom(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data));
    }

    /**
     * @dev Returns whether the specified token exists
     * @param tokenId uint256 ID of the token to query the existence of
     * @return whether the token exists
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        address owner = _tokenOwner[tokenId];
        return owner != address(0);
    }

    /**
     * @dev Returns whether the given spender can transfer a given token ID
     * @param spender address of the spender to query
     * @param tokenId uint256 ID of the token to be transferred
     * @return bool whether the msg.sender is approved for the given token ID,
     *    is an operator of the owner, or is the owner of the token
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) {
        address owner = ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Internal function to mint a new token
     * Reverts if the given token ID already exists
     * @param to The address that will own the minted token
     * @param tokenId uint256 ID of the token to be minted
     */
    function _mint(address to, uint256 tokenId) internal {
        require(to != address(0));
        require(!_exists(tokenId));

        _tokenOwner[tokenId] = to;
        _ownedTokensCount[to] = _ownedTokensCount[to].add(1);

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

    /**
     * @dev Internal function to burn a specific token
     * Reverts if the token does not exist
     * Deprecated, use _burn(uint256) instead.
     * @param owner owner of the token to burn
     * @param tokenId uint256 ID of the token being burned
     */
    function _burn(address owner, uint256 tokenId) internal {
        require(ownerOf(tokenId) == owner);

        _clearApproval(tokenId);

        _ownedTokensCount[owner] = _ownedTokensCount[owner].sub(1);
        _tokenOwner[tokenId] = address(0);

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

    /**
     * @dev Internal function to burn a specific token
     * Reverts if the token does not exist
     * @param tokenId uint256 ID of the token being burned
     */
    function _burn(uint256 tokenId) internal {
        _burn(ownerOf(tokenId), tokenId);
    }

    /**
     * @dev Internal function to transfer ownership of a given token ID to another address.
     * As opposed to transferFrom, this imposes no restrictions on msg.sender.
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
    */
    function _transferFrom(address from, address to, uint256 tokenId) internal {
        require(ownerOf(tokenId) == from);
        require(to != address(0));

        _clearApproval(tokenId);

        _ownedTokensCount[from] = _ownedTokensCount[from].sub(1);
        _ownedTokensCount[to] = _ownedTokensCount[to].add(1);

        _tokenOwner[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Internal function to invoke `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 whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
        internal returns (bool)
    {
        if (!to.isContract()) {
            return true;
        }

        bytes4 retval = IERC721Receiver(to).onERC721Received(msg.sender, from, tokenId, _data);
        return (retval == _ERC721_RECEIVED);
    }

    /**
     * @dev Private function to clear current approval of a given token ID
     * @param tokenId uint256 ID of the token to be transferred
     */
    function _clearApproval(uint256 tokenId) private {
        if (_tokenApprovals[tokenId] != address(0)) {
            _tokenApprovals[tokenId] = address(0);
        }
    }
}

// File: contracts/NFTfi/v1/openzeppelin/IERC20.sol



/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
interface IERC20 {
    function transfer(address to, uint256 value) external returns (bool);

    function approve(address spender, uint256 value) external returns (bool);

    function transferFrom(address from, address to, uint256 value) external returns (bool);

    function totalSupply() external view returns (uint256);

    function balanceOf(address who) external view returns (uint256);

    function allowance(address owner, address spender) external view returns (uint256);

    event Transfer(address indexed from, address indexed to, uint256 value);

    event Approval(address indexed owner, address indexed spender, uint256 value);
}

// File: contracts/NFTfi/v1/NFTfi.sol

pragma solidity ^0.5.16;






// @title  Main contract for NFTfi. This contract manages the ability to create
//         NFT-backed peer-to-peer loans.
// @author smartcontractdev.eth, creator of wrappedkitties.eth, cwhelper.eth, and
//         kittybounties.eth
// @notice There are five steps needed to commence an NFT-backed loan. First,
//         the borrower calls nftContract.approveAll(NFTfi), approving the NFTfi
//         contract to move their NFT's on their behalf. Second, the borrower
//         signs an off-chain message for each NFT that they would like to
//         put up for collateral. This prevents borrowers from accidentally
//         lending an NFT that they didn't mean to lend, due to approveAll()
//         approving their entire collection. Third, the lender calls
//         erc20Contract.approve(NFTfi), allowing NFTfi to move the lender's
//         ERC20 tokens on their behalf. Fourth, the lender signs an off-chain
//         message, proposing the amount, rate, and duration of a loan for a
//         particular NFT. Fifth, the borrower calls NFTfi.beginLoan() to
//         accept these terms and enter into the loan. The NFT is stored in the
//         contract, the borrower receives the loan principal in the specified
//         ERC20 currency, and the lender receives an NFTfi promissory note (in
//         ERC721 form) that represents the rights to either the
//         principal-plus-interest, or the underlying NFT collateral if the
//         borrower does not pay back in time. The lender can freely transfer
//         and trade this ERC721 promissory note as they wish, with the
//         knowledge that transferring the ERC721 promissory note tranfsers the
//         rights to principal-plus-interest and/or collateral, and that they
//         will no longer have a claim on the loan. The ERC721 promissory note
//         itself represents that claim.
// @notice A loan may end in one of two ways. First, a borrower may call
//         NFTfi.payBackLoan() and pay back the loan plus interest at any time,
//         in which case they receive their NFT back in the same transaction.
//         Second, if the loan's duration has passed and the loan has not been
//         paid back yet, a lender can call NFTfi.liquidateOverdueLoan(), in
//         which case they receive the underlying NFT collateral and forfeit
//         the rights to the principal-plus-interest, which the borrower now
//         keeps.
// @notice If the loan was agreed to be a pro-rata interest loan, then the user
//         only pays the principal plus pro-rata interest if repaid early.
//         However, if the loan was agreed to be a fixed-repayment loan (by
//         specifying UINT32_MAX as the value for
//         loanInterestRateForDurationInBasisPoints), then the borrower pays
//         the maximumRepaymentAmount regardless of whether they repay early
//         or not.
contract NFTfi is NFTfiAdmin, NFTfiSigningUtils, ERC721 {

    // @notice OpenZeppelin's SafeMath library is used for all arithmetic
    //         operations to avoid overflows/underflows.
    using SafeMath for uint256;

    /* ********** */
    /* DATA TYPES */
    /* ********** */

    // @notice The main Loan struct. The struct fits in six 256-bits words due
    //         to Solidity's rules for struct packing.
    struct Loan {
        // A unique identifier for this particular loan, sourced from the
        // continuously increasing parameter totalNumLoans.
        uint256 loanId;
        // The original sum of money transferred from lender to borrower at the
        // beginning of the loan, measured in loanERC20Denomination's smallest
        // units.
        uint256 loanPrincipalAmount;
        // The maximum amount of money that the borrower would be required to
        // repay retrieve their collateral, measured in loanERC20Denomination's
        // smallest units. If interestIsProRated is set to false, then the
        // borrower will always have to pay this amount to retrieve their
        // collateral, regardless of whether they repay early.
        uint256 maximumRepaymentAmount;
        // The ID within the NFTCollateralContract for the NFT being used as
        // collateral for this loan. The NFT is stored within this contract
        // during the duration of the loan.
        uint256 nftCollateralId;
        // The block.timestamp when the loan first began (measured in seconds).
        uint64 loanStartTime;
        // The amount of time (measured in seconds) that can elapse before the
        // lender can liquidate the loan and seize the underlying collateral.
        uint32 loanDuration;
        // If interestIsProRated is set to true, then this is the interest rate
        // (measured in basis points, e.g. hundreths of a percent) for the loan,
        // that must be repaid pro-rata by the borrower at the conclusion of
        // the loan or risk seizure of their nft collateral. Note that if
        // interestIsProRated is set to false, then this value is not used and
        // is irrelevant.
        uint32 loanInterestRateForDurationInBasisPoints;
        // The percent (measured in basis points) of the interest earned that
        // will be taken as a fee by the contract admins when the loan is
        // repaid. The fee is stored here to prevent an attack where the
        // contract admins could adjust the fee right before a loan is repaid,
        // and take all of the interest earned.
        uint32 loanAdminFeeInBasisPoints;
        // The ERC721 contract of the NFT collateral
        address nftCollateralContract;
        // The ERC20 contract of the currency being used as principal/interest
        // for this loan.
        address loanERC20Denomination;
        // The address of the borrower.
        address borrower;
        // A boolean value determining whether the interest will be pro-rated
        // if the loan is repaid early, or whether the borrower will simply
        // pay maximumRepaymentAmount.
        bool interestIsProRated;
    }

    /* ****** */
    /* EVENTS */
    /* ****** */

    // @notice This event is fired whenever a borrower begins a loan by calling
    //         NFTfi.beginLoan(), which can only occur after both the lender
    //         and borrower have approved their ERC721 and ERC20 contracts to
    //         use NFTfi, and when they both have signed off-chain messages that
    //         agree on the terms of the loan.
    // @param  loanId - A unique identifier for this particular loan, sourced
    //         from the continuously increasing parameter totalNumLoans.
    // @param  borrower - The address of the borrower.
    // @param  lender - The address of the lender. The lender can change their
    //         address by transferring the NFTfi ERC721 token that they
    //         received when the loan began.
    // @param  loanPrincipalAmount - The original sum of money transferred from
    //         lender to borrower at the beginning of the loan, measured in
    //         loanERC20Denomination's smallest units.
    // @param  maximumRepaymentAmount - The maximum amount of money that the
    //         borrower would be required to retrieve their collateral. If
    //         interestIsProRated is set to false, then the borrower will
    //         always have to pay this amount to retrieve their collateral.
    // @param  nftCollateralId - The ID within the NFTCollateralContract for the
    //         NFT being used as collateral for this loan. The NFT is stored
    //         within this contract during the duration of the loan.
    // @param  loanStartTime - The block.timestamp when the loan first began
    //         (measured in seconds).
    // @param  loanDuration - The amount of time (measured in seconds) that can
    //         elapse before the lender can liquidate the loan and seize the
    //         underlying collateral NFT.
    // @param  loanInterestRateForDurationInBasisPoints - If interestIsProRated
    //         is set to true, then this is the interest rate (measured in
    //         basis points, e.g. hundreths of a percent) for the loan, that
    //         must be repaid pro-rata by the borrower at the conclusion of the
    //         loan or risk seizure of their nft collateral. Note that if
    //         interestIsProRated is set to false, then this value is not used
    //         and is irrelevant.
    // @param  nftCollateralContract - The ERC721 contract of the NFT collateral
    // @param  loanERC20Denomination - The ERC20 contract of the currency being
    //         used as principal/interest for this loan.
    // @param  interestIsProRated - A boolean value determining whether the
    //         interest will be pro-rated if the loan is repaid early, or
    //         whether the borrower will simply pay maximumRepaymentAmount.
    event LoanStarted(
        uint256 loanId,
        address borrower,
        address lender,
        uint256 loanPrincipalAmount,
        uint256 maximumRepaymentAmount,
        uint256 nftCollateralId,
        uint256 loanStartTime,
        uint256 loanDuration,
        uint256 loanInterestRateForDurationInBasisPoints,
        address nftCollateralContract,
        address loanERC20Denomination,
        bool interestIsProRated
    );

    // @notice This event is fired whenever a borrower successfully repays
    //         their loan, paying principal-plus-interest-minus-fee to the
    //         lender in loanERC20Denomination, paying fee to owner in
    //         loanERC20Denomination, and receiving their NFT collateral back.
    // @param  loanId - A unique identifier for this particular loan, sourced
    //         from the continuously increasing parameter totalNumLoans.
    // @param  borrower - The address of the borrower.
    // @param  lender - The address of the lender. The lender can change their
    //         address by transferring the NFTfi ERC721 token that they
    //         received when the loan began.
    // @param  loanPrincipalAmount - The original sum of money transferred from
    //         lender to borrower at the beginning of the loan, measured in
    //         loanERC20Denomination's smallest units.
    // @param  nftCollateralId - The ID within the NFTCollateralContract for the
    //         NFT being used as collateral for this loan. The NFT is stored
    //         within this contract during the duration of the loan.
    // @param  amountPaidToLender The amount of ERC20 that the borrower paid to
    //         the lender, measured in the smalled units of
    //         loanERC20Denomination.
    // @param  adminFee The amount of interest paid to the contract admins,
    //         measured in the smalled units of loanERC20Denomination and
    //         determined by adminFeeInBasisPoints. This amount never exceeds
    //         the amount of interest earned.
    // @param  nftCollateralContract - The ERC721 contract of the NFT collateral
    // @param  loanERC20Denomination - The ERC20 contract of the currency being
    //         used as principal/interest for this loan.
    event LoanRepaid(
        uint256 loanId,
        address borrower,
        address lender,
        uint256 loanPrincipalAmount,
        uint256 nftCollateralId,
        uint256 amountPaidToLender,
        uint256 adminFee,
        address nftCollateralContract,
        address loanERC20Denomination
    );

    // @notice This event is fired whenever a lender liquidates an outstanding
    //         loan that is owned to them that has exceeded its duration. The
    //         lender receives the underlying NFT collateral, and the borrower
    //         no longer needs to repay the loan principal-plus-interest.
    // @param  loanId - A unique identifier for this particular loan, sourced
    //         from the continuously increasing parameter totalNumLoans.
    // @param  borrower - The address of the borrower.
    // @param  lender - The address of the lender. The lender can change their
    //         address by transferring the NFTfi ERC721 token that they
    //         received when the loan began.
    // @param  loanPrincipalAmount - The original sum of money transferred from
    //         lender to borrower at the beginning of the loan, measured in
    //         loanERC20Denomination's smallest units.
    // @param  nftCollateralId - The ID within the NFTCollateralContract for the
    //         NFT being used as collateral for this loan. The NFT is stored
    //         within this contract during the duration of the loan.
    // @param  loanMaturityDate - The unix time (measured in seconds) that the
    //         loan became due and was eligible for liquidation.
    // @param  loanLiquidationDate - The unix time (measured in seconds) that
    //         liquidation occurred.
    // @param  nftCollateralContract - The ERC721 contract of the NFT collateral
    event LoanLiquidated(
        uint256 loanId,
        address borrower,
        address lender,
        uint256 loanPrincipalAmount,
        uint256 nftCollateralId,
        uint256 loanMaturityDate,
        uint256 loanLiquidationDate,
        address nftCollateralContract
    );


    /* ******* */
    /* STORAGE */
    /* ******* */

    // @notice A continuously increasing counter that simultaneously allows
    //         every loan to have a unique ID and provides a running count of
    //         how many loans have been started by this contract.
    uint256 public totalNumLoans = 0;

    // @notice A counter of the number of currently outstanding loans.
    uint256 public totalActiveLoans = 0;

    // @notice A mapping from a loan's identifier to the loan's details,
    //         represted by the loan struct. To fetch the lender, call
    //         NFTfi.ownerOf(loanId).
    mapping (uint256 => Loan) public loanIdToLoan;

    // @notice A mapping tracking whether a loan has either been repaid or
    //         liquidated. This prevents an attacker trying to repay or
    //         liquidate the same loan twice.
    mapping (uint256 => bool) public loanRepaidOrLiquidated;

    // @notice A mapping that takes both a user's address and a loan nonce
    //         that was first used when signing an off-chain order and checks
    //         whether that nonce has previously either been used for a loan,
    //         or has been pre-emptively cancelled. The nonce referred to here
    //         is not the same as an Ethereum account's nonce. We are referring
    //         instead to nonces that are used by both the lender and the
    //         borrower when they are first signing off-chain NFTfi orders.
    //         These nonces can be any uint256 value that the user has not
    //         previously used to sign an off-chain order. Each nonce can be
    //         used at most once per user within NFTfi, regardless of whether
    //         they are the lender or the borrower in that situation. This
    //         serves two purposes. First, it prevents replay attacks where an
    //         attacker would submit a user's off-chain order more than once.
    //         Second, it allows a user to cancel an off-chain order by calling
    //         NFTfi.cancelLoanCommitmentBeforeLoanHasBegun(), which marks the
    //         nonce as used and prevents any future loan from using the user's
    //         off-chain order that contains that nonce.
    mapping (address => mapping (uint256 => bool)) private _nonceHasBeenUsedForUser;

    /* *********** */
    /* CONSTRUCTOR */
    /* *********** */

    constructor() public {}

    /* ********* */
    /* FUNCTIONS */
    /* ********* */

    // @notice This function is called by a borrower when they want to commence
    //         a loan, but can only be called after first: (1) the borrower has
    //         called approve() or approveAll() on the NFT contract for the NFT
    //         that will be used as collateral, (2) the borrower has signed an
    //         off-chain message indicating that they are willing to use this
    //         NFT as collateral, (3) the lender has called approve() on the
    //         ERC20 contract of the principal, and (4) the lender has signed
    //         an off-chain message agreeing to the terms of this loan supplied
    //         in this transaction.
    // @notice Note that a user may submit UINT32_MAX as the value for
    //         _loanInterestRateForDurationInBasisPoints to indicate that they
    //         wish to take out a fixed-repayment loan, where the interest is
    //         not pro-rated if repaid early.
    // @param  _loanPrincipalAmount - The original sum of money transferred
    //         from lender to borrower at the beginning of the loan, measured
    //         in loanERC20Denomination's smallest units.
    // @param  _maximumRepaymentAmount - The maximum amount of money that the
    //         borrower would be required to retrieve their collateral,
    //         measured in the smallest units of the ERC20 currency used for
    //         the loan. If interestIsProRated is set to false (by submitting
    //         a value of UINT32_MAX for
    //         _loanInterestRateForDurationInBasisPoints), then the borrower
    //         will always have to pay this amount to retrieve their
    //         collateral, regardless of whether they repay early.
    // @param  _nftCollateralId - The ID within the NFTCollateralContract for
    //         the NFT being used as collateral for this loan. The NFT is
    //         stored within this contract during the duration of the loan.
    // @param  _loanDuration - The amount of time (measured in seconds) that can
    //         elapse before the lender can liquidate the loan and seize the
    //         underlying collateral NFT.
    // @param  _loanInterestRateForDurationInBasisPoints - The interest rate
    //         (measured in basis points, e.g. hundreths of a percent) for the
    //         loan, that must be repaid pro-rata by the borrower at the
    //         conclusion of the loan or risk seizure of their nft collateral.
    //         However, a user may submit UINT32_MAX as the value for
    //         _loanInterestRateForDurationInBasisPoints to indicate that they
    //         wish to take out a fixed-repayment loan, where the interest is
    //         not pro-rated if repaid early. Instead, maximumRepaymentAmount
    //         will always be the amount to be repaid.
    // @param  _adminFeeInBasisPoints - The percent (measured in basis
    //         points) of the interest earned that will be taken as a fee by
    //         the contract admins when the loan is repaid. The fee is stored
    //         in the loan struct to prevent an attack where the contract
    //         admins could adjust the fee right before a loan is repaid, and
    //         take all of the interest earned.
    // @param  _borrowerAndLenderNonces - An array of two UINT256 values, the
    //         first of which is the _borrowerNonce and the second of which is
    //         the _lenderNonce. The nonces referred to here are not the same
    //         as an Ethereum account's nonce. We are referring instead to
    //         nonces that are used by both the lender and the borrower when
    //         they are first signing off-chain NFTfi orders. These nonces can
    //         be any uint256 value that the user has not previously used to
    //         sign an off-chain order. Each nonce can be used at most once per
    //         user within NFTfi, regardless of whether they are the lender or
    //         the borrower in that situation. This serves two purposes. First,
    //         it prevents replay attacks where an attacker would submit a
    //         user's off-chain order more than once. Second, it allows a user
    //         to cancel an off-chain order by calling
    //         NFTfi.cancelLoanCommitmentBeforeLoanHasBegun(), which marks the
    //         nonce as used and prevents any future loan from using the user's
    //         off-chain order that contains that nonce.
    // @param  _nftCollateralContract - The address of the ERC721 contract of
    //         the NFT collateral.
    // @param  _loanERC20Denomination - The address of the ERC20 contract of
    //         the currency being used as principal/interest for this loan.
    // @param  _lender - The address of the lender. The lender can change their
    //         address by transferring the NFTfi ERC721 token that they
    //         received when the loan began.
    // @param  _borrowerSignature - The ECDSA signature of the borrower,
    //         obtained off-chain ahead of time, signing the following
    //         combination of parameters: _nftCollateralId, _borrowerNonce,
    //         _nftCollateralContract, _borrower.
    // @param  _lenderSignature - The ECDSA signature of the lender,
    //         obtained off-chain ahead of time, signing the following
    //         combination of parameters: _loanPrincipalAmount,
    //         _maximumRepaymentAmount _nftCollateralId, _loanDuration,
    //         _loanInterestRateForDurationInBasisPoints, _lenderNonce,
    //         _nftCollateralContract, _loanERC20Denomination, _lender,
    //         _interestIsProRated.
    function beginLoan(
        uint256 _loanPrincipalAmount,
        uint256 _maximumRepaymentAmount,
        uint256 _nftCollateralId,
        uint256 _loanDuration,
        uint256 _loanInterestRateForDurationInBasisPoints,
        uint256 _adminFeeInBasisPoints,
        uint256[2] memory _borrowerAndLenderNonces,
        address _nftCollateralContract,
        address _loanERC20Denomination,
        address _lender,
        bytes memory _borrowerSignature,
        bytes memory _lenderSignature
    ) public whenNotPaused nonReentrant {

        // Save loan details to a struct in memory first, to save on gas if any
        // of the below checks fail, and to avoid the "Stack Too Deep" error by
        // clumping the parameters together into one struct held in memory.
        Loan memory loan = Loan({
            loanId: totalNumLoans, //currentLoanId,
            loanPrincipalAmount: _loanPrincipalAmount,
            maximumRepaymentAmount: _maximumRepaymentAmount,
            nftCollateralId: _nftCollateralId,
            loanStartTime: uint64(now), //_loanStartTime
            loanDuration: uint32(_loanDuration),
            loanInterestRateForDurationInBasisPoints: uint32(_loanInterestRateForDurationInBasisPoints),
            loanAdminFeeInBasisPoints: uint32(_adminFeeInBasisPoints),
            nftCollateralContract: _nftCollateralContract,
            loanERC20Denomination: _loanERC20Denomination,
            borrower: msg.sender, //borrower
            interestIsProRated: (_loanInterestRateForDurationInBasisPoints != ~(uint32(0)))
        });

        // Sanity check loan values.
        require(loan.maximumRepaymentAmount >= loan.loanPrincipalAmount, 'Negative interest rate loans are not allowed.');
        require(uint256(loan.loanDuration) <= maximumLoanDuration, 'Loan duration exceeds maximum loan duration');
        require(uint256(loan.loanDuration) != 0, 'Loan duration cannot be zero');
        require(uint256(loan.loanAdminFeeInBasisPoints) == adminFeeInBasisPoints, 'The admin fee has changed since this order was signed.');

        // Check that both the collateral and the principal come from supported
        // contracts.
        require(erc20CurrencyIsWhitelisted[loan.loanERC20Denomination], 'Currency denomination is not whitelisted to be used by this contract');
        require(nftContractIsWhitelisted[loan.nftCollateralContract], 'NFT collateral contract is not whitelisted to be used by this contract');

        // Check loan nonces. These are different from Ethereum account nonces.
        // Here, these are uint256 numbers that should uniquely identify
        // each signature for each user (i.e. each user should only create one
        // off-chain signature for each nonce, with a nonce being any arbitrary
        // uint256 value that they have not used yet for an off-chain NFTfi
        // signature).
        require(!_nonceHasBeenUsedForUser[msg.sender][_borrowerAndLenderNonces[0]], 'Borrower nonce invalid, borrower has either cancelled/begun this loan, or reused this nonce when signing');
        _nonceHasBeenUsedForUser[msg.sender][_borrowerAndLenderNonces[0]] = true;
        require(!_nonceHasBeenUsedForUser[_lender][_borrowerAndLenderNonces[1]], 'Lender nonce invalid, lender has either cancelled/begun this loan, or reused this nonce when signing');
        _nonceHasBeenUsedForUser[_lender][_borrowerAndLenderNonces[1]] = true;

        // Check that both signatures are valid.
        require(isValidBorrowerSignature(
            loan.nftCollateralId,
            _borrowerAndLenderNonces[0],//_borrowerNonce,
            loan.nftCollateralContract,
            msg.sender,      //borrower,
            _borrowerSignature
        ), 'Borrower signature is invalid');
        require(isValidLenderSignature(
            loan.loanPrincipalAmount,
            loan.maximumRepaymentAmount,
            loan.nftCollateralId,
            loan.loanDuration,
            loan.loanInterestRateForDurationInBasisPoints,
            loan.loanAdminFeeInBasisPoints,
            _borrowerAndLenderNonces[1],//_lenderNonce,
            loan.nftCollateralContract,
            loan.loanERC20Denomination,
            _lender,
            loan.interestIsProRated,
            _lenderSignature
        ), 'Lender signature is invalid');

        // Add the loan to storage before moving collateral/principal to follow
        // the Checks-Effects-Interactions pattern.
        loanIdToLoan[totalNumLoans] = loan;
        totalNumLoans = totalNumLoans.add(1);

        // Update number of active loans.
        totalActiveLoans = totalActiveLoans.add(1);
        require(totalActiveLoans <= maximumNumberOfActiveLoans, 'Contract has reached the maximum number of active loans allowed by admins');

        // Transfer collateral from borrower to this contract to be held until
        // loan completion.
        IERC721(loan.nftCollateralContract).transferFrom(msg.sender, address(this), loan.nftCollateralId);

        // Transfer principal from lender to borrower.
        IERC20(loan.loanERC20Denomination).transferFrom(_lender, msg.sender, loan.loanPrincipalAmount);

        // Issue an ERC721 promissory note to the lender that gives them the
        // right to either the principal-plus-interest or the collateral.
        _mint(_lender, loan.loanId);

        // Emit an event with all relevant details from this transaction.
        emit LoanStarted(
            loan.loanId,
            msg.sender,      //borrower,
            _lender,
            loan.loanPrincipalAmount,
            loan.maximumRepaymentAmount,
            loan.nftCollateralId,
            now,             //_loanStartTime
            loan.loanDuration,
            loan.loanInterestRateForDurationInBasisPoints,
            loan.nftCollateralContract,
            loan.loanERC20Denomination,
            loan.interestIsProRated
        );
    }

    // @notice This function is called by a borrower when they want to repay
    //         their loan. It can be called at any time after the loan has
    //         begun. The borrower will pay a pro-rata portion of their
    //         interest if the loan is paid off early. The interest will
    //         continue to accrue after the loan has expired. This function can
    //         continue to be called by the borrower even after the loan has
    //         expired to retrieve their NFT. Note that the lender can call
    //         NFTfi.liquidateOverdueLoan() at any time after the loan has
    //         expired, so a borrower should avoid paying their loan after the
    //         due date, as they risk their collateral being seized. However,
    //         if a lender has called NFTfi.liquidateOverdueLoan() before a
    //         borrower could call NFTfi.payBackLoan(), the borrower will get
    //         to keep the principal-plus-interest.
    // @notice This function is purposefully not pausable in order to prevent
    //         an attack where the contract admin's pause the contract and hold
    //         hostage the NFT's that are still within it.
    // @param _loanId  A unique identifier for this particular loan, sourced
    //        from the continuously increasing parameter totalNumLoans.
    function payBackLoan(uint256 _loanId) external nonReentrant {
        // Sanity check that payBackLoan() and liquidateOverdueLoan() have
        // never been called on this loanId. Depending on how the rest of the
        // code turns out, this check may be unnecessary.
        require(!loanRepaidOrLiquidated[_loanId], 'Loan has already been repaid or liquidated');

        // Fetch loan details from storage, but store them in memory for the
        // sake of saving gas.
        Loan memory loan = loanIdToLoan[_loanId];

        // Check that the borrower is the caller, only the borrower is entitled
        // to the collateral.
        require(msg.sender == loan.borrower, 'Only the borrower can pay back a loan and reclaim the underlying NFT');

        // Fetch current owner of loan promissory note.
        address lender = ownerOf(_loanId);

        // Calculate amounts to send to lender and admins
        uint256 interestDue = (loan.maximumRepaymentAmount).sub(loan.loanPrincipalAmount);
        if(loan.interestIsProRated == true){
            interestDue = _computeInterestDue(
                loan.loanPrincipalAmount,
                loan.maximumRepaymentAmount,
                now.sub(uint256(loan.loanStartTime)),
                uint256(loan.loanDuration),
                uint256(loan.loanInterestRateForDurationInBasisPoints)
            );
        }
        uint256 adminFee = _computeAdminFee(interestDue, uint256(loan.loanAdminFeeInBasisPoints));
        uint256 payoffAmount = ((loan.loanPrincipalAmount).add(interestDue)).sub(adminFee);

        // Mark loan as repaid before doing any external transfers to follow
        // the Checks-Effects-Interactions design pattern.
        loanRepaidOrLiquidated[_loanId] = true;

        // Update number of active loans.
        totalActiveLoans = totalActiveLoans.sub(1);

        // Transfer principal-plus-interest-minus-fees from borrower to lender
        IERC20(loan.loanERC20Denomination).transferFrom(loan.borrower, lender, payoffAmount);

        // Transfer fees from borrower to admins
        IERC20(loan.loanERC20Denomination).transferFrom(loan.borrower, owner(), adminFee);

        // Transfer collateral from this contract to borrower.
        require(_transferNftToAddress(
            loan.nftCollateralContract,
            loan.nftCollateralId,
            loan.borrower
        ), 'NFT was not successfully transferred');

        // Destroy the lender's promissory note.
        _burn(_loanId);

        // Emit an event with all relevant details from this transaction.
        emit LoanRepaid(
            _loanId,
            loan.borrower,
            lender,
            loan.loanPrincipalAmount,
            loan.nftCollateralId,
            payoffAmount,
            adminFee,
            loan.nftCollateralContract,
            loan.loanERC20Denomination
        );

        // Delete the loan from storage in order to achieve a substantial gas
        // savings and to lessen the burden of storage on Ethereum nodes, since
        // we will never access this loan's details again, and the details are
        // still available through event data.
        delete loanIdToLoan[_loanId];
    }

    // @notice This function is called by a lender once a loan has finished its
    //         duration and the borrower still has not repaid. The lender
    //         can call this function to seize the underlying NFT collateral,
    //         although the lender gives up all rights to the
    //         principal-plus-collateral by doing so.
    // @notice This function is purposefully not pausable in order to prevent
    //         an attack where the contract admin's pause the contract and hold
    //         hostage the NFT's that are still within it.
    // @notice We intentionally allow anybody to call this function, although
    //         only the lender will end up receiving the seized collateral. We
    //         are exploring the possbility of incentivizing users to call this
    //         function by using some of the admin funds.
    // @param _loanId  A unique identifier for this particular loan, sourced
    //        from the continuously increasing parameter totalNumLoans.
    function liquidateOverdueLoan(uint256 _loanId) external nonReentrant {
        // Sanity check that payBackLoan() and liquidateOverdueLoan() have
        // never been called on this loanId. Depending on how the rest of the
        // code turns out, this check may be unnecessary.
        require(!loanRepaidOrLiquidated[_loanId], 'Loan has already been repaid or liquidated');

        // Fetch loan details from storage, but store them in memory for the
        // sake of saving gas.
        Loan memory loan = loanIdToLoan[_loanId];

        // Ensure that the loan is indeed overdue, since we can only liquidate
        // overdue loans.
        uint256 loanMaturityDate = (uint256(loan.loanStartTime)).add(uint256(loan.loanDuration));
        require(now > loanMaturityDate, 'Loan is not overdue yet');

        // Fetch the current lender of the promissory note corresponding to
        // this overdue loan.
        address lender = ownerOf(_loanId);

        // Mark loan as liquidated before doing any external transfers to
        // follow the Checks-Effects-Interactions design pattern.
        loanRepaidOrLiquidated[_loanId] = true;

        // Update number of active loans.
        totalActiveLoans = totalActiveLoans.sub(1);

        // Transfer collateral from this contract to the lender, since the
        // lender is seizing collateral for an overdue loan.
        require(_transferNftToAddress(
            loan.nftCollateralContract,
            loan.nftCollateralId,
            lender
        ), 'NFT was not successfully transferred');

        // Destroy the lender's promissory note for this loan, since by seizing
        // the collateral, the lender has forfeit the rights to the loan
        // principal-plus-interest.
        _burn(_loanId);

        // Emit an event with all relevant details from this transaction.
        emit LoanLiquidated(
            _loanId,
            loan.borrower,
            lender,
            loan.loanPrincipalAmount,
            loan.nftCollateralId,
            loanMaturityDate,
            now,
            loan.nftCollateralContract
        );

        // Delete the loan from storage in order to achieve a substantial gas
        // savings and to lessen the burden of storage on Ethereum nodes, since
        // we will never access this loan's details again, and the details are
        // still available through event data.
        delete loanIdToLoan[_loanId];
    }

    // @notice This function can be called by either a lender or a borrower to
    //         cancel all off-chain orders that they have signed that contain
    //         this nonce. If the off-chain orders were created correctly,
    //         there should only be one off-chain order that contains this
    //         nonce at all.
    // @param  _nonce - The nonce referred to here is not the same as an
    //         Ethereum account's nonce. We are referring instead to nonces
    //         that are used by both the lender and the borrower when they are
    //         first signing off-chain NFTfi orders. These nonces can be any
    //         uint256 value that the user has not previously used to sign an
    //         off-chain order. Each nonce can be used at most once per user
    //         within NFTfi, regardless of whether they are the lender or the
    //         borrower in that situation. This serves two purposes. First, it
    //         prevents replay attacks where an attacker would submit a user's
    //         off-chain order more than once. Second, it allows a user to
    //         cancel an off-chain order by calling
    //         NFTfi.cancelLoanCommitmentBeforeLoanHasBegun(), which marks the
    //         nonce as used and prevents any future loan from using the user's
    //         off-chain order that contains that nonce.
    function cancelLoanCommitmentBeforeLoanHasBegun(uint256 _nonce) external {
        require(!_nonceHasBeenUsedForUser[msg.sender][_nonce], 'Nonce invalid, user has either cancelled/begun this loan, or reused a nonce when signing');
        _nonceHasBeenUsedForUser[msg.sender][_nonce] = true;
    }

    /* ******************* */
    /* READ-ONLY FUNCTIONS */
    /* ******************* */

    // @notice This function can be used to view the current quantity of the
    //         ERC20 currency used in the specified loan required by the
    //         borrower to repay their loan, measured in the smallest unit of
    //         the ERC20 currency. Note that since interest accrues every
    //         second, once a borrower calls repayLoan(), the amount will have
    //         increased slightly.
    // @param  _loanId  A unique identifier for this particular loan, sourced
    //         from the continuously increasing parameter totalNumLoans.
    // @return The amount of the specified ERC20 currency required to pay back
    //         this loan, measured in the smallest unit of the specified ERC20
    //         currency.
    function getPayoffAmount(uint256 _loanId) public view returns (uint256) {
        Loan storage loan = loanIdToLoan[_loanId];
        if(loan.interestIsProRated == false){
            return loan.maximumRepaymentAmount;
        } else {
            uint256 loanDurationSoFarInSeconds = now.sub(uint256(loan.loanStartTime));
            uint256 interestDue = _computeInterestDue(loan.loanPrincipalAmount, loan.maximumRepaymentAmount, loanDurationSoFarInSeconds, uint256(loan.loanDuration), uint256(loan.loanInterestRateForDurationInBasisPoints));
            return (loan.loanPrincipalAmount).add(interestDue);
        }
    }

    // @notice This function can be used to view whether a particular nonce
    //         for a particular user has already been used, either from a
    //         successful loan or a cancelled off-chain order.
    // @param  _user - The address of the user. This function works for both
    //         lenders and borrowers alike.
    // @param  _nonce - The nonce referred to here is not the same as an
    //         Ethereum account's nonce. We are referring instead to nonces
    //         that are used by both the lender and the borrower when they are
    //         first signing off-chain NFTfi orders. These nonces can be any
    //         uint256 value that the user has not previously used to sign an
    //         off-chain order. Each nonce can be used at most once per user
    //         within NFTfi, regardless of whether they are the lender or the
    //         borrower in that situation. This serves two purposes. First, it
    //         prevents replay attacks where an attacker would submit a user's
    //         off-chain order more than once. Second, it allows a user to
    //         cancel an off-chain order by calling
    //         NFTfi.cancelLoanCommitmentBeforeLoanHasBegun(), which marks the
    //         nonce as used and prevents any future loan from using the user's
    //         off-chain order that contains that nonce.
    // @return A bool representing whether or not this nonce has been used for
    //         this user.
    function getWhetherNonceHasBeenUsedForUser(address _user, uint256 _nonce) public view returns (bool) {
        return _nonceHasBeenUsedForUser[_user][_nonce];
    }

    /* ****************** */
    /* INTERNAL FUNCTIONS */
    /* ****************** */

    // @notice A convenience function that calculates the amount of interest
    //         currently due for a given loan. The interest is capped at
    //         _maximumRepaymentAmount minus _loanPrincipalAmount.
    // @param  _loanPrincipalAmount - The total quantity of principal first
    //         loaned to the borrower, measured in the smallest units of the
    //         ERC20 currency used for the loan.
    // @param  _maximumRepaymentAmount - The maximum amount of money that the
    //         borrower would be required to retrieve their collateral. If
    //         interestIsProRated is set to false, then the borrower will
    //         always have to pay this amount to retrieve their collateral.
    // @param  _loanDurationSoFarInSeconds - The elapsed time (in seconds) that
    //         has occurred so far since the loan began until repayment.
    // @param  _loanTotalDurationAgreedTo - The original duration that the
    //         borrower and lender agreed to, by which they measured the
    //         interest that would be due.
    // @param  _loanInterestRateForDurationInBasisPoints - The interest rate
    ///        that the borrower and lender agreed would be due after the
    //         totalDuration passed.
    // @return The quantity of interest due, measured in the smallest units of
    //         the ERC20 currency used to pay this loan.
    function _computeInterestDue(uint256 _loanPrincipalAmount, uint256 _maximumRepaymentAmount, uint256 _loanDurationSoFarInSeconds, uint256 _loanTotalDurationAgreedTo, uint256 _loanInterestRateForDurationInBasisPoints) internal pure returns (uint256) {
        uint256 interestDueAfterEntireDuration = (_loanPrincipalAmount.mul(_loanInterestRateForDurationInBasisPoints)).div(uint256(10000));
        uint256 interestDueAfterElapsedDuration = (interestDueAfterEntireDuration.mul(_loanDurationSoFarInSeconds)).div(_loanTotalDurationAgreedTo);
        if(_loanPrincipalAmount.add(interestDueAfterElapsedDuration) > _maximumRepaymentAmount){
            return _maximumRepaymentAmount.sub(_loanPrincipalAmount);
        } else {
            return interestDueAfterElapsedDuration;
        }
    }

    // @notice A convenience function computing the adminFee taken from a
    //         specified quantity of interest
    // @param  _interestDue - The amount of interest due, measured in the
    //         smallest quantity of the ERC20 currency being used to pay the
    //         interest.
    // @param  _adminFeeInBasisPoints - The percent (measured in basis
    //         points) of the interest earned that will be taken as a fee by
    //         the contract admins when the loan is repaid. The fee is stored
    //         in the loan struct to prevent an attack where the contract
    //         admins could adjust the fee right before a loan is repaid, and
    //         take all of the interest earned.
    // @return The quantity of ERC20 currency (measured in smalled units of
    //         that ERC20 currency) that is due as an admin fee.
    function _computeAdminFee(uint256 _interestDue, uint256 _adminFeeInBasisPoints) internal pure returns (uint256) {
    	return (_interestDue.mul(_adminFeeInBasisPoints)).div(10000);
    }

    // @notice We call this function when we wish to transfer an NFT from our
    //         contract to another destination. Since some prominent NFT
    //         contracts do not conform to the same standard, we try multiple
    //         variations on transfer/transferFrom, and check whether any
    //         succeeded.
    // @notice Some nft contracts will not allow you to approve your own
    //         address or do not allow you to call transferFrom() when you are
    //         the sender, (for example, CryptoKitties does not allow you to),
    //         while other nft contracts do not implement transfer() (since it
    //         is not part of the official ERC721 standard but is implemented
    //         in some prominent nft projects such as Cryptokitties), so we
    //         must try calling transferFrom() and transfer(), and see if one
    //         succeeds.
    // @param  _nftContract - The NFT contract that we are attempting to
    //         transfer an NFT from.
    // @param  _nftId - The ID of the NFT that we are attempting to transfer.
    // @param  _recipient - The destination of the NFT that we are attempting
    //         to transfer.
    // @return A bool value indicating whether the transfer attempt succeeded.
    function _transferNftToAddress(address _nftContract, uint256 _nftId, address _recipient) internal returns (bool) {
        // Try to call transferFrom()
        bool transferFromSucceeded = _attemptTransferFrom(_nftContract, _nftId, _recipient);
        if(transferFromSucceeded){
            return true;
        } else {
            // Try to call transfer()
            bool transferSucceeded = _attemptTransfer(_nftContract, _nftId, _recipient);
            return transferSucceeded;
        }
    }

    // @notice This function attempts to call transferFrom() on the specified
    //         NFT contract, returning whether it succeeded.
    // @notice We only call this function from within _transferNftToAddress(),
    //         which is function attempts to call the various ways that
    //         different NFT contracts have implemented transfer/transferFrom.
    // @param  _nftContract - The NFT contract that we are attempting to
    //         transfer an NFT from.
    // @param  _nftId - The ID of the NFT that we are attempting to transfer.
    // @param  _recipient - The destination of the NFT that we are attempting
    //         to transfer.
    // @return A bool value indicating whether the transfer attempt succeeded.
    function _attemptTransferFrom(address _nftContract, uint256 _nftId, address _recipient) internal returns (bool) {
        // @notice Some NFT contracts will not allow you to approve an NFT that
        //         you own, so we cannot simply call approve() here, we have to
        //         try to call it in a manner that allows the call to fail.
        _nftContract.call(abi.encodeWithSelector(IERC721(_nftContract).approve.selector, address(this), _nftId));

        // @notice Some NFT contracts will not allow you to call transferFrom()
        //         for an NFT that you own but that is not approved, so we
        //         cannot simply call transferFrom() here, we have to try to
        //         call it in a manner that allows the call to fail.
        (bool success, ) = _nftContract.call(abi.encodeWithSelector(IERC721(_nftContract).transferFrom.selector, address(this), _recipient, _nftId));
        return success;
    }

    // @notice This function attempts to call transfer() on the specified
    //         NFT contract, returning whether it succeeded.
    // @notice We only call this function from within _transferNftToAddress(),
    //         which is function attempts to call the various ways that
    //         different NFT contracts have implemented transfer/transferFrom.
    // @param  _nftContract - The NFT contract that we are attempting to
    //         transfer an NFT from.
    // @param  _nftId - The ID of the NFT that we are attempting to transfer.
    // @param  _recipient - The destination of the NFT that we are attempting
    //         to transfer.
    // @return A bool value indicating whether the transfer attempt succeeded.
    function _attemptTransfer(address _nftContract, uint256 _nftId, address _recipient) internal returns (bool) {
        // @notice Some NFT contracts do not implement transfer(), since it is
        //         not a part of the official ERC721 standard, but many
        //         prominent NFT projects do implement it (such as
        //         Cryptokitties), so we cannot simply call transfer() here, we
        //         have to try to call it in a manner that allows the call to
        //         fail.
        (bool success, ) = _nftContract.call(abi.encodeWithSelector(ICryptoKittiesCore(_nftContract).transfer.selector, _recipient, _nftId));
        return success;
    }

    /* ***************** */
    /* FALLBACK FUNCTION */
    /* ***************** */

    // @notice By calling 'revert' in the fallback function, we prevent anyone
    //         from accidentally sending funds directly to this contract.
    function() external payable {
        revert();
    }
}

// @notice The interface for interacting with the CryptoKitties contract. We
//         include this special case because CryptoKitties is one of the most
//         used NFT contracts on Ethereum and will likely be used by NFTfi, but
//         it does not perfectly abide by the ERC721 standard, since it preceded
//         the official standardization of ERC721.
contract ICryptoKittiesCore {
    function transfer(address _to, uint256 _tokenId) external;
}

Contract Security Audit

Contract ABI

[{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newAdminFee","type":"uint256"}],"name":"AdminFeeUpdated","type":"event"},{"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":"uint256","name":"loanId","type":"uint256"},{"indexed":false,"internalType":"address","name":"borrower","type":"address"},{"indexed":false,"internalType":"address","name":"lender","type":"address"},{"indexed":false,"internalType":"uint256","name":"loanPrincipalAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nftCollateralId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"loanMaturityDate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"loanLiquidationDate","type":"uint256"},{"indexed":false,"internalType":"address","name":"nftCollateralContract","type":"address"}],"name":"LoanLiquidated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"loanId","type":"uint256"},{"indexed":false,"internalType":"address","name":"borrower","type":"address"},{"indexed":false,"internalType":"address","name":"lender","type":"address"},{"indexed":false,"internalType":"uint256","name":"loanPrincipalAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nftCollateralId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountPaidToLender","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"adminFee","type":"uint256"},{"indexed":false,"internalType":"address","name":"nftCollateralContract","type":"address"},{"indexed":false,"internalType":"address","name":"loanERC20Denomination","type":"address"}],"name":"LoanRepaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"loanId","type":"uint256"},{"indexed":false,"internalType":"address","name":"borrower","type":"address"},{"indexed":false,"internalType":"address","name":"lender","type":"address"},{"indexed":false,"internalType":"uint256","name":"loanPrincipalAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maximumRepaymentAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nftCollateralId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"loanStartTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"loanDuration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"loanInterestRateForDurationInBasisPoints","type":"uint256"},{"indexed":false,"internalType":"address","name":"nftCollateralContract","type":"address"},{"indexed":false,"internalType":"address","name":"loanERC20Denomination","type":"address"},{"indexed":false,"internalType":"bool","name":"interestIsProRated","type":"bool"}],"name":"LoanStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"PauserAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"PauserRemoved","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":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addPauser","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"adminFeeInBasisPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_loanPrincipalAmount","type":"uint256"},{"internalType":"uint256","name":"_maximumRepaymentAmount","type":"uint256"},{"internalType":"uint256","name":"_nftCollateralId","type":"uint256"},{"internalType":"uint256","name":"_loanDuration","type":"uint256"},{"internalType":"uint256","name":"_loanInterestRateForDurationInBasisPoints","type":"uint256"},{"internalType":"uint256","name":"_adminFeeInBasisPoints","type":"uint256"},{"internalType":"uint256[2]","name":"_borrowerAndLenderNonces","type":"uint256[2]"},{"internalType":"address","name":"_nftCollateralContract","type":"address"},{"internalType":"address","name":"_loanERC20Denomination","type":"address"},{"internalType":"address","name":"_lender","type":"address"},{"internalType":"bytes","name":"_borrowerSignature","type":"bytes"},{"internalType":"bytes","name":"_lenderSignature","type":"bytes"}],"name":"beginLoan","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_nonce","type":"uint256"}],"name":"cancelLoanCommitmentBeforeLoanHasBegun","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"erc20CurrencyIsWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getChainID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"_loanId","type":"uint256"}],"name":"getPayoffAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_nonce","type":"uint256"}],"name":"getWhetherNonceHasBeenUsedForUser","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isPauser","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"_nftCollateralId","type":"uint256"},{"internalType":"uint256","name":"_borrowerNonce","type":"uint256"},{"internalType":"address","name":"_nftCollateralContract","type":"address"},{"internalType":"address","name":"_borrower","type":"address"},{"internalType":"bytes","name":"_borrowerSignature","type":"bytes"}],"name":"isValidBorrowerSignature","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"_loanPrincipalAmount","type":"uint256"},{"internalType":"uint256","name":"_maximumRepaymentAmount","type":"uint256"},{"internalType":"uint256","name":"_nftCollateralId","type":"uint256"},{"internalType":"uint256","name":"_loanDuration","type":"uint256"},{"internalType":"uint256","name":"_loanInterestRateForDurationInBasisPoints","type":"uint256"},{"internalType":"uint256","name":"_adminFeeInBasisPoints","type":"uint256"},{"internalType":"uint256","name":"_lenderNonce","type":"uint256"},{"internalType":"address","name":"_nftCollateralContract","type":"address"},{"internalType":"address","name":"_loanERC20Denomination","type":"address"},{"internalType":"address","name":"_lender","type":"address"},{"internalType":"bool","name":"_interestIsProRated","type":"bool"},{"internalType":"bytes","name":"_lenderSignature","type":"bytes"}],"name":"isValidLenderSignature","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_loanId","type":"uint256"}],"name":"liquidateOverdueLoan","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"loanIdToLoan","outputs":[{"internalType":"uint256","name":"loanId","type":"uint256"},{"internalType":"uint256","name":"loanPrincipalAmount","type":"uint256"},{"internalType":"uint256","name":"maximumRepaymentAmount","type":"uint256"},{"internalType":"uint256","name":"nftCollateralId","type":"uint256"},{"internalType":"uint64","name":"loanStartTime","type":"uint64"},{"internalType":"uint32","name":"loanDuration","type":"uint32"},{"internalType":"uint32","name":"loanInterestRateForDurationInBasisPoints","type":"uint32"},{"internalType":"uint32","name":"loanAdminFeeInBasisPoints","type":"uint32"},{"internalType":"address","name":"nftCollateralContract","type":"address"},{"internalType":"address","name":"loanERC20Denomination","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"bool","name":"interestIsProRated","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"loanRepaidOrLiquidated","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maximumLoanDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maximumNumberOfActiveLoans","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nftContractIsWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_loanId","type":"uint256"}],"name":"payBackLoan","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renouncePauser","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"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":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"totalActiveLoans","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalNumLoans","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_newAdminFeeInBasisPoints","type":"uint256"}],"name":"updateAdminFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_newMaximumLoanDuration","type":"uint256"}],"name":"updateMaximumLoanDuration","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_newMaximumNumberOfActiveLoans","type":"uint256"}],"name":"updateMaximumNumberOfActiveLoans","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_erc20Currency","type":"address"},{"internalType":"bool","name":"_setAsWhitelisted","type":"bool"}],"name":"whitelistERC20Currency","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_nftContract","type":"address"},{"internalType":"bool","name":"_setAsWhitelisted","type":"bool"}],"name":"whitelistNFTContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]

60806040526301e91c80600655606460075560196008556000600e556000600f553480156200002d57600080fd5b50600080546001600160a01b0319163317808255604080519283526001600160a01b0391909116602083015280517f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09281900390910190a162000099336001600160e01b036200018016565b6002805460ff19908116909155600160038190557e137c28eabea4eda5601e544e6551e6761ee561d32c4142c29e0f892835a36180548316821790557f1f26cc04db5725a6013f9a871c79fcbf894bb366deda2d7526896a3d7f7bf1e680548316821790557306012c8cf97bead5deae237070f9587f8e7a266d60005260056020527fd29e67e721d8475158b477946d2fc2b140e50d4f9ccd63b4d835aba2462d9db780549092161790556200015f6301ffc9a760e01b6001600160e01b03620001d216565b6200017a6380ac58cd60e01b6001600160e01b03620001d216565b6200029e565b6200019b8160016200020f60201b6200344a1790919060201c565b6040516001600160a01b038216907f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f890600090a250565b6001600160e01b03198082161415620001ea57600080fd5b6001600160e01b0319166000908152600960205260409020805460ff19166001179055565b6001600160a01b0381166200022357600080fd5b6200023882826001600160e01b036200026816565b156200024357600080fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b60006001600160a01b0382166200027e57600080fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b6138ae80620002ae6000396000f3fe6080604052600436106102725760003560e01c80636ef8d66d1161014f5780639658e405116100c1578063c81bd7a61161007a578063c81bd7a614610cf0578063cff1b6ef14610d9b578063dc63af4114610dc5578063e985e9c514610dda578063eaccaf6514610e15578063f2fde38b14610e2a57610272565b80639658e40514610a94578063a22cb46514610abe578063a4441a6f14610af9578063b88d4fde14610b0e578063b9e5390014610bdf578063c4e3c3d214610c1a57610272565b80637e03b763116101135780637e03b763146109da57806382dc1ec414610a0d5780638456cb5914610a405780638da5cb5b14610a555780638f32d59b14610a6a57806395d89b4114610a7f57610272565b80636ef8d66d146108495780636faa8b3f1461085e57806370a082311461088857806370c6943f146108bb578063715018a6146109c557610272565b806342842e0e116101e85780635794fefc116101ac5780635794fefc146107775780635c975abb1461078c57806361851d65146107a15780636352211e146107cb578063643f6e32146107f557806365ab6a081461081f57610272565b806342842e0e1461068f57806346fbf68e146106d257806347948d921461070557806351d0908c1461072f578063564b81ef1461076257610272565b8063192b355d1161023a578063192b355d146103f457806323b872dd1461041b57806331aad3c91461045e578063328404b0146106065780633e2ae46b1461063f5780633f4ba83a1461067a57610272565b806301ffc9a71461027757806306fdde03146102bf578063081812fc14610349578063095ea7b31461038f5780630d9476ff146103ca575b600080fd5b34801561028357600080fd5b506102ab6004803603602081101561029a57600080fd5b50356001600160e01b031916610e5d565b604080519115158252519081900360200190f35b3480156102cb57600080fd5b506102d4610e80565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561030e5781810151838201526020016102f6565b50505050905090810190601f16801561033b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561035557600080fd5b506103736004803603602081101561036c57600080fd5b5035610eaf565b604080516001600160a01b039092168252519081900360200190f35b34801561039b57600080fd5b506103c8600480360360408110156103b257600080fd5b506001600160a01b038135169060200135610edf565b005b3480156103d657600080fd5b506102ab600480360360208110156103ed57600080fd5b5035610f8c565b34801561040057600080fd5b50610409610fa1565b60408051918252519081900360200190f35b34801561042757600080fd5b506103c86004803603606081101561043e57600080fd5b506001600160a01b03813581169160208101359091169060400135610fa7565b34801561046a57600080fd5b506103c860048036036101a081101561048257600080fd5b604080518082018252833593602081013593838201359360608301359360808401359360a081013593810192909161010083019160c0840190600290839083908082843760009201919091525091946001600160a01b038435811695602086013582169560408101359092169450919250608081019060600135600160201b81111561050d57600080fd5b82018360208201111561051f57600080fd5b803590602001918460018302840111600160201b8311171561054057600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561059257600080fd5b8201836020820111156105a457600080fd5b803590602001918460018302840111600160201b831117156105c557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610fca945050505050565b34801561061257600080fd5b506102ab6004803603604081101561062957600080fd5b506001600160a01b03813516906020013561185e565b34801561064b57600080fd5b506103c86004803603604081101561066257600080fd5b506001600160a01b038135169060200135151561188c565b34801561068657600080fd5b506103c86118c8565b34801561069b57600080fd5b506103c8600480360360608110156106b257600080fd5b506001600160a01b03813581169160208101359091169060400135611928565b3480156106de57600080fd5b506102ab600480360360208110156106f557600080fd5b50356001600160a01b0316611943565b34801561071157600080fd5b506103c86004803603602081101561072857600080fd5b5035611956565b34801561073b57600080fd5b506102ab6004803603602081101561075257600080fd5b50356001600160a01b03166119af565b34801561076e57600080fd5b506104096119c4565b34801561078357600080fd5b506104096119c8565b34801561079857600080fd5b506102ab6119ce565b3480156107ad57600080fd5b506103c8600480360360208110156107c457600080fd5b50356119d7565b3480156107d757600080fd5b50610373600480360360208110156107ee57600080fd5b5035611d08565b34801561080157600080fd5b506103c86004803603602081101561081857600080fd5b5035611d2a565b34801561082b57600080fd5b506104096004803603602081101561084257600080fd5b5035611d40565b34801561085557600080fd5b506103c8611dea565b34801561086a57600080fd5b506103c86004803603602081101561088157600080fd5b5035611df5565b34801561089457600080fd5b50610409600480360360208110156108ab57600080fd5b50356001600160a01b031661235c565b3480156108c757600080fd5b506102ab60048036036101808110156108df57600080fd5b81359160208101359160408201359160608101359160808201359160a08101359160c0820135916001600160a01b0360e0820135811692610100830135821692610120810135909216916101408101351515918101906101808101610160820135600160201b81111561095157600080fd5b82018360208201111561096357600080fd5b803590602001918460018302840111600160201b8311171561098457600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061238d945050505050565b3480156109d157600080fd5b506103c86124c1565b3480156109e657600080fd5b506102ab600480360360208110156109fd57600080fd5b50356001600160a01b031661252e565b348015610a1957600080fd5b506103c860048036036020811015610a3057600080fd5b50356001600160a01b0316612543565b348015610a4c57600080fd5b506103c8612561565b348015610a6157600080fd5b506103736125c5565b348015610a7657600080fd5b506102ab6125d4565b348015610a8b57600080fd5b506102d46125e5565b348015610aa057600080fd5b506103c860048036036020811015610ab757600080fd5b5035612604565b348015610aca57600080fd5b506103c860048036036040811015610ae157600080fd5b506001600160a01b0381351690602001351515612684565b348015610b0557600080fd5b50610409612708565b348015610b1a57600080fd5b506103c860048036036080811015610b3157600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b811115610b6b57600080fd5b820183602082011115610b7d57600080fd5b803590602001918460018302840111600160201b83111715610b9e57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061270e945050505050565b348015610beb57600080fd5b506103c860048036036040811015610c0257600080fd5b506001600160a01b0381351690602001351515612734565b348015610c2657600080fd5b506102ab600480360360a0811015610c3d57600080fd5b8135916020810135916001600160a01b03604083013581169260608101359091169181019060a081016080820135600160201b811115610c7c57600080fd5b820183602082011115610c8e57600080fd5b803590602001918460018302840111600160201b83111715610caf57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612770945050505050565b348015610cfc57600080fd5b50610d1a60048036036020811015610d1357600080fd5b5035612828565b604080519c8d5260208d019b909b528b8b019990995260608b019790975267ffffffffffffffff90951660808a015263ffffffff93841660a08a015291831660c089015290911660e08701526001600160a01b0390811661010087015290811661012086015216610140840152151561016083015251908190036101800190f35b348015610da757600080fd5b506103c860048036036020811015610dbe57600080fd5b50356128b5565b348015610dd157600080fd5b50610409612942565b348015610de657600080fd5b506102ab60048036036040811015610dfd57600080fd5b506001600160a01b0381358116916020013516612948565b348015610e2157600080fd5b50610409612976565b348015610e3657600080fd5b506103c860048036036020811015610e4d57600080fd5b50356001600160a01b031661297c565b6001600160e01b0319811660009081526009602052604090205460ff165b919050565b6040805180820190915260158152744e465466692050726f6d6973736f7279204e6f746560581b602082015290565b6000610eba82612996565b610ec357600080fd5b506000908152600b60205260409020546001600160a01b031690565b6000610eea82611d08565b9050806001600160a01b0316836001600160a01b03161415610f0b57600080fd5b336001600160a01b0382161480610f275750610f278133612948565b610f3057600080fd5b6000828152600b602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60116020526000908152604090205460ff1681565b60065481565b610fb133826129b3565b610fba57600080fd5b610fc5838383612a12565b505050565b60025460ff1615610fda57600080fd5b6003805460010190819055610fed61349c565b506040805161018081018252600e548152602081018f90529081018d9052606081018c905267ffffffffffffffff4216608082015263ffffffff808c1660a08301528a811660c083015289811660e08301526001600160a01b038089166101008401528716610120830152336101408301528a14156101608201528d8d10156110a75760405162461bcd60e51b815260040180806020018281038252602d815260200180613501602d913960400191505060405180910390fd5b6006548160a0015163ffffffff1611156110f25760405162461bcd60e51b815260040180806020018281038252602b815260200180613773602b913960400191505060405180910390fd5b60a081015163ffffffff1661114e576040805162461bcd60e51b815260206004820152601c60248201527f4c6f616e206475726174696f6e2063616e6e6f74206265207a65726f00000000604482015290519081900360640190fd5b6008548160e0015163ffffffff16146111985760405162461bcd60e51b81526004018080602001828103825260368152602001806138446036913960400191505060405180910390fd5b6101208101516001600160a01b031660009081526004602052604090205460ff166111f45760405162461bcd60e51b81526004018080602001828103825260448152602001806135f96044913960600191505060405180910390fd5b6101008101516001600160a01b031660009081526005602052604090205460ff166112505760405162461bcd60e51b81526004018080602001828103825260468152602001806136c96046913960600191505060405180910390fd5b3360009081526012602090815260408083208b51845290915290205460ff16156112ab5760405162461bcd60e51b81526004018080602001828103825260688152602001806136616068913960800191505060405180910390fd5b3360009081526012602081815260408084208c5185528252808420805460ff191660011790556001600160a01b03891684529181528183208b8201518452905290205460ff161561132d5760405162461bcd60e51b815260040180806020018281038252606481526020018061370f6064913960800191505060405180910390fd5b6001600160a01b03851660009081526012602090815260408083208b83015184529091528120805460ff19166001179055606082015161137b918a9060200201518361010001513388612770565b6113cc576040805162461bcd60e51b815260206004820152601d60248201527f426f72726f776572207369676e617475726520697320696e76616c6964000000604482015290519081900360640190fd5b61142a8160200151826040015183606001518460a0015163ffffffff168560c0015163ffffffff168660e0015163ffffffff168e60016002811061140c57fe5b60200201518861010001518961012001518e8b61016001518e61238d565b61147b576040805162461bcd60e51b815260206004820152601b60248201527f4c656e646572207369676e617475726520697320696e76616c69640000000000604482015290519081900360640190fd5b600e8054600090815260106020908152604091829020845181559084015160018083019190915591840151600282015560608401516003820155608084015160048201805460a087015160c088015160e089015167ffffffffffffffff1990931667ffffffffffffffff909516949094176bffffffff00000000000000001916600160401b63ffffffff928316021763ffffffff60601b1916600160601b948216949094029390931763ffffffff60801b1916600160801b918416919091021790556101008501516005830180546001600160a01b03199081166001600160a01b03938416179091556101208701516006850180548316918416919091179055610140870151600790940180546101608901519216949092169390931760ff60a01b1916600160a01b931515939093029290921790915591546115c192909190612b1f16565b600e55600f546115d890600163ffffffff612b1f16565b600f819055600754101561161d5760405162461bcd60e51b815260040180806020018281038252604981526020018061379e6049913960600191505060405180910390fd5b6101008101516060820151604080516323b872dd60e01b81523360048201523060248201526044810192909252516001600160a01b03909216916323b872dd9160648082019260009290919082900301818387803b15801561167e57600080fd5b505af1158015611692573d6000803e3d6000fd5b505050610120820151602080840151604080516323b872dd60e01b81526001600160a01b038b81166004830152336024830152604482019390935290519190931693506323b872dd9260648082019392918290030181600087803b1580156116f957600080fd5b505af115801561170d573d6000803e3d6000fd5b505050506040513d602081101561172357600080fd5b50508051611732908690612b38565b7f7a9a95acdaec2726663658ce76ffb4b960ce244a001b3252a5bb3db586e28c1b81600001513387846020015185604001518660600151428860a001518960c001518a61010001518b61012001518c6101600151604051808d81526020018c6001600160a01b03166001600160a01b031681526020018b6001600160a01b03166001600160a01b031681526020018a81526020018981526020018881526020018781526020018663ffffffff1681526020018563ffffffff168152602001846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b03168152602001821515151581526020019c5050505050505050505050505060405180910390a150600354811461184f57600080fd5b50505050505050505050505050565b6001600160a01b038216600090815260126020908152604080832084845290915290205460ff165b92915050565b6118946125d4565b61189d57600080fd5b6001600160a01b03919091166000908152600460205260409020805460ff1916911515919091179055565b6118d133611943565b6118da57600080fd5b60025460ff166118e957600080fd5b6002805460ff191690556040805133815290517f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa9181900360200190a1565b610fc58383836040518060200160405280600081525061270e565b600061188660018363ffffffff612beb16565b61195e6125d4565b61196757600080fd5b63ffffffff8111156119aa5760405162461bcd60e51b81526004018080602001828103825260338152602001806138116033913960400191505060405180910390fd5b600655565b60056020526000908152604090205460ff1681565b4690565b600e5481565b60025460ff1690565b600380546001019081905560008281526011602052604090205460ff1615611a305760405162461bcd60e51b815260040180806020018281038252602a8152602001806137e7602a913960400191505060405180910390fd5b611a3861349c565b5060008281526010602090815260408083208151610180810183528154815260018201549381019390935260028101549183019190915260038101546060830152600481015467ffffffffffffffff811660808401819052600160401b820463ffffffff90811660a08601819052600160601b8404821660c0870152600160801b909304811660e086015260058401546001600160a01b0390811661010087015260068501548116610120870152600790940154938416610140860152600160a01b90930460ff161515610160850152929392611b1892909190612b1f16565b9050804211611b6e576040805162461bcd60e51b815260206004820152601760248201527f4c6f616e206973206e6f74206f76657264756520796574000000000000000000604482015290519081900360640190fd5b6000611b7985611d08565b6000868152601160205260409020805460ff19166001908117909155600f54919250611bab919063ffffffff612c2016565b600f556101008301516060840151611bc4919083612c35565b611bff5760405162461bcd60e51b815260040180806020018281038252602481526020018061363d6024913960400191505060405180910390fd5b611c0885612c6c565b61014083015160208085015160608087015161010080890151604080518d81526001600160a01b03988916978101979097528789168782015293860194909452608085019190915260a084018790524260c08501529390911660e0830152517ff62f4578c92288f0f2dd8009bb1fbae39796c677d6e0b12d28f0ad83b30af6c9929181900390910190a1505050600082815260106020526040812081815560018101829055600281018290556003808201929092556004810180546001600160a01b031990811690915560058201805482169055600682018054909116905560070180546001600160a81b0319169055548114611d0457600080fd5b5050565b6000818152600a60205260408120546001600160a01b03168061188657600080fd5b611d326125d4565b611d3b57600080fd5b600755565b60008181526010602052604081206007810154600160a01b900460ff16611d6c57600201549050610e7b565b6004810154600090611d8f90429067ffffffffffffffff1663ffffffff612c2016565b600183015460028401546004850154929350600092611dc8929190859063ffffffff600160401b8204811691600160601b900416612c7e565b6001840154909150611de0908263ffffffff612b1f16565b9350505050610e7b565b611df333612cf6565b565b600380546001019081905560008281526011602052604090205460ff1615611e4e5760405162461bcd60e51b815260040180806020018281038252602a8152602001806137e7602a913960400191505060405180910390fd5b611e5661349c565b506000828152601060209081526040918290208251610180810184528154815260018201549281019290925260028101549282019290925260038201546060820152600482015467ffffffffffffffff81166080830152600160401b810463ffffffff90811660a0840152600160601b8204811660c0840152600160801b9091041660e082015260058201546001600160a01b03908116610100830152600683015481166101208301526007909201549182166101408201819052600160a01b90920460ff161515610160820152903314611f625760405162461bcd60e51b81526004018080602001828103825260448152602001806135866044913960600191505060405180910390fd5b6000611f6d84611d08565b90506000611f8c83602001518460400151612c2090919063ffffffff16565b90508261016001511515600115151415611fec57611fe983602001518460400151611fce866080015167ffffffffffffffff1642612c2090919063ffffffff16565b8660a0015163ffffffff168760c0015163ffffffff16612c7e565b90505b6000612002828560e0015163ffffffff16612d3e565b9050600061202d82612021858860200151612b1f90919063ffffffff16565b9063ffffffff612c2016565b6000888152601160205260409020805460ff19166001908117909155600f5491925061205f919063ffffffff612c2016565b600f55610120850151610140860151604080516323b872dd60e01b81526001600160a01b039283166004820152878316602482015260448101859052905191909216916323b872dd9160648083019260209291908290030181600087803b1580156120c957600080fd5b505af11580156120dd573d6000803e3d6000fd5b505050506040513d60208110156120f357600080fd5b50506101208501516101408601516001600160a01b03909116906323b872dd9061211b6125c5565b856040518463ffffffff1660e01b815260040180846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b031681526020018281526020019350505050602060405180830381600087803b15801561218457600080fd5b505af1158015612198573d6000803e3d6000fd5b505050506040513d60208110156121ae57600080fd5b505061010085015160608601516101408701516121cc929190612c35565b6122075760405162461bcd60e51b815260040180806020018281038252602481526020018061363d6024913960400191505060405180910390fd5b61221087612c6c565b7f61de14a46baf4e24c466c80f5d823c5925a65ffce385bf401fef42afd8f3a99387866101400151868860200151896060015186888c61010001518d6101200151604051808a8152602001896001600160a01b03166001600160a01b03168152602001886001600160a01b03166001600160a01b03168152602001878152602001868152602001858152602001848152602001836001600160a01b03166001600160a01b03168152602001826001600160a01b03166001600160a01b03168152602001995050505050505050505060405180910390a1505050600084815260106020526040812081815560018101829055600281018290556003808201929092556004810180546001600160a01b031990811690915560058201805482169055600682018054909116905560070180546001600160a81b03191690555483149150611d04905057600080fd5b60006001600160a01b03821661237157600080fd5b506001600160a01b03166000908152600c602052604090205490565b60006001600160a01b0384166123a5575060006124b1565b60006123af6119c4565b905060008e8e8e8e8e8e8e8e8e8e8e8c604051602001808d81526020018c81526020018b81526020018a8152602001898152602001888152602001878152602001866001600160a01b03166001600160a01b031660601b8152601401856001600160a01b03166001600160a01b031660601b8152601401846001600160a01b03166001600160a01b031660601b8152601401831515151560f81b81526001018281526020019c50505050505050505050505050604051602081830303815290604052805190602001209050600061248582612d56565b90506001600160a01b0387166124a1828763ffffffff612da716565b6001600160a01b03161493505050505b9c9b505050505050505050505050565b6124c96125d4565b6124d257600080fd5b60008054604080516001600160a01b039092168252602082019290925281517f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0929181900390910190a1600080546001600160a01b0319169055565b60046020526000908152604090205460ff1681565b61254c33611943565b61255557600080fd5b61255e81612e78565b50565b61256a33611943565b61257357600080fd5b60025460ff161561258357600080fd5b6002805460ff191660011790556040805133815290517f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589181900360200190a1565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b6040805180820190915260058152644e4654666960d81b602082015290565b33600090815260126020908152604080832084845290915290205460ff161561265e5760405162461bcd60e51b815260040180806020018281038252605881526020018061352e6058913960600191505060405180910390fd5b33600090815260126020908152604080832093835292905220805460ff19166001179055565b6001600160a01b03821633141561269a57600080fd5b336000818152600d602090815260408083206001600160a01b03871680855290835292819020805460ff1916861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b60085481565b612719848484610fa7565b61272584848484612ec0565b61272e57600080fd5b50505050565b61273c6125d4565b61274557600080fd5b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b60006001600160a01b0383166127885750600061281f565b60006127926119c4565b6040805160208082018b90528183018a90526bffffffffffffffffffffffff1960608a811b82168185015289901b16607483015260888083018590528351808403909101815260a8909201909252805191012090915060006127f382612d56565b90506001600160a01b03861661280f828763ffffffff612da716565b6001600160a01b03161493505050505b95945050505050565b60106020526000908152604090208054600182015460028301546003840154600485015460058601546006870154600790970154959694959394929367ffffffffffffffff83169363ffffffff600160401b8504811694600160601b8104821694600160801b909104909116926001600160a01b039182169282169181169060ff600160a01b909104168c565b6128bd6125d4565b6128c657600080fd5b6127108111156129075760405162461bcd60e51b815260040180806020018281038252602f8152602001806135ca602f913960400191505060405180910390fd5b60088190556040805182815290517f36a705a6c19db3ef2d8bf55ca55188c8499831bdf4fb8cd76fc1cf98b740bd279181900360200190a150565b600f5481565b6001600160a01b039182166000908152600d6020908152604080832093909416825291909152205460ff1690565b60075481565b6129846125d4565b61298d57600080fd5b61255e81612ff3565b6000908152600a60205260409020546001600160a01b0316151590565b6000806129bf83611d08565b9050806001600160a01b0316846001600160a01b031614806129fa5750836001600160a01b03166129ef84610eaf565b6001600160a01b0316145b80612a0a5750612a0a8185612948565b949350505050565b826001600160a01b0316612a2582611d08565b6001600160a01b031614612a3857600080fd5b6001600160a01b038216612a4b57600080fd5b612a5481613070565b6001600160a01b0383166000908152600c6020526040902054612a7e90600163ffffffff612c2016565b6001600160a01b038085166000908152600c60205260408082209390935590841681522054612ab490600163ffffffff612b1f16565b6001600160a01b038084166000818152600c6020908152604080832095909555858252600a905283812080546001600160a01b031916831790559251849391928716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600082820183811015612b3157600080fd5b9392505050565b6001600160a01b038216612b4b57600080fd5b612b5481612996565b15612b5e57600080fd5b6000818152600a6020908152604080832080546001600160a01b0319166001600160a01b0387169081179091558352600c909152902054612ba0906001612b1f565b6001600160a01b0383166000818152600c60205260408082209390935591518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160a01b038216612c0057600080fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b600082821115612c2f57600080fd5b50900390565b600080612c438585856130ab565b90508015612c55576001915050612b31565b6000612c6286868661327f565b9250612b31915050565b61255e612c7882611d08565b826132fa565b600080612ca3612710612c97898663ffffffff6133b916565b9063ffffffff6133e016565b90506000612cbb85612c97848963ffffffff6133b916565b905086612cce898363ffffffff612b1f16565b1115612ced57612ce4878963ffffffff612c2016565b9250505061281f565b915061281f9050565b612d0760018263ffffffff61340216565b6040516001600160a01b038216907fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e90600090a250565b6000612b31612710612c97858563ffffffff6133b916565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b6000806000808451604114612dc25760009350505050611886565b50505060208201516040830151606084015160001a601b811015612de457601b015b8060ff16601b14158015612dfc57508060ff16601c14155b15612e0d5760009350505050611886565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa158015612e64573d6000803e3d6000fd5b505050602060405103519350505050611886565b612e8960018263ffffffff61344a16565b6040516001600160a01b038216907f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f890600090a250565b6000612ed4846001600160a01b0316613496565b612ee057506001612a0a565b604051630a85bd0160e11b815233600482018181526001600160a01b03888116602485015260448401879052608060648501908152865160848601528651600095928a169463150b7a029490938c938b938b939260a4019060208501908083838e5b83811015612f5a578181015183820152602001612f42565b50505050905090810190601f168015612f875780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b158015612fa957600080fd5b505af1158015612fbd573d6000803e3d6000fd5b505050506040513d6020811015612fd357600080fd5b50516001600160e01b031916630a85bd0160e11b14915050949350505050565b6001600160a01b03811661300657600080fd5b600054604080516001600160a01b039283168152918316602083015280517f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09281900390910190a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600b60205260409020546001600160a01b03161561255e576000908152600b6020526040902080546001600160a01b0319169055565b60408051306024820152604480820185905282518083039091018152606490910182526020810180516001600160e01b031663095ea7b360e01b178152915181516000936001600160a01b0388169392918291908083835b602083106131225780518252601f199092019160209182019101613103565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613184576040519150601f19603f3d011682016040523d82523d6000602084013e613189565b606091505b5050604080513060248201526001600160a01b038581166044830152606480830188905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17815292518251600095509189169390918291908083835b6020831061320c5780518252601f1990920191602091820191016131ed565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461326e576040519150601f19603f3d011682016040523d82523d6000602084013e613273565b606091505b50909695505050505050565b604080516001600160a01b038381166024830152604480830186905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1781529251825160009485949389169392918291908083836020831061320c5780518252601f1990920191602091820191016131ed565b816001600160a01b031661330d82611d08565b6001600160a01b03161461332057600080fd5b61332981613070565b6001600160a01b0382166000908152600c602052604090205461335390600163ffffffff612c2016565b6001600160a01b0383166000818152600c6020908152604080832094909455848252600a905282812080546001600160a01b03191690559151839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000826133c857506000611886565b828202828482816133d557fe5b0414612b3157600080fd5b60008082116133ee57600080fd5b60008284816133f957fe5b04949350505050565b6001600160a01b03811661341557600080fd5b61341f8282612beb565b61342857600080fd5b6001600160a01b0316600090815260209190915260409020805460ff19169055565b6001600160a01b03811661345d57600080fd5b6134678282612beb565b1561347157600080fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b3b151590565b6040805161018081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091529056fe4e6567617469766520696e7465726573742072617465206c6f616e7320617265206e6f7420616c6c6f7765642e4e6f6e636520696e76616c69642c207573657220686173206569746865722063616e63656c6c65642f626567756e2074686973206c6f616e2c206f72207265757365642061206e6f6e6365207768656e207369676e696e674f6e6c792074686520626f72726f7765722063616e20706179206261636b2061206c6f616e20616e64207265636c61696d2074686520756e6465726c79696e67204e4654427920646566696e6974696f6e2c20626173697320706f696e74732063616e6e6f742065786365656420313030303043757272656e63792064656e6f6d696e6174696f6e206973206e6f742077686974656c697374656420746f2062652075736564206279207468697320636f6e74726163744e465420776173206e6f74207375636365737366756c6c79207472616e73666572726564426f72726f776572206e6f6e636520696e76616c69642c20626f72726f77657220686173206569746865722063616e63656c6c65642f626567756e2074686973206c6f616e2c206f72207265757365642074686973206e6f6e6365207768656e207369676e696e674e465420636f6c6c61746572616c20636f6e7472616374206973206e6f742077686974656c697374656420746f2062652075736564206279207468697320636f6e74726163744c656e646572206e6f6e636520696e76616c69642c206c656e64657220686173206569746865722063616e63656c6c65642f626567756e2074686973206c6f616e2c206f72207265757365642074686973206e6f6e6365207768656e207369676e696e674c6f616e206475726174696f6e2065786365656473206d6178696d756d206c6f616e206475726174696f6e436f6e747261637420686173207265616368656420746865206d6178696d756d206e756d626572206f6620616374697665206c6f616e7320616c6c6f7765642062792061646d696e734c6f616e2068617320616c7265616479206265656e20726570616964206f72206c6971756964617465646c6f616e206475726174696f6e2063616e6e6f742065786365656420737061636520616c6f7474656420696e207374727563745468652061646d696e2066656520686173206368616e6765642073696e63652074686973206f7264657220776173207369676e65642ea265627a7a723158206fc95585979ded1d84626280fb19b06abd4788867d183f9709d0061eff2c455864736f6c63430005100032

Deployed Bytecode

0x6080604052600436106102725760003560e01c80636ef8d66d1161014f5780639658e405116100c1578063c81bd7a61161007a578063c81bd7a614610cf0578063cff1b6ef14610d9b578063dc63af4114610dc5578063e985e9c514610dda578063eaccaf6514610e15578063f2fde38b14610e2a57610272565b80639658e40514610a94578063a22cb46514610abe578063a4441a6f14610af9578063b88d4fde14610b0e578063b9e5390014610bdf578063c4e3c3d214610c1a57610272565b80637e03b763116101135780637e03b763146109da57806382dc1ec414610a0d5780638456cb5914610a405780638da5cb5b14610a555780638f32d59b14610a6a57806395d89b4114610a7f57610272565b80636ef8d66d146108495780636faa8b3f1461085e57806370a082311461088857806370c6943f146108bb578063715018a6146109c557610272565b806342842e0e116101e85780635794fefc116101ac5780635794fefc146107775780635c975abb1461078c57806361851d65146107a15780636352211e146107cb578063643f6e32146107f557806365ab6a081461081f57610272565b806342842e0e1461068f57806346fbf68e146106d257806347948d921461070557806351d0908c1461072f578063564b81ef1461076257610272565b8063192b355d1161023a578063192b355d146103f457806323b872dd1461041b57806331aad3c91461045e578063328404b0146106065780633e2ae46b1461063f5780633f4ba83a1461067a57610272565b806301ffc9a71461027757806306fdde03146102bf578063081812fc14610349578063095ea7b31461038f5780630d9476ff146103ca575b600080fd5b34801561028357600080fd5b506102ab6004803603602081101561029a57600080fd5b50356001600160e01b031916610e5d565b604080519115158252519081900360200190f35b3480156102cb57600080fd5b506102d4610e80565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561030e5781810151838201526020016102f6565b50505050905090810190601f16801561033b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561035557600080fd5b506103736004803603602081101561036c57600080fd5b5035610eaf565b604080516001600160a01b039092168252519081900360200190f35b34801561039b57600080fd5b506103c8600480360360408110156103b257600080fd5b506001600160a01b038135169060200135610edf565b005b3480156103d657600080fd5b506102ab600480360360208110156103ed57600080fd5b5035610f8c565b34801561040057600080fd5b50610409610fa1565b60408051918252519081900360200190f35b34801561042757600080fd5b506103c86004803603606081101561043e57600080fd5b506001600160a01b03813581169160208101359091169060400135610fa7565b34801561046a57600080fd5b506103c860048036036101a081101561048257600080fd5b604080518082018252833593602081013593838201359360608301359360808401359360a081013593810192909161010083019160c0840190600290839083908082843760009201919091525091946001600160a01b038435811695602086013582169560408101359092169450919250608081019060600135600160201b81111561050d57600080fd5b82018360208201111561051f57600080fd5b803590602001918460018302840111600160201b8311171561054057600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561059257600080fd5b8201836020820111156105a457600080fd5b803590602001918460018302840111600160201b831117156105c557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610fca945050505050565b34801561061257600080fd5b506102ab6004803603604081101561062957600080fd5b506001600160a01b03813516906020013561185e565b34801561064b57600080fd5b506103c86004803603604081101561066257600080fd5b506001600160a01b038135169060200135151561188c565b34801561068657600080fd5b506103c86118c8565b34801561069b57600080fd5b506103c8600480360360608110156106b257600080fd5b506001600160a01b03813581169160208101359091169060400135611928565b3480156106de57600080fd5b506102ab600480360360208110156106f557600080fd5b50356001600160a01b0316611943565b34801561071157600080fd5b506103c86004803603602081101561072857600080fd5b5035611956565b34801561073b57600080fd5b506102ab6004803603602081101561075257600080fd5b50356001600160a01b03166119af565b34801561076e57600080fd5b506104096119c4565b34801561078357600080fd5b506104096119c8565b34801561079857600080fd5b506102ab6119ce565b3480156107ad57600080fd5b506103c8600480360360208110156107c457600080fd5b50356119d7565b3480156107d757600080fd5b50610373600480360360208110156107ee57600080fd5b5035611d08565b34801561080157600080fd5b506103c86004803603602081101561081857600080fd5b5035611d2a565b34801561082b57600080fd5b506104096004803603602081101561084257600080fd5b5035611d40565b34801561085557600080fd5b506103c8611dea565b34801561086a57600080fd5b506103c86004803603602081101561088157600080fd5b5035611df5565b34801561089457600080fd5b50610409600480360360208110156108ab57600080fd5b50356001600160a01b031661235c565b3480156108c757600080fd5b506102ab60048036036101808110156108df57600080fd5b81359160208101359160408201359160608101359160808201359160a08101359160c0820135916001600160a01b0360e0820135811692610100830135821692610120810135909216916101408101351515918101906101808101610160820135600160201b81111561095157600080fd5b82018360208201111561096357600080fd5b803590602001918460018302840111600160201b8311171561098457600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061238d945050505050565b3480156109d157600080fd5b506103c86124c1565b3480156109e657600080fd5b506102ab600480360360208110156109fd57600080fd5b50356001600160a01b031661252e565b348015610a1957600080fd5b506103c860048036036020811015610a3057600080fd5b50356001600160a01b0316612543565b348015610a4c57600080fd5b506103c8612561565b348015610a6157600080fd5b506103736125c5565b348015610a7657600080fd5b506102ab6125d4565b348015610a8b57600080fd5b506102d46125e5565b348015610aa057600080fd5b506103c860048036036020811015610ab757600080fd5b5035612604565b348015610aca57600080fd5b506103c860048036036040811015610ae157600080fd5b506001600160a01b0381351690602001351515612684565b348015610b0557600080fd5b50610409612708565b348015610b1a57600080fd5b506103c860048036036080811015610b3157600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b811115610b6b57600080fd5b820183602082011115610b7d57600080fd5b803590602001918460018302840111600160201b83111715610b9e57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061270e945050505050565b348015610beb57600080fd5b506103c860048036036040811015610c0257600080fd5b506001600160a01b0381351690602001351515612734565b348015610c2657600080fd5b506102ab600480360360a0811015610c3d57600080fd5b8135916020810135916001600160a01b03604083013581169260608101359091169181019060a081016080820135600160201b811115610c7c57600080fd5b820183602082011115610c8e57600080fd5b803590602001918460018302840111600160201b83111715610caf57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612770945050505050565b348015610cfc57600080fd5b50610d1a60048036036020811015610d1357600080fd5b5035612828565b604080519c8d5260208d019b909b528b8b019990995260608b019790975267ffffffffffffffff90951660808a015263ffffffff93841660a08a015291831660c089015290911660e08701526001600160a01b0390811661010087015290811661012086015216610140840152151561016083015251908190036101800190f35b348015610da757600080fd5b506103c860048036036020811015610dbe57600080fd5b50356128b5565b348015610dd157600080fd5b50610409612942565b348015610de657600080fd5b506102ab60048036036040811015610dfd57600080fd5b506001600160a01b0381358116916020013516612948565b348015610e2157600080fd5b50610409612976565b348015610e3657600080fd5b506103c860048036036020811015610e4d57600080fd5b50356001600160a01b031661297c565b6001600160e01b0319811660009081526009602052604090205460ff165b919050565b6040805180820190915260158152744e465466692050726f6d6973736f7279204e6f746560581b602082015290565b6000610eba82612996565b610ec357600080fd5b506000908152600b60205260409020546001600160a01b031690565b6000610eea82611d08565b9050806001600160a01b0316836001600160a01b03161415610f0b57600080fd5b336001600160a01b0382161480610f275750610f278133612948565b610f3057600080fd5b6000828152600b602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60116020526000908152604090205460ff1681565b60065481565b610fb133826129b3565b610fba57600080fd5b610fc5838383612a12565b505050565b60025460ff1615610fda57600080fd5b6003805460010190819055610fed61349c565b506040805161018081018252600e548152602081018f90529081018d9052606081018c905267ffffffffffffffff4216608082015263ffffffff808c1660a08301528a811660c083015289811660e08301526001600160a01b038089166101008401528716610120830152336101408301528a14156101608201528d8d10156110a75760405162461bcd60e51b815260040180806020018281038252602d815260200180613501602d913960400191505060405180910390fd5b6006548160a0015163ffffffff1611156110f25760405162461bcd60e51b815260040180806020018281038252602b815260200180613773602b913960400191505060405180910390fd5b60a081015163ffffffff1661114e576040805162461bcd60e51b815260206004820152601c60248201527f4c6f616e206475726174696f6e2063616e6e6f74206265207a65726f00000000604482015290519081900360640190fd5b6008548160e0015163ffffffff16146111985760405162461bcd60e51b81526004018080602001828103825260368152602001806138446036913960400191505060405180910390fd5b6101208101516001600160a01b031660009081526004602052604090205460ff166111f45760405162461bcd60e51b81526004018080602001828103825260448152602001806135f96044913960600191505060405180910390fd5b6101008101516001600160a01b031660009081526005602052604090205460ff166112505760405162461bcd60e51b81526004018080602001828103825260468152602001806136c96046913960600191505060405180910390fd5b3360009081526012602090815260408083208b51845290915290205460ff16156112ab5760405162461bcd60e51b81526004018080602001828103825260688152602001806136616068913960800191505060405180910390fd5b3360009081526012602081815260408084208c5185528252808420805460ff191660011790556001600160a01b03891684529181528183208b8201518452905290205460ff161561132d5760405162461bcd60e51b815260040180806020018281038252606481526020018061370f6064913960800191505060405180910390fd5b6001600160a01b03851660009081526012602090815260408083208b83015184529091528120805460ff19166001179055606082015161137b918a9060200201518361010001513388612770565b6113cc576040805162461bcd60e51b815260206004820152601d60248201527f426f72726f776572207369676e617475726520697320696e76616c6964000000604482015290519081900360640190fd5b61142a8160200151826040015183606001518460a0015163ffffffff168560c0015163ffffffff168660e0015163ffffffff168e60016002811061140c57fe5b60200201518861010001518961012001518e8b61016001518e61238d565b61147b576040805162461bcd60e51b815260206004820152601b60248201527f4c656e646572207369676e617475726520697320696e76616c69640000000000604482015290519081900360640190fd5b600e8054600090815260106020908152604091829020845181559084015160018083019190915591840151600282015560608401516003820155608084015160048201805460a087015160c088015160e089015167ffffffffffffffff1990931667ffffffffffffffff909516949094176bffffffff00000000000000001916600160401b63ffffffff928316021763ffffffff60601b1916600160601b948216949094029390931763ffffffff60801b1916600160801b918416919091021790556101008501516005830180546001600160a01b03199081166001600160a01b03938416179091556101208701516006850180548316918416919091179055610140870151600790940180546101608901519216949092169390931760ff60a01b1916600160a01b931515939093029290921790915591546115c192909190612b1f16565b600e55600f546115d890600163ffffffff612b1f16565b600f819055600754101561161d5760405162461bcd60e51b815260040180806020018281038252604981526020018061379e6049913960600191505060405180910390fd5b6101008101516060820151604080516323b872dd60e01b81523360048201523060248201526044810192909252516001600160a01b03909216916323b872dd9160648082019260009290919082900301818387803b15801561167e57600080fd5b505af1158015611692573d6000803e3d6000fd5b505050610120820151602080840151604080516323b872dd60e01b81526001600160a01b038b81166004830152336024830152604482019390935290519190931693506323b872dd9260648082019392918290030181600087803b1580156116f957600080fd5b505af115801561170d573d6000803e3d6000fd5b505050506040513d602081101561172357600080fd5b50508051611732908690612b38565b7f7a9a95acdaec2726663658ce76ffb4b960ce244a001b3252a5bb3db586e28c1b81600001513387846020015185604001518660600151428860a001518960c001518a61010001518b61012001518c6101600151604051808d81526020018c6001600160a01b03166001600160a01b031681526020018b6001600160a01b03166001600160a01b031681526020018a81526020018981526020018881526020018781526020018663ffffffff1681526020018563ffffffff168152602001846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b03168152602001821515151581526020019c5050505050505050505050505060405180910390a150600354811461184f57600080fd5b50505050505050505050505050565b6001600160a01b038216600090815260126020908152604080832084845290915290205460ff165b92915050565b6118946125d4565b61189d57600080fd5b6001600160a01b03919091166000908152600460205260409020805460ff1916911515919091179055565b6118d133611943565b6118da57600080fd5b60025460ff166118e957600080fd5b6002805460ff191690556040805133815290517f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa9181900360200190a1565b610fc58383836040518060200160405280600081525061270e565b600061188660018363ffffffff612beb16565b61195e6125d4565b61196757600080fd5b63ffffffff8111156119aa5760405162461bcd60e51b81526004018080602001828103825260338152602001806138116033913960400191505060405180910390fd5b600655565b60056020526000908152604090205460ff1681565b4690565b600e5481565b60025460ff1690565b600380546001019081905560008281526011602052604090205460ff1615611a305760405162461bcd60e51b815260040180806020018281038252602a8152602001806137e7602a913960400191505060405180910390fd5b611a3861349c565b5060008281526010602090815260408083208151610180810183528154815260018201549381019390935260028101549183019190915260038101546060830152600481015467ffffffffffffffff811660808401819052600160401b820463ffffffff90811660a08601819052600160601b8404821660c0870152600160801b909304811660e086015260058401546001600160a01b0390811661010087015260068501548116610120870152600790940154938416610140860152600160a01b90930460ff161515610160850152929392611b1892909190612b1f16565b9050804211611b6e576040805162461bcd60e51b815260206004820152601760248201527f4c6f616e206973206e6f74206f76657264756520796574000000000000000000604482015290519081900360640190fd5b6000611b7985611d08565b6000868152601160205260409020805460ff19166001908117909155600f54919250611bab919063ffffffff612c2016565b600f556101008301516060840151611bc4919083612c35565b611bff5760405162461bcd60e51b815260040180806020018281038252602481526020018061363d6024913960400191505060405180910390fd5b611c0885612c6c565b61014083015160208085015160608087015161010080890151604080518d81526001600160a01b03988916978101979097528789168782015293860194909452608085019190915260a084018790524260c08501529390911660e0830152517ff62f4578c92288f0f2dd8009bb1fbae39796c677d6e0b12d28f0ad83b30af6c9929181900390910190a1505050600082815260106020526040812081815560018101829055600281018290556003808201929092556004810180546001600160a01b031990811690915560058201805482169055600682018054909116905560070180546001600160a81b0319169055548114611d0457600080fd5b5050565b6000818152600a60205260408120546001600160a01b03168061188657600080fd5b611d326125d4565b611d3b57600080fd5b600755565b60008181526010602052604081206007810154600160a01b900460ff16611d6c57600201549050610e7b565b6004810154600090611d8f90429067ffffffffffffffff1663ffffffff612c2016565b600183015460028401546004850154929350600092611dc8929190859063ffffffff600160401b8204811691600160601b900416612c7e565b6001840154909150611de0908263ffffffff612b1f16565b9350505050610e7b565b611df333612cf6565b565b600380546001019081905560008281526011602052604090205460ff1615611e4e5760405162461bcd60e51b815260040180806020018281038252602a8152602001806137e7602a913960400191505060405180910390fd5b611e5661349c565b506000828152601060209081526040918290208251610180810184528154815260018201549281019290925260028101549282019290925260038201546060820152600482015467ffffffffffffffff81166080830152600160401b810463ffffffff90811660a0840152600160601b8204811660c0840152600160801b9091041660e082015260058201546001600160a01b03908116610100830152600683015481166101208301526007909201549182166101408201819052600160a01b90920460ff161515610160820152903314611f625760405162461bcd60e51b81526004018080602001828103825260448152602001806135866044913960600191505060405180910390fd5b6000611f6d84611d08565b90506000611f8c83602001518460400151612c2090919063ffffffff16565b90508261016001511515600115151415611fec57611fe983602001518460400151611fce866080015167ffffffffffffffff1642612c2090919063ffffffff16565b8660a0015163ffffffff168760c0015163ffffffff16612c7e565b90505b6000612002828560e0015163ffffffff16612d3e565b9050600061202d82612021858860200151612b1f90919063ffffffff16565b9063ffffffff612c2016565b6000888152601160205260409020805460ff19166001908117909155600f5491925061205f919063ffffffff612c2016565b600f55610120850151610140860151604080516323b872dd60e01b81526001600160a01b039283166004820152878316602482015260448101859052905191909216916323b872dd9160648083019260209291908290030181600087803b1580156120c957600080fd5b505af11580156120dd573d6000803e3d6000fd5b505050506040513d60208110156120f357600080fd5b50506101208501516101408601516001600160a01b03909116906323b872dd9061211b6125c5565b856040518463ffffffff1660e01b815260040180846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b031681526020018281526020019350505050602060405180830381600087803b15801561218457600080fd5b505af1158015612198573d6000803e3d6000fd5b505050506040513d60208110156121ae57600080fd5b505061010085015160608601516101408701516121cc929190612c35565b6122075760405162461bcd60e51b815260040180806020018281038252602481526020018061363d6024913960400191505060405180910390fd5b61221087612c6c565b7f61de14a46baf4e24c466c80f5d823c5925a65ffce385bf401fef42afd8f3a99387866101400151868860200151896060015186888c61010001518d6101200151604051808a8152602001896001600160a01b03166001600160a01b03168152602001886001600160a01b03166001600160a01b03168152602001878152602001868152602001858152602001848152602001836001600160a01b03166001600160a01b03168152602001826001600160a01b03166001600160a01b03168152602001995050505050505050505060405180910390a1505050600084815260106020526040812081815560018101829055600281018290556003808201929092556004810180546001600160a01b031990811690915560058201805482169055600682018054909116905560070180546001600160a81b03191690555483149150611d04905057600080fd5b60006001600160a01b03821661237157600080fd5b506001600160a01b03166000908152600c602052604090205490565b60006001600160a01b0384166123a5575060006124b1565b60006123af6119c4565b905060008e8e8e8e8e8e8e8e8e8e8e8c604051602001808d81526020018c81526020018b81526020018a8152602001898152602001888152602001878152602001866001600160a01b03166001600160a01b031660601b8152601401856001600160a01b03166001600160a01b031660601b8152601401846001600160a01b03166001600160a01b031660601b8152601401831515151560f81b81526001018281526020019c50505050505050505050505050604051602081830303815290604052805190602001209050600061248582612d56565b90506001600160a01b0387166124a1828763ffffffff612da716565b6001600160a01b03161493505050505b9c9b505050505050505050505050565b6124c96125d4565b6124d257600080fd5b60008054604080516001600160a01b039092168252602082019290925281517f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0929181900390910190a1600080546001600160a01b0319169055565b60046020526000908152604090205460ff1681565b61254c33611943565b61255557600080fd5b61255e81612e78565b50565b61256a33611943565b61257357600080fd5b60025460ff161561258357600080fd5b6002805460ff191660011790556040805133815290517f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589181900360200190a1565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b6040805180820190915260058152644e4654666960d81b602082015290565b33600090815260126020908152604080832084845290915290205460ff161561265e5760405162461bcd60e51b815260040180806020018281038252605881526020018061352e6058913960600191505060405180910390fd5b33600090815260126020908152604080832093835292905220805460ff19166001179055565b6001600160a01b03821633141561269a57600080fd5b336000818152600d602090815260408083206001600160a01b03871680855290835292819020805460ff1916861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b60085481565b612719848484610fa7565b61272584848484612ec0565b61272e57600080fd5b50505050565b61273c6125d4565b61274557600080fd5b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b60006001600160a01b0383166127885750600061281f565b60006127926119c4565b6040805160208082018b90528183018a90526bffffffffffffffffffffffff1960608a811b82168185015289901b16607483015260888083018590528351808403909101815260a8909201909252805191012090915060006127f382612d56565b90506001600160a01b03861661280f828763ffffffff612da716565b6001600160a01b03161493505050505b95945050505050565b60106020526000908152604090208054600182015460028301546003840154600485015460058601546006870154600790970154959694959394929367ffffffffffffffff83169363ffffffff600160401b8504811694600160601b8104821694600160801b909104909116926001600160a01b039182169282169181169060ff600160a01b909104168c565b6128bd6125d4565b6128c657600080fd5b6127108111156129075760405162461bcd60e51b815260040180806020018281038252602f8152602001806135ca602f913960400191505060405180910390fd5b60088190556040805182815290517f36a705a6c19db3ef2d8bf55ca55188c8499831bdf4fb8cd76fc1cf98b740bd279181900360200190a150565b600f5481565b6001600160a01b039182166000908152600d6020908152604080832093909416825291909152205460ff1690565b60075481565b6129846125d4565b61298d57600080fd5b61255e81612ff3565b6000908152600a60205260409020546001600160a01b0316151590565b6000806129bf83611d08565b9050806001600160a01b0316846001600160a01b031614806129fa5750836001600160a01b03166129ef84610eaf565b6001600160a01b0316145b80612a0a5750612a0a8185612948565b949350505050565b826001600160a01b0316612a2582611d08565b6001600160a01b031614612a3857600080fd5b6001600160a01b038216612a4b57600080fd5b612a5481613070565b6001600160a01b0383166000908152600c6020526040902054612a7e90600163ffffffff612c2016565b6001600160a01b038085166000908152600c60205260408082209390935590841681522054612ab490600163ffffffff612b1f16565b6001600160a01b038084166000818152600c6020908152604080832095909555858252600a905283812080546001600160a01b031916831790559251849391928716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600082820183811015612b3157600080fd5b9392505050565b6001600160a01b038216612b4b57600080fd5b612b5481612996565b15612b5e57600080fd5b6000818152600a6020908152604080832080546001600160a01b0319166001600160a01b0387169081179091558352600c909152902054612ba0906001612b1f565b6001600160a01b0383166000818152600c60205260408082209390935591518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160a01b038216612c0057600080fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b600082821115612c2f57600080fd5b50900390565b600080612c438585856130ab565b90508015612c55576001915050612b31565b6000612c6286868661327f565b9250612b31915050565b61255e612c7882611d08565b826132fa565b600080612ca3612710612c97898663ffffffff6133b916565b9063ffffffff6133e016565b90506000612cbb85612c97848963ffffffff6133b916565b905086612cce898363ffffffff612b1f16565b1115612ced57612ce4878963ffffffff612c2016565b9250505061281f565b915061281f9050565b612d0760018263ffffffff61340216565b6040516001600160a01b038216907fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e90600090a250565b6000612b31612710612c97858563ffffffff6133b916565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b6000806000808451604114612dc25760009350505050611886565b50505060208201516040830151606084015160001a601b811015612de457601b015b8060ff16601b14158015612dfc57508060ff16601c14155b15612e0d5760009350505050611886565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa158015612e64573d6000803e3d6000fd5b505050602060405103519350505050611886565b612e8960018263ffffffff61344a16565b6040516001600160a01b038216907f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f890600090a250565b6000612ed4846001600160a01b0316613496565b612ee057506001612a0a565b604051630a85bd0160e11b815233600482018181526001600160a01b03888116602485015260448401879052608060648501908152865160848601528651600095928a169463150b7a029490938c938b938b939260a4019060208501908083838e5b83811015612f5a578181015183820152602001612f42565b50505050905090810190601f168015612f875780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b158015612fa957600080fd5b505af1158015612fbd573d6000803e3d6000fd5b505050506040513d6020811015612fd357600080fd5b50516001600160e01b031916630a85bd0160e11b14915050949350505050565b6001600160a01b03811661300657600080fd5b600054604080516001600160a01b039283168152918316602083015280517f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09281900390910190a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600b60205260409020546001600160a01b03161561255e576000908152600b6020526040902080546001600160a01b0319169055565b60408051306024820152604480820185905282518083039091018152606490910182526020810180516001600160e01b031663095ea7b360e01b178152915181516000936001600160a01b0388169392918291908083835b602083106131225780518252601f199092019160209182019101613103565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613184576040519150601f19603f3d011682016040523d82523d6000602084013e613189565b606091505b5050604080513060248201526001600160a01b038581166044830152606480830188905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17815292518251600095509189169390918291908083835b6020831061320c5780518252601f1990920191602091820191016131ed565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461326e576040519150601f19603f3d011682016040523d82523d6000602084013e613273565b606091505b50909695505050505050565b604080516001600160a01b038381166024830152604480830186905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1781529251825160009485949389169392918291908083836020831061320c5780518252601f1990920191602091820191016131ed565b816001600160a01b031661330d82611d08565b6001600160a01b03161461332057600080fd5b61332981613070565b6001600160a01b0382166000908152600c602052604090205461335390600163ffffffff612c2016565b6001600160a01b0383166000818152600c6020908152604080832094909455848252600a905282812080546001600160a01b03191690559151839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000826133c857506000611886565b828202828482816133d557fe5b0414612b3157600080fd5b60008082116133ee57600080fd5b60008284816133f957fe5b04949350505050565b6001600160a01b03811661341557600080fd5b61341f8282612beb565b61342857600080fd5b6001600160a01b0316600090815260209190915260409020805460ff19169055565b6001600160a01b03811661345d57600080fd5b6134678282612beb565b1561347157600080fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b3b151590565b6040805161018081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091529056fe4e6567617469766520696e7465726573742072617465206c6f616e7320617265206e6f7420616c6c6f7765642e4e6f6e636520696e76616c69642c207573657220686173206569746865722063616e63656c6c65642f626567756e2074686973206c6f616e2c206f72207265757365642061206e6f6e6365207768656e207369676e696e674f6e6c792074686520626f72726f7765722063616e20706179206261636b2061206c6f616e20616e64207265636c61696d2074686520756e6465726c79696e67204e4654427920646566696e6974696f6e2c20626173697320706f696e74732063616e6e6f742065786365656420313030303043757272656e63792064656e6f6d696e6174696f6e206973206e6f742077686974656c697374656420746f2062652075736564206279207468697320636f6e74726163744e465420776173206e6f74207375636365737366756c6c79207472616e73666572726564426f72726f776572206e6f6e636520696e76616c69642c20626f72726f77657220686173206569746865722063616e63656c6c65642f626567756e2074686973206c6f616e2c206f72207265757365642074686973206e6f6e6365207768656e207369676e696e674e465420636f6c6c61746572616c20636f6e7472616374206973206e6f742077686974656c697374656420746f2062652075736564206279207468697320636f6e74726163744c656e646572206e6f6e636520696e76616c69642c206c656e64657220686173206569746865722063616e63656c6c65642f626567756e2074686973206c6f616e2c206f72207265757365642074686973206e6f6e6365207768656e207369676e696e674c6f616e206475726174696f6e2065786365656473206d6178696d756d206c6f616e206475726174696f6e436f6e747261637420686173207265616368656420746865206d6178696d756d206e756d626572206f6620616374697665206c6f616e7320616c6c6f7765642062792061646d696e734c6f616e2068617320616c7265616479206265656e20726570616964206f72206c6971756964617465646c6f616e206475726174696f6e2063616e6e6f742065786365656420737061636520616c6f7474656420696e207374727563745468652061646d696e2066656520686173206368616e6765642073696e63652074686973206f7264657220776173207369676e65642ea265627a7a723158206fc95585979ded1d84626280fb19b06abd4788867d183f9709d0061eff2c455864736f6c63430005100032

Deployed Bytecode Sourcemap

48653:46447:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;95081:8;;;32847:135;;8:9:-1;5:2;;;30:1;27;20:12;5:2;32847:135:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;32847:135:0;-1:-1:-1;;;;;;32847:135:0;;:::i;:::-;;;;;;;;;;;;;;;;;;10265:103;;8:9:-1;5:2;;;30:1;27;20:12;5:2;10265:103:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;10265:103:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;36904:154;;8:9:-1;5:2;;;30:1;27;20:12;5:2;36904:154:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;36904:154:0;;:::i;:::-;;;;-1:-1:-1;;;;;36904:154:0;;;;;;;;;;;;;;36312:299;;8:9:-1;5:2;;;30:1;27;20:12;5:2;36312:299:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;36312:299:0;;;;;;;;:::i;:::-;;60030:55;;8:9:-1;5:2;;;30:1;27;20:12;5:2;60030:55:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;60030:55:0;;:::i;9002:45::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9002:45:0;;;:::i;:::-;;;;;;;;;;;;;;;;38494:184;;8:9:-1;5:2;;;30:1;27;20:12;5:2;38494:184:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;38494:184:0;;;;;;;;;;;;;;;;;:::i;67374:6020::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;67374:6020:0;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;67374:6020:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1:33:-1;99:1;81:16;;74:27;;;;-1:-1;67374:6020:0;;-1:-1:-1;;;;;67374:6020:0;;;;;;;;;;;;;;;;;;;;-1:-1:-1;67374:6020:0;;-1:-1:-1;67374:6020:0;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;67374:6020:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;67374:6020:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;67374:6020:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;67374:6020:0;;;;;;;;-1:-1:-1;67374:6020:0;;-1:-1:-1;;;;;5:28;;2:2;;;46:1;43;36:12;2:2;67374:6020:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;67374:6020:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;67374:6020:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;67374:6020:0;;-1:-1:-1;67374:6020:0;;-1:-1:-1;;;;;67374:6020:0:i;86269:166::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;86269:166:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;86269:166:0;;;;;;;;:::i;11025:180::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11025:180:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;11025:180:0;;;;;;;;;;:::i;5450:118::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5450:118:0;;;:::i;39331:134::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;39331:134:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;39331:134:0;;;;;;;;;;;;;;;;;:::i;3661:109::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3661:109:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3661:109:0;-1:-1:-1;;;;;3661:109:0;;:::i;12237:272::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;12237:272:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;12237:272:0;;:::i;8495:57::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8495:57:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8495:57:0;-1:-1:-1;;;;;8495:57:0;;:::i;17083:161::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;17083:161:0;;;:::i;59438:32::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;59438:32:0;;;:::i;4703:78::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4703:78:0;;;:::i;79059:2504::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;79059:2504:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;79059:2504:0;;:::i;35700:181::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;35700:181:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;35700:181:0;;:::i;12835:179::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;12835:179:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;12835:179:0;;:::i;84129:633::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;84129:633:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;84129:633:0;;:::i;3878:77::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3878:77:0;;;:::i;74754:3274::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;74754:3274:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;74754:3274:0;;:::i;35316:153::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;35316:153:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;35316:153:0;-1:-1:-1;;;;;35316:153:0;;:::i;24496:1393::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;24496:1393:0;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;24496:1393:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;24496:1393:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;24496:1393:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;24496:1393:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;24496:1393:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;24496:1393:0;;-1:-1:-1;24496:1393:0;;-1:-1:-1;;;;;24496:1393:0:i;1439:140::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1439:140:0;;;:::i;8109:59::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8109:59:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8109:59:0;-1:-1:-1;;;;;8109:59:0;;:::i;3778:92::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3778:92:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3778:92:0;-1:-1:-1;;;;;3778:92:0;;:::i;5239:116::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5239:116:0;;;:::i;726:79::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;726:79:0;;;:::i;1061:92::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1061:92:0;;;:::i;10482:89::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;10482:89:0;;;:::i;82965:300::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;82965:300:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;82965:300:0;;:::i;37358:217::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;37358:217:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;37358:217:0;;;;;;;;;;:::i;9532:41::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9532:41:0;;;:::i;40184:214::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;40184:214:0;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;;;;;40184:214:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;40184:214:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;40184:214:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;40184:214:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;40184:214:0;;-1:-1:-1;40184:214:0;;-1:-1:-1;;;;;40184:214:0:i;11651:172::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11651:172:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;11651:172:0;;;;;;;;;;:::i;19357:828::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;19357:828:0;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;19357:828:0;;;;;;;;-1:-1:-1;;;;;19357:828:0;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;19357:828:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;19357:828:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;19357:828:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;19357:828:0;;-1:-1:-1;19357:828:0;;-1:-1:-1;;;;;19357:828:0:i;59780:45::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;59780:45:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;59780:45:0;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;59780:45:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13504:309;;8:9:-1;5:2;;;30:1;27;20:12;5:2;13504:309:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;13504:309:0;;:::i;59551:35::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;59551:35:0;;;:::i;37904:147::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;37904:147:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;37904:147:0;;;;;;;;;;:::i;9267:47::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9267:47:0;;;:::i;1756:109::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1756:109:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1756:109:0;-1:-1:-1;;;;;1756:109:0;;:::i;32847:135::-;-1:-1:-1;;;;;;32941:33:0;;32917:4;32941:33;;;:20;:33;;;;;;;;32847:135;;;;:::o;10265:103::-;10330:30;;;;;;;;;;;;-1:-1:-1;;;10330:30:0;;;;10265:103;:::o;36904:154::-;36963:7;36991:16;36999:7;36991;:16::i;:::-;36983:25;;;;;;-1:-1:-1;37026:24:0;;;;:15;:24;;;;;;-1:-1:-1;;;;;37026:24:0;;36904:154::o;36312:299::-;36376:13;36392:16;36400:7;36392;:16::i;:::-;36376:32;;36433:5;-1:-1:-1;;;;;36427:11:0;:2;-1:-1:-1;;;;;36427:11:0;;;36419:20;;;;;;36458:10;-1:-1:-1;;;;;36458:19:0;;;;:58;;;36481:35;36498:5;36505:10;36481:16;:35::i;:::-;36450:67;;;;;;36530:24;;;;:15;:24;;;;;;:29;;-1:-1:-1;;;;;;36530:29:0;-1:-1:-1;;;;;36530:29:0;;;;;;;;;36575:28;;36530:24;;36575:28;;;;;;;36312:299;;;:::o;60030:55::-;;;;;;;;;;;;;;;:::o;9002:45::-;;;;:::o;38494:184::-;38585:39;38604:10;38616:7;38585:18;:39::i;:::-;38577:48;;;;;;38638:32;38652:4;38658:2;38662:7;38638:13;:32::i;:::-;38494:184;;;:::o;67374:6020::-;4940:7;;;;4939:8;4931:17;;;;;;6632:13;:18;;6649:1;6632:18;;;;;68178:16;;:::i;:::-;-1:-1:-1;68197:782:0;;;;;;;;68225:13;;68197:782;;;;;;;;;;;;;;;;;;;;;68458:3;68197:782;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;68197:782:0;;;;;;;;;;;;;68852:10;68197:782;;;;68909:57;;;68197:782;;;;69038:55;;;;69030:113;;;;-1:-1:-1;;;69030:113:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;69192:19;;69170:4;:17;;;69162:26;;:49;;69154:105;;;;-1:-1:-1;;;69154:105:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;69286:17;;;;69278:26;;69270:72;;;;;-1:-1:-1;;;69270:72:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;69404:21;;69369:4;:30;;;69361:39;;:64;69353:131;;;;-1:-1:-1;;;69353:131:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;69636:26;;;;-1:-1:-1;;;;;69609:54:0;;;;;:26;:54;;;;;;;;69601:135;;;;-1:-1:-1;;;69601:135:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;69780:26;;;;-1:-1:-1;;;;;69755:52:0;;;;;:24;:52;;;;;;;;69747:135;;;;-1:-1:-1;;;69747:135:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;70346:10;70321:36;;;;:24;:36;;;;;;;;70358:27;;70321:65;;;;;;;;;;70320:66;70312:183;;;;-1:-1:-1;;;70312:183:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;70531:10;70506:36;;;;:24;:36;;;;;;;;70543:27;;70506:65;;;;;;;:72;;-1:-1:-1;;70506:72:0;70574:4;70506:72;;;-1:-1:-1;;;;;70598:33:0;;;;;;;;;;70632:27;;;;70598:62;;;;;;;;;70597:63;70589:176;;;;-1:-1:-1;;;70589:176:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;70776:33:0;;;;;;:24;:33;;;;;;;;70810:27;;;;70776:62;;;;;;;:69;;-1:-1:-1;;70776:69:0;70841:4;70776:69;;;70955:20;;;;70916:245;;70810:24;;70990:27;;;;71049:4;:26;;;71090:10;71132:18;70916:24;:245::i;:::-;70908:287;;;;;-1:-1:-1;;;70908:287:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;71214:516;71251:4;:24;;;71290:4;:27;;;71332:4;:20;;;71367:4;:17;;;71214:516;;71399:4;:45;;;71214:516;;71459:4;:30;;;71214:516;;71504:24;71529:1;71504:27;;;;;;;;;;;71561:4;:26;;;71602:4;:26;;;71643:7;71665:4;:23;;;71703:16;71214:22;:516::i;:::-;71206:556;;;;;-1:-1:-1;;;71206:556:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;71922:13;;;71909:27;;;;:12;:27;;;;;;;;;:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;71909:34:0;;;;;;;;;;;-1:-1:-1;;71909:34:0;-1:-1:-1;;;71909:34:0;;;;;;-1:-1:-1;;;;71909:34:0;-1:-1:-1;;;71909:34:0;;;;;;;;;;;-1:-1:-1;;;;71909:34:0;-1:-1:-1;;;71909:34:0;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;71909:34:0;;;-1:-1:-1;;;;;71909:34:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;71909:34:0;-1:-1:-1;;;71909:34:0;;;;;;;;;;;;;;71970:13;;:20;;:13;;71909:34;71970:17;:20;:::i;:::-;71954:13;:36;72065:16;;:23;;72086:1;72065:23;:20;:23;:::i;:::-;72046:16;:42;;;72127:26;;-1:-1:-1;72107:46:0;72099:132;;;;-1:-1:-1;;;72099:132:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;72361:26;;;;72429:20;;;;72353:97;;;-1:-1:-1;;;72353:97:0;;72402:10;72353:97;;;;72422:4;72353:97;;;;;;;;;;;;-1:-1:-1;;;;;72353:48:0;;;;;;:97;;;;;-1:-1:-1;;72353:97:0;;;;;;;;-1:-1:-1;72353:48:0;:97;;;5:2:-1;;;;30:1;27;20:12;5:2;72353:97:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;;72526:26:0;;;;72588:24;;;;;72519:94;;;-1:-1:-1;;;72519:94:0;;-1:-1:-1;;;;;72519:94:0;;;;;;;72576:10;72519:94;;;;;;;;;;;;;:47;;;;;-1:-1:-1;72519:47:0;;:94;;;;;72588:24;72519:94;;;;;;-1:-1:-1;72519:47:0;:94;;;5:2:-1;;;;30:1;27;20:12;5:2;72519:94:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;72519:94:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;72794:11:0;;72779:27;;72785:7;;72779:5;:27::i;:::-;72899:487;72925:4;:11;;;72951:10;72993:7;73015:4;:24;;;73054:4;:27;;;73096:4;:20;;;73131:3;73178:4;:17;;;73210:4;:45;;;73270:4;:26;;;73311:4;:26;;;73352:4;:23;;;72899:487;;;;;;;;;-1:-1:-1;;;;;72899:487:0;-1:-1:-1;;;;;72899:487:0;;;;;;-1:-1:-1;;;;;72899:487:0;-1:-1:-1;;;;;72899:487:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;72899:487:0;-1:-1:-1;;;;;72899:487:0;;;;;;-1:-1:-1;;;;;72899:487:0;-1:-1:-1;;;;;72899:487:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6708:1;6744:13;;6728:12;:29;6720:38;;;;;;4959:1;67374:6020;;;;;;;;;;;;:::o;86269:166::-;-1:-1:-1;;;;;86388:31:0;;86364:4;86388:31;;;:24;:31;;;;;;;;:39;;;;;;;;;;;86269:166;;;;;:::o;11025:180::-;938:9;:7;:9::i;:::-;930:18;;;;;;-1:-1:-1;;;;;11135:42:0;;;;;;;;:26;:42;;;;;:62;;-1:-1:-1;;11135:62:0;;;;;;;;;;11025:180::o;5450:118::-;3612:20;3621:10;3612:8;:20::i;:::-;3604:29;;;;;;5119:7;;;;5111:16;;;;;;5509:7;:15;;-1:-1:-1;;5509:15:0;;;5540:20;;;5549:10;5540:20;;;;;;;;;;;;;5450:118::o;39331:134::-;39418:39;39435:4;39441:2;39445:7;39418:39;;;;;;;;;;;;:16;:39::i;3661:109::-;3717:4;3741:21;:8;3754:7;3741:21;:12;:21;:::i;12237:272::-;938:9;:7;:9::i;:::-;930:18;;;;;;12370:19;12343:46;;;12335:110;;;;-1:-1:-1;;;12335:110:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12456:19;:45;12237:272::o;8495:57::-;;;;;;;;;;;;;;;:::o;17083:161::-;17197:9;17083:161;:::o;59438:32::-;;;;:::o;4703:78::-;4766:7;;;;4703:78;:::o;79059:2504::-;6632:13;:18;;6649:1;6632:18;;;;;:13;79362:31;;;:22;:31;;;;;;;;79361:32;79353:87;;;;-1:-1:-1;;;79353:87:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;79563:16;;:::i;:::-;-1:-1:-1;79582:21:0;;;;:12;:21;;;;;;;;79563:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;79563:40:0;;;;;;;;;;;;-1:-1:-1;;;79563:40:0;;;;;;;;-1:-1:-1;;;79563:40:0;;;;;;;;;;;;;-1:-1:-1;;;;;79563:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;79563:40:0;;;;;;;;;;;;;79582:21;79750:61;;79563:40;;;79750:33;:61;:::i;:::-;79723:88;;79836:16;79830:3;:22;79822:58;;;;;-1:-1:-1;;;79822:58:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;80001:14;80018:16;80026:7;80018;:16::i;:::-;80189:31;;;;:22;:31;;;;;:38;;-1:-1:-1;;80189:38:0;80223:4;80189:38;;;;;;80302:16;;80001:33;;-1:-1:-1;80302:23:0;;:16;:23;:20;:23;:::i;:::-;80283:16;:42;80520:26;;;;80561:20;;;;80484:129;;80520:26;80596:6;80484:21;:129::i;:::-;80476:178;;;;-1:-1:-1;;;80476:178:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;80859:14;80865:7;80859:5;:14::i;:::-;81017:13;;;;81066:24;;;;;81105:20;;;;;81189:26;;;;;80966:260;;;;;;-1:-1:-1;;;;;80966:260:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;81171:3;80966:260;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;81534:21:0;;;;:12;:21;;;;;81527:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;81527:28:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;81527:28:0;;;6744:13;6728:29;;6720:38;;;;;;79059:2504;;:::o;35700:181::-;35755:7;35791:20;;;:11;:20;;;;;;-1:-1:-1;;;;;35791:20:0;35830:19;35822:28;;;;;12835:179;938:9;:7;:9::i;:::-;930:18;;;;;;12947:26;:59;12835:179::o;84129:633::-;84192:7;84232:21;;;:12;:21;;;;;84267:23;;;;-1:-1:-1;;;84267:23:0;;;;84264:491;;84322:27;;;;-1:-1:-1;84315:34:0;;84264:491;84435:18;;;;84382:34;;84419:36;;:3;;84435:18;;84419:36;:7;:36;:::i;:::-;84512:24;;;;84538:27;;;;84603:17;;;;84382:73;;-1:-1:-1;84470:19:0;;84492:186;;84512:24;84538:27;84382:73;;84603:17;-1:-1:-1;;;84603:17:0;;;;;-1:-1:-1;;;84631:45:0;;;84492:19;:186::i;:::-;84701:24;;;;84470:208;;-1:-1:-1;84700:43:0;;84470:208;84700:43;:30;:43;:::i;:::-;84693:50;;;;;;;3878:77;3922:25;3936:10;3922:13;:25::i;:::-;3878:77::o;74754:3274::-;6632:13;:18;;6649:1;6632:18;;;;;:13;75048:31;;;:22;:31;;;;;;;;75047:32;75039:87;;;;-1:-1:-1;;;75039:87:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;75249:16;;:::i;:::-;-1:-1:-1;75268:21:0;;;;:12;:21;;;;;;;;;75249:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;75249:40:0;;;;;;;;;;-1:-1:-1;;;75249:40:0;;;;;;;;-1:-1:-1;;;75249:40:0;;;;;;;;;;;;-1:-1:-1;;;;;75249:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;75249:40:0;;;;;;;;;;;;75422:10;:27;75414:108;;;;-1:-1:-1;;;75414:108:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;75592:14;75609:16;75617:7;75609;:16::i;:::-;75592:33;;75697:19;75719:59;75753:4;:24;;;75720:4;:27;;;75719:33;;:59;;;;:::i;:::-;75697:81;;75792:4;:23;;;:31;;75819:4;75792:31;;;75789:372;;;75853:296;75891:4;:24;;;75934:4;:27;;;75980:36;75996:4;:18;;;75988:27;;75980:3;:7;;:36;;;;:::i;:::-;76043:4;:17;;;76035:26;;76088:4;:45;;;76080:54;;75853:19;:296::i;:::-;75839:310;;75789:372;76171:16;76190:70;76207:11;76228:4;:30;;;76220:39;;76190:16;:70::i;:::-;76171:89;;76271:20;76294:59;76344:8;76295:43;76326:11;76296:4;:24;;;76295:30;;:43;;;;:::i;:::-;76294:49;:59;:49;:59;:::i;:::-;76504:31;;;;:22;:31;;;;;:38;;-1:-1:-1;;76504:38:0;76538:4;76504:38;;;;;;76617:16;;76271:82;;-1:-1:-1;76617:23:0;;:16;:23;:20;:23;:::i;:::-;76598:16;:42;76740:26;;;;76781:13;;;;76733:84;;;-1:-1:-1;;;76733:84:0;;-1:-1:-1;;;;;76733:84:0;;;;;;;;;;;;;;;;;;;;;;:47;;;;;;;:84;;;;;;;;;;;;;;-1:-1:-1;76733:47:0;:84;;;5:2:-1;;;;30:1;27;20:12;5:2;76733:84:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;76733:84:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;76887:26:0;;;;76928:13;;;;-1:-1:-1;;;;;76880:47:0;;;;;;76943:7;:5;:7::i;:::-;76952:8;76880:81;;;;;;;;;;;;;-1:-1:-1;;;;;76880:81:0;-1:-1:-1;;;;;76880:81:0;;;;;;-1:-1:-1;;;;;76880:81:0;-1:-1:-1;;;;;76880:81:0;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;76880:81:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;76880:81:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;77082:26:0;;;;77123:20;;;;77158:13;;;;77046:136;;77082:26;77123:20;77046:21;:136::i;:::-;77038:185;;;;-1:-1:-1;;;77038:185:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;77286:14;77292:7;77286:5;:14::i;:::-;77393:298;77418:7;77440:4;:13;;;77468:6;77489:4;:24;;;77528:4;:20;;;77563:12;77590:8;77613:4;:26;;;77654:4;:26;;;77393:298;;;;;;;;;-1:-1:-1;;;;;77393:298:0;-1:-1:-1;;;;;77393:298:0;;;;;;-1:-1:-1;;;;;77393:298:0;-1:-1:-1;;;;;77393:298:0;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;77393:298:0;-1:-1:-1;;;;;77393:298:0;;;;;;-1:-1:-1;;;;;77393:298:0;-1:-1:-1;;;;;77393:298:0;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;77999:21:0;;;;:12;:21;;;;;77992:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;77992:28:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;77992:28:0;;;6744:13;6728:29;;;-1:-1:-1;6720:38:0;;-1:-1:-1;6720:38:0;;;;35316:153;35371:7;-1:-1:-1;;;;;35399:19:0;;35391:28;;;;;;-1:-1:-1;;;;;;35437:24:0;;;;;:17;:24;;;;;;;35316:153::o;24496:1393::-;25018:4;-1:-1:-1;;;;;25038:21:0;;25035:847;;-1:-1:-1;25082:5:0;25075:12;;25035:847;25120:15;25160:12;:10;:12::i;:::-;25150:22;;25187:15;25250:20;25289:23;25331:16;25366:13;25398:41;25458:22;25499:12;25530:22;25571;25612:7;25638:19;25676:7;25215:483;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;25215:483:0;-1:-1:-1;;;;;25215:483:0;;;;;;;;-1:-1:-1;;;;;25215:483:0;-1:-1:-1;;;;;25215:483:0;;;;;;;;-1:-1:-1;;;;;25215:483:0;-1:-1:-1;;;;;25215:483:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;25215:483:0;;;25205:494;;;;;;25187:512;;25716:32;25751;:7;:30;:32::i;:::-;25716:67;-1:-1:-1;;;;;;25808:61:0;;:50;25716:67;25841:16;25808:50;:32;:50;:::i;:::-;-1:-1:-1;;;;;25808:61:0;;25800:70;;;;;25035:847;24496:1393;;;;;;;;;;;;;;:::o;1439:140::-;938:9;:7;:9::i;:::-;930:18;;;;;;1522:6;;;1501:40;;;-1:-1:-1;;;;;1522:6:0;;;1501:40;;;;;;;;;;;;;;;;;;;;;;1569:1;1552:19;;-1:-1:-1;;;;;;1552:19:0;;;1439:140::o;8109:59::-;;;;;;;;;;;;;;;:::o;3778:92::-;3612:20;3621:10;3612:8;:20::i;:::-;3604:29;;;;;;3843:19;3854:7;3843:10;:19::i;:::-;3778:92;:::o;5239:116::-;3612:20;3621:10;3612:8;:20::i;:::-;3604:29;;;;;;4940:7;;;;4939:8;4931:17;;;;;;5299:7;:14;;-1:-1:-1;;5299:14:0;5309:4;5299:14;;;5329:18;;;5336:10;5329:18;;;;;;;;;;;;;5239:116::o;726:79::-;764:7;791:6;-1:-1:-1;;;;;791:6:0;726:79;:::o;1061:92::-;1101:4;1139:6;-1:-1:-1;;;;;1139:6:0;1125:10;:20;;1061:92::o;10482:89::-;10549:14;;;;;;;;;;;;-1:-1:-1;;;10549:14:0;;;;10482:89;:::o;82965:300::-;83083:10;83058:36;;;;:24;:36;;;;;;;;:44;;;;;;;;;;;83057:45;83049:146;;;;-1:-1:-1;;;83049:146:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;83231:10;83206:36;;;;:24;:36;;;;;;;;:44;;;;;;;:51;;-1:-1:-1;;83206:51:0;83253:4;83206:51;;;82965:300::o;37358:217::-;-1:-1:-1;;;;;37438:16:0;;37444:10;37438:16;;37430:25;;;;;;37485:10;37466:30;;;;:18;:30;;;;;;;;-1:-1:-1;;;;;37466:34:0;;;;;;;;;;;;:45;;-1:-1:-1;;37466:45:0;;;;;;;;;;37527:40;;;;;;;37466:34;;37485:10;37527:40;;;;;;;;;;;37358:217;;:::o;9532:41::-;;;;:::o;40184:214::-;40291:31;40304:4;40310:2;40314:7;40291:12;:31::i;:::-;40341:48;40364:4;40370:2;40374:7;40383:5;40341:22;:48::i;:::-;40333:57;;;;;;40184:214;;;;:::o;11651:172::-;938:9;:7;:9::i;:::-;930:18;;;;;;-1:-1:-1;;;;;11757:38:0;;;;;;;;:24;:38;;;;;:58;;-1:-1:-1;;11757:58:0;;;;;;;;;;11651:172::o;19357:828::-;19597:4;-1:-1:-1;;;;;19617:23:0;;19614:564;;-1:-1:-1;19663:5:0;19656:12;;19614:564;19701:15;19741:12;:10;:12::i;:::-;19796:194;;;;;;;;;;;;;;;;-1:-1:-1;;19796:194:0;;;;;;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;19796:194:0;;;;;;;19786:205;;;;;19731:22;;-1:-1:-1;19768:15:0;20043:32;19786:205;20043:30;:32::i;:::-;20008:67;-1:-1:-1;;;;;;20100:65:0;;:52;20008:67;20133:18;20100:52;:32;:52;:::i;:::-;-1:-1:-1;;;;;20100:65:0;;20092:74;;;;;19614:564;19357:828;;;;;;;:::o;59780:45::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;59780:45:0;;;;;-1:-1:-1;;;59780:45:0;;;;;-1:-1:-1;;;59780:45:0;;;;;;;-1:-1:-1;;;;;59780:45:0;;;;;;;;;;;-1:-1:-1;;;59780:45:0;;;;;:::o;13504:309::-;938:9;:7;:9::i;:::-;930:18;;;;;;13630:5;13601:25;:34;;13593:94;;;;-1:-1:-1;;;13593:94:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13698:21;:49;;;13763:42;;;;;;;;;;;;;;;;;13504:309;:::o;59551:35::-;;;;:::o;37904:147::-;-1:-1:-1;;;;;38008:25:0;;;37984:4;38008:25;;;:18;:25;;;;;;;;:35;;;;;;;;;;;;;;;37904:147::o;9267:47::-;;;;:::o;1756:109::-;938:9;:7;:9::i;:::-;930:18;;;;;;1829:28;1848:8;1829:18;:28::i;40594:155::-;40651:4;40684:20;;;:11;:20;;;;;;-1:-1:-1;;;;;40684:20:0;40722:19;;;40594:155::o;41121:249::-;41206:4;41223:13;41239:16;41247:7;41239;:16::i;:::-;41223:32;;41285:5;-1:-1:-1;;;;;41274:16:0;:7;-1:-1:-1;;;;;41274:16:0;;:51;;;;41318:7;-1:-1:-1;;;;;41294:31:0;:20;41306:7;41294:11;:20::i;:::-;-1:-1:-1;;;;;41294:31:0;;41274:51;:87;;;;41329:32;41346:5;41353:7;41329:16;:32::i;:::-;41266:96;41121:249;-1:-1:-1;;;;41121:249:0:o;43164:414::-;43278:4;-1:-1:-1;;;;;43258:24:0;:16;43266:7;43258;:16::i;:::-;-1:-1:-1;;;;;43258:24:0;;43250:33;;;;;;-1:-1:-1;;;;;43302:16:0;;43294:25;;;;;;43332:23;43347:7;43332:14;:23::i;:::-;-1:-1:-1;;;;;43394:23:0;;;;;;:17;:23;;;;;;:30;;43422:1;43394:30;:27;:30;:::i;:::-;-1:-1:-1;;;;;43368:23:0;;;;;;;:17;:23;;;;;;:56;;;;43459:21;;;;;;;:28;;43485:1;43459:28;:25;:28;:::i;:::-;-1:-1:-1;;;;;43435:21:0;;;;;;;:17;:21;;;;;;;;:52;;;;43500:20;;;:11;:20;;;;;:25;;-1:-1:-1;;;;;;43500:25:0;;;;;43543:27;;43512:7;;43435:21;;43543:27;;;;;;43164:414;;;:::o;30448:150::-;30506:7;30538:5;;;30562:6;;;;30554:15;;;;;;30589:1;30448:150;-1:-1:-1;;;30448:150:0:o;41621:286::-;-1:-1:-1;;;;;41693:16:0;;41685:25;;;;;;41730:16;41738:7;41730;:16::i;:::-;41729:17;41721:26;;;;;;41760:20;;;;:11;:20;;;;;;;;:25;;-1:-1:-1;;;;;;41760:25:0;-1:-1:-1;;;;;41760:25:0;;;;;;;;41820:21;;:17;:21;;;;;;:28;;-1:-1:-1;41820:25:0;:28::i;:::-;-1:-1:-1;;;;;41796:21:0;;;;;;:17;:21;;;;;;:52;;;;41866:33;;41891:7;;41796:21;41866:33;;41796:21;;41866:33;41621:286;;:::o;3061:165::-;3133:4;-1:-1:-1;;;;;3158:21:0;;3150:30;;;;;;-1:-1:-1;;;;;;3198:20:0;:11;:20;;;;;;;;;;;;;;;3061:165::o;30212:150::-;30270:7;30303:1;30298;:6;;30290:15;;;;;;-1:-1:-1;30328:5:0;;;30212:150::o;91111:513::-;91218:4;91274:26;91303:54;91324:12;91338:6;91346:10;91303:20;:54::i;:::-;91274:83;;91371:21;91368:249;;;91415:4;91408:11;;;;;91368:249;91491:22;91516:50;91533:12;91547:6;91555:10;91516:16;:50::i;:::-;91491:75;-1:-1:-1;91581:24:0;;-1:-1:-1;;91581:24:0;42689:92;42741:32;42747:16;42755:7;42747;:16::i;:::-;42765:7;42741:5;:32::i;87945:798::-;88184:7;;88245:89;88327:5;88246:67;:20;88271:41;88246:67;:24;:67;:::i;:::-;88245:73;:89;:73;:89;:::i;:::-;88204:130;-1:-1:-1;88345:39:0;88387:97;88457:26;88388:63;88204:130;88423:27;88388:63;:34;:63;:::i;88387:97::-;88345:139;-1:-1:-1;88558:23:0;88498:57;:20;88345:139;88498:57;:24;:57;:::i;:::-;:83;88495:241;;;88604:49;:23;88632:20;88604:49;:27;:49;:::i;:::-;88597:56;;;;;;88495:241;88693:31;-1:-1:-1;88686:38:0;;-1:-1:-1;88686:38:0;4093:130;4153:24;:8;4169:7;4153:24;:15;:24;:::i;:::-;4193:22;;-1:-1:-1;;;;;4193:22:0;;;;;;;;4093:130;:::o;89627:188::-;89730:7;89754:53;89801:5;89755:40;:12;89772:22;89755:40;:16;:40;:::i;15689:269::-;15891:58;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;15891:58:0;;;;;;;15881:69;;;;;;15689:269::o;14475:1057::-;14553:7;14573:9;14593;14613:7;14676:9;:16;14696:2;14676:22;14672:74;;14731:1;14715:19;;;;;;;14672:74;-1:-1:-1;;;15047:4:0;15032:20;;15026:27;15093:4;15078:20;;15072:27;15147:4;15132:20;;15126:27;15123:1;15118:36;15277:2;15273:6;;15269:46;;;15301:2;15296:7;15269:46;15395:1;:7;;15400:2;15395:7;;:18;;;;;15406:1;:7;;15411:2;15406:7;;15395:18;15391:134;;;15446:1;15430:19;;;;;;;15391:134;15489:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;15489:24:0;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;15489:24:0;;;;;;;;15482:31;;;;;;;3963:122;4020:21;:8;4033:7;4020:21;:12;:21;:::i;:::-;4057:20;;-1:-1:-1;;;;;4057:20:0;;;;;;;;3963:122;:::o;44112:356::-;44234:4;44261:15;:2;-1:-1:-1;;;;;44261:13:0;;:15::i;:::-;44256:60;;-1:-1:-1;44300:4:0;44293:11;;44256:60;44344:70;;-1:-1:-1;;;44344:70:0;;44381:10;44344:70;;;;;;-1:-1:-1;;;;;44344:70:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;44328:13;;44344:36;;;;;;44381:10;;44393:4;;44399:7;;44408:5;;44344:70;;;;;;;;;;;44328:13;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;44344:70:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;44344:70:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;44344:70:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;44344:70:0;-1:-1:-1;;;;;;44433:26:0;-1:-1:-1;;;44433:26:0;;-1:-1:-1;;44112:356:0;;;;;;:::o;2015:187::-;-1:-1:-1;;;;;2089:22:0;;2081:31;;;;;;2149:6;;2128:38;;;-1:-1:-1;;;;;2149:6:0;;;2128:38;;;;;;;;;;;;;;;;;;;;;2177:6;:17;;-1:-1:-1;;;;;;2177:17:0;-1:-1:-1;;;;;2177:17:0;;;;;;;;;;2015:187::o;44635:175::-;44735:1;44699:24;;;:15;:24;;;;;;-1:-1:-1;;;;;44699:24:0;:38;44695:108;;44789:1;44754:24;;;:15;:24;;;;;:37;;-1:-1:-1;;;;;;44754:37:0;;;44635:175::o;92385:957::-;92765:85;;;92836:4;92765:85;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;92765:85:0;;;;;;;25:18:-1;;61:17;;-1:-1;;;;;182:15;-1:-1;;;179:29;160:49;;92747:104:0;;;;92491:4;;-1:-1:-1;;;;;92747:17:0;;;92765:85;92747:104;;;25:18:-1;92747:104:0;;25:18:-1;36:153;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;92747:104:0;;;;;;;;;;;;;;;;;;;;;;;;14:1:-1;21;16:31;;;;75:4;69:11;64:16;;144:4;140:9;133:4;115:16;111:27;107:43;104:1;100:51;94:4;87:65;169:16;166:1;159:27;225:16;222:1;215:4;212:1;208:12;193:49;7:242;;16:31;36:4;31:9;;7:242;-1:-1;;93206:102:0;;;93282:4;93206:102;;;;-1:-1:-1;;;;;93206:102:0;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;93206:102:0;;;;;;;25:18:-1;;61:17;;-1:-1;;;;;182:15;-1:-1;;;179:29;160:49;;93188:121:0;;;;93170:12;;-1:-1:-1;93188:17:0;;;;:121;;;;25:18:-1;93188:121:0;;25:18:-1;36:153;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;93188:121:0;;;;;;;;;;;;;;;;;;;;;;;;14:1:-1;21;16:31;;;;75:4;69:11;64:16;;144:4;140:9;133:4;115:16;111:27;107:43;104:1;100:51;94:4;87:65;169:16;166:1;159:27;225:16;222:1;215:4;212:1;208:12;193:49;7:242;;16:31;36:4;31:9;;7:242;-1:-1;93169:140:0;;92385:957;-1:-1:-1;;;;;;92385:957:0:o;94099:691::-;94662:94;;;-1:-1:-1;;;;;94662:94:0;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;94662:94:0;;;;;;;25:18:-1;;61:17;;-1:-1;;;;;182:15;-1:-1;;;179:29;160:49;;94644:113:0;;;;94201:4;;;;94644:17;;;;94662:94;94644:113;;;25:18:-1;94644:113:0;;25:18:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;42189:314:0;42284:5;-1:-1:-1;;;;;42264:25:0;:16;42272:7;42264;:16::i;:::-;-1:-1:-1;;;;;42264:25:0;;42256:34;;;;;;42303:23;42318:7;42303:14;:23::i;:::-;-1:-1:-1;;;;;42366:24:0;;;;;;:17;:24;;;;;;:31;;42395:1;42366:31;:28;:31;:::i;:::-;-1:-1:-1;;;;;42339:24:0;;;;;;:17;:24;;;;;;;;:58;;;;42408:20;;;:11;:20;;;;;:33;;-1:-1:-1;;;;;;42408:33:0;;;42459:36;;42420:7;;42339:24;;42459:36;;42339:24;;42459:36;42189:314;;:::o;29207:433::-;29265:7;29509:6;29505:47;;-1:-1:-1;29539:1:0;29532:8;;29505:47;29576:5;;;29580:1;29576;:5;:1;29600:5;;;;;:10;29592:19;;;;;29773:303;29831:7;29930:1;29926;:5;29918:14;;;;;;29943:9;29959:1;29955;:5;;;;;;;29773:303;-1:-1:-1;;;;29773:303:0:o;2778:189::-;-1:-1:-1;;;;;2858:21:0;;2850:30;;;;;;2899:18;2903:4;2909:7;2899:3;:18::i;:::-;2891:27;;;;;;-1:-1:-1;;;;;2931:20:0;2954:5;2931:20;;;;;;;;;;;:28;;-1:-1:-1;;2931:28:0;;;2778:189::o;2513:186::-;-1:-1:-1;;;;;2590:21:0;;2582:30;;;;;;2632:18;2636:4;2642:7;2632:3;:18::i;:::-;2631:19;2623:28;;;;;;-1:-1:-1;;;;;2664:20:0;:11;:20;;;;;;;;;;;:27;;-1:-1:-1;;2664:27:0;2687:4;2664:27;;;2513:186::o;31396:627::-;31968:20;32007:8;;;31396:627::o;48653:46447::-;;;;;;;;;-1:-1:-1;48653:46447:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o

Swarm Source

bzzr://6fc95585979ded1d84626280fb19b06abd4788867d183f9709d0061eff2c4558
Loading...
Loading
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.