ETH Price: $2,517.73 (-5.17%)

Contract

0x6685691e0370d9b6FC70421D7a64071Ed1E2fb2f
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Only Exit Lo...163678522023-01-09 7:49:11661 days ago1673250551IN
0x6685691e...Ed1E2fb2f
0 ETH0.0003706214.29117829
Set Only Exit Lo...156951342022-10-07 8:48:47755 days ago1665132527IN
0x6685691e...Ed1E2fb2f
0 ETH0.000272725.95018896
Liquidate Loan154403672022-08-30 12:30:14793 days ago1661862614IN
0x6685691e...Ed1E2fb2f
0 ETH0.0032773525.33890988
Repay Loan154343752022-08-29 13:36:13794 days ago1661780173IN
0x6685691e...Ed1E2fb2f
0 ETH0.0016605115.41713323
Create Loan154324112022-08-29 5:57:57794 days ago1661752677IN
0x6685691e...Ed1E2fb2f
0 ETH0.002196095.6829863
Create Loan154323312022-08-29 5:38:19794 days ago1661751499IN
0x6685691e...Ed1E2fb2f
0 ETH0.003857269.65688244
Repay Loan154315292022-08-29 2:33:46794 days ago1661740426IN
0x6685691e...Ed1E2fb2f
0 ETH0.0036653924.09338259
Create Loan154314662022-08-29 2:17:18794 days ago1661739438IN
0x6685691e...Ed1E2fb2f
0 ETH0.0049931512.16347004
Repay Loan154313652022-08-29 2:00:01794 days ago1661738401IN
0x6685691e...Ed1E2fb2f
0 ETH0.000850575.13423767
Create Loan154313342022-08-29 1:55:45794 days ago1661738145IN
0x6685691e...Ed1E2fb2f
0 ETH0.004233869.9140822
Repay Loan154290682022-08-28 17:12:26795 days ago1661706746IN
0x6685691e...Ed1E2fb2f
0 ETH0.0017084116.45851339
Create Loan154254592022-08-28 3:14:08795 days ago1661656448IN
0x6685691e...Ed1E2fb2f
0 ETH0.001600284.37104876
Liquidate Loan154120902022-08-25 23:54:52797 days ago1661471692IN
0x6685691e...Ed1E2fb2f
0 ETH0.0012956915.48171788
Repay Loan154046772022-08-24 19:13:37799 days ago1661368417IN
0x6685691e...Ed1E2fb2f
0 ETH0.000995879.90459227
Create Loan154040522022-08-24 16:51:37799 days ago1661359897IN
0x6685691e...Ed1E2fb2f
0 ETH0.0066550618.62317553
Repay Loan153950922022-08-23 6:40:45800 days ago1661236845IN
0x6685691e...Ed1E2fb2f
0 ETH0.000699716.48376317
Create Loan153950832022-08-23 6:39:31800 days ago1661236771IN
0x6685691e...Ed1E2fb2f
0 ETH0.002537647.53782006
Create Loan153944992022-08-23 4:32:33800 days ago1661229153IN
0x6685691e...Ed1E2fb2f
0 ETH0.002941758.51085676
Liquidate Loan153934272022-08-23 0:24:51800 days ago1661214291IN
0x6685691e...Ed1E2fb2f
0 ETH0.000966678.80102411
Liquidate Loan153874212022-08-22 1:33:08801 days ago1661131988IN
0x6685691e...Ed1E2fb2f
0 ETH0.0012019413.94494786
Repay Loan153863842022-08-21 21:40:26801 days ago1661118026IN
0x6685691e...Ed1E2fb2f
0 ETH0.000869638.05830653
Create Loan153863772022-08-21 21:38:59801 days ago1661117939IN
0x6685691e...Ed1E2fb2f
0 ETH0.00296078.7939724
Repay Loan153863182022-08-21 21:24:49801 days ago1661117089IN
0x6685691e...Ed1E2fb2f
0 ETH0.00104529.68513866
Create Loan153863082022-08-21 21:22:35801 days ago1661116955IN
0x6685691e...Ed1E2fb2f
0 ETH0.002826928.39742661
Repay Loan153862862022-08-21 21:17:36801 days ago1661116656IN
0x6685691e...Ed1E2fb2f
0 ETH0.000914568.47465036
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
UsdbLending

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 16 : UsdbLending.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.14;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";

import "./interfaces/ICryptoPunksMarket.sol";
import "./UsdbLendingCore.sol";

/// @notice liqd lending and borrowing contract
contract UsdbLending is Ownable, ReentrancyGuard, ERC721Holder, ERC1155Holder, LendingCore {

    address public DAO;
    uint256 public id;
    uint256 internal durationUnit = 86400; // Unit: 1 day
    bool internal onlyExitLoan;
    bool internal canChangeDurationUnit;
    mapping(bytes => bool) internal usedSignatures;

    constructor(address _DAO, bool _canChangeDurationUnit) {
        require(_DAO != address(0), "ZERO_ADDRESS");
        DAO = _DAO;
        canChangeDurationUnit = _canChangeDurationUnit;
    }

    /// @notice Borrowers transfer their nft as collateral to Vault and get paid from the lenders.
    /// @param _payload structure LoanPayload
    /// @param _sig user's signed message
    /// @return loanId the id of loans
    function createLoan(
        LoanPayload memory _payload,
        bytes memory _sig
    ) external payable nonReentrant returns (uint256) {
        require(!onlyExitLoan, "ONLY_EXIT_LOAN");
        require(!usedSignatures[_sig], "This signature is already used");
        require(_payload.expiration >= block.timestamp, "EXPIRED_SIGNATURE");
        bytes32 _payloadHash = keccak256(abi.encode(_payload.borrower, _payload.nftAddress,
            _payload.currency, _payload.nftTokenId, _payload.duration, _payload.expiration,
            _payload.loanAmount, _payload.apr, _payload.nftTokenType));
        bytes32 messageHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32",
            _payloadHash));
        if (msg.sender == _payload.borrower) {
            require(recoverSigner(messageHash, _sig) == _payload.lender, "INVALID_SIGNATURE");
        } else {
            require(recoverSigner(messageHash, _sig) == _payload.borrower, "INVALID_SIGNATURE");
        }
        require(availableCurrencies[_payload.currency], "NOT_ALLOWED_CURRENCY");
        require(_payload.duration != 0, "ZERO_DURATION");
        uint256 currentId = id;
        loans[currentId] = Loan({
        nftAddress : _payload.nftAddress,
        nftTokenId : _payload.nftTokenId,
        startTime : block.timestamp,
        endTime : block.timestamp + (_payload.duration * durationUnit),
        currency : _payload.currency,
        loanAmount : _payload.loanAmount,
        amountDue : calculateDueAmount(_payload.loanAmount, _payload.apr, _payload.duration),
        status : Status.CREATED,
        borrower : _payload.borrower,
        lender : _payload.lender,
        nftTokenType : _payload.nftTokenType
        });

        transferNFT(_payload.borrower, address(this), _payload.nftAddress, _payload.nftTokenId,
            _payload.nftTokenType, false);
        uint256 platformFee = calculatePlatformFee(_payload.loanAmount, platformFees[_payload.currency]);
        if (_payload.currency != address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)) {
            require(IERC20(_payload.currency).transferFrom(_payload.lender, _payload.borrower,
                _payload.loanAmount), "Transfer token to receiver failed.");
            if (platformFee > 0) {
                require(IERC20(_payload.currency).transferFrom(_payload.lender, DAO, platformFee),
                    "Transfer token to receiver failed.");
            }
        } else {
            require(msg.value >= _payload.loanAmount + platformFee, "ETH value is not enough.");
            (bool toSuccess,) = _payload.borrower.call{value : _payload.loanAmount}("");
            require(toSuccess, "Transfer failed");
            if (platformFee > 0) {
                (bool daoSuccess,) = DAO.call{value : platformFee}("");
                require(daoSuccess, "Transfer failed to DAO");
            }
        }
        emit LoanCreated(
            _payload.lender,
            _payload.borrower,
            _payload.nftAddress,
            _payload.nftTokenId,
            currentId
        );
        ++id;
        usedSignatures[_sig] = true;
        return currentId;
    }


    /// @notice Borrower pays back for loan
    /// @param _loanId the id of loans
    /// @param _amountDue amount is needed to pay
    function repayLoan(uint256 _loanId, uint256 _amountDue) external payable nonReentrant {
        Loan storage loan = loans[_loanId];
        address loanCurrency = loan.currency;
        require(loan.borrower == msg.sender, "WRONG_MSG_SENDER");
        require(loan.status == Status.CREATED, "NOT_LOAN_CREATED");
        require(block.timestamp <= loan.endTime, "EXPIRED_LOAN");
        require((msg.value > 0 && loanCurrency == address(0)
        && msg.value == _amountDue && _amountDue >= loan.amountDue) || (loanCurrency != address(0)
        && msg.value == 0 && _amountDue >= loan.amountDue), "Pay back amount is not enough.");

        loan.status = Status.REPAID;

        transferNFT(address(this), loan.borrower, loan.nftAddress, loan.nftTokenId,
            loan.nftTokenType, true);
        if (loan.currency != address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)) {
            require(IERC20(loan.currency).transferFrom(msg.sender, loan.lender, _amountDue),
                "Transfer token to receiver failed.");
        } else {
            require(msg.value >= _amountDue, "ETH value is not enough.");
            (bool toSuccess,) = loan.lender.call{value : _amountDue}("");
            require(toSuccess, "Transfer failed");
        }
        emit LoanLiquidated(
            loan.lender,
            loan.borrower,
            loan.nftAddress,
            loan.nftTokenId,
            _loanId
        );
    }

    /// @notice Lender can liquidate loan item if loan is not paid
    /// @param _loanId the id of loans
    function liquidateLoan(uint256 _loanId) external nonReentrant {
        Loan storage loan = loans[_loanId];
        require(loan.status == Status.CREATED, "LOAN_FINISHED");
        require(block.timestamp >= loan.endTime, "NOT_EXPIRED_LOAN");

        loan.status = Status.LIQUIDATED;
        transferNFT(address(this), loan.lender, loan.nftAddress, loan.nftTokenId,
            loan.nftTokenType, true);

        emit LoanTerminated(
            loan.lender,
            loan.borrower,
            loan.nftAddress,
            loan.nftTokenId,
            _loanId
        );
    }

    /// @notice Set onlyExistLoan by owner
    /// @param _value value
    function setOnlyExitLoan(bool _value) external onlyOwner {
        onlyExitLoan = _value;
    }

    /// @notice Change durationUnit by owner
    /// @param _value value
    function changeDurationUnit(uint256 _value) external onlyOwner {
        require(canChangeDurationUnit, "NOT_CHANGE_DURATION_UNIT");
        durationUnit = _value;
    }

    /// @notice Standard method to send nft from an account to another
    function transferNFT(
        address _from,
        address _to,
        address _nftAddress,
        uint256 _nftTokenId,
        uint8 _nftTokenType,
        bool _punkTransfer
    ) internal {
        if (_nftTokenType == 0) {
            IERC721(_nftAddress).safeTransferFrom(_from, _to, _nftTokenId);
        } else if (_nftTokenType == 1) {
            IERC1155(_nftAddress).safeTransferFrom(
                _from,
                _to,
                _nftTokenId,
                1,
                '0x00'
            );
        } else if (_nftTokenType == 2) {
            if (_punkTransfer) {
                ICryptoPunksMarket(_nftAddress).transferPunk(_to, _nftTokenId);
            } else {
                ICryptoPunksMarket(_nftAddress).buyPunk(_nftTokenId);
            }
        } else {
            revert("UNKNOWN_TOKEN_TYPE");
        }
    }

}

File 2 of 16 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

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

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

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

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

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

File 3 of 16 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 4 of 16 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 5 of 16 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

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

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

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

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

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

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

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

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

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

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

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

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

File 6 of 16 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

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

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

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

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

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

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

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

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

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

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

File 7 of 16 : ERC721Holder.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol)

pragma solidity ^0.8.0;

import "../IERC721Receiver.sol";

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

File 8 of 16 : ERC1155Holder.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)

pragma solidity ^0.8.0;

import "./ERC1155Receiver.sol";

/**
 * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
 *
 * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
 * stuck.
 *
 * @dev _Available since v3.1._
 */
contract ERC1155Holder is ERC1155Receiver {
    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155Received.selector;
    }

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

File 9 of 16 : ICryptoPunksMarket.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.14;

interface ICryptoPunksMarket {
    function buyPunk(uint punkIndex) external payable;
    function transferPunk(address to, uint punkIndex) external;
}

File 10 of 16 : UsdbLendingCore.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.14;

import "@openzeppelin/contracts/access/Ownable.sol";

/// @notice Core contract for liqd lending and borrowing
contract LendingCore is Ownable {

    enum Status {
        CREATED,
        REPAID,
        LIQUIDATED
    }

    struct Loan {
        address nftAddress; // address of nft
        address borrower; // address of borrower
        address lender; // address of lender
        address currency; // address of loans' currency
        Status status; // loan status
        uint256 nftTokenId; // unique identifier of NFT that the borrower uses as collateral
        uint256 startTime; // loan start date
        uint256 endTime; // loan end date
        uint256 loanAmount; // amount lender gives borrower
        uint256 amountDue; // loanAmount + interest that needs to be paid back by borrower
        uint8 nftTokenType; // token type ERC721: 0, ERC1155: 1, Other like CryptoPunk: 2
    }

    struct LoanPayload {
        address lender;
        address borrower;
        address nftAddress;
        address currency;
        uint256 nftTokenId;
        uint256 duration;
        uint256 expiration;
        uint256 loanAmount;
        uint256 apr; // 100 = 1%
        uint8 nftTokenType;
    }

    mapping(uint256 => Loan) public loans;
    mapping(address => bool) public availableCurrencies;
    mapping(address => uint256) public platformFees; // 100 = 1%
    uint256 internal constant secondsForYear = 31540000;

    ///
    /// events
    ///

    event LoanCreated(
        address indexed lender,
        address indexed borrower,
        address indexed nftAddress,
        uint256 nftTokenId,
        uint256 loanId
    );

    event LoanLiquidated(
        address indexed lender,
        address indexed borrower,
        address indexed nftAddress,
        uint256 nftTokenId,
        uint256 loanId
    );

    event LoanTerminated(
        address indexed lender,
        address indexed borrower,
        address indexed nftAddress,
        uint256 nftTokenId,
        uint256 loanId
    );

    ///
    /// management
    ///

    /// @notice Set platform fee by owner
    /// @param _currency the currency of loan
    /// @param _platformFee platform fee for each currency
    function setPlatformFee(address _currency, uint256 _platformFee) external onlyOwner {
        require(_platformFee < 1000, "TOO_HIGH_PLATFORM_FEE");
        availableCurrencies[_currency] = true;
        platformFees[_currency] = _platformFee;
    }

    /// @notice Remove currency
    /// @param _currency the currency of loan
    function removeCurrency(address _currency) external onlyOwner {
        require(availableCurrencies[_currency] == true, "CURRENCY_NOT_EXIST");
        availableCurrencies[_currency] = false;
        platformFees[_currency] = 0;
    }

    ///
    /// business logic
    ///

    /// @notice Split signature
    function splitSignature(bytes memory _sig) internal pure returns (uint8, bytes32, bytes32) {
        require(_sig.length == 65);

        bytes32 r;
        bytes32 s;
        uint8 v;

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

    /// @notice Recover signer
    function recoverSigner(bytes32 _message, bytes memory _sig) internal pure returns (address) {
        if (_sig.length != 65) {
            return (address(0));
        }

        uint8 v;
        bytes32 r;
        bytes32 s;

        (v, r, s) = splitSignature(_sig);

        if (v < 27) {
            v += 27;
        }

        if (v != 27 && v != 28) {
            return (address(0));
        }

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

    /// @notice Calculate dueAmount
    /// @param _loanAmount amount of loan
    /// @param _apr apr of loan
    /// @param _duration duration of loan
    function calculateDueAmount(
        uint256 _loanAmount,
        uint256 _apr,
        uint256 _duration
    ) internal pure returns (uint256) {
        return _loanAmount + (_loanAmount * _apr * _duration * 86400 / secondsForYear / 10000);
    }

    /// @notice Calculate platform fee
    /// @param _loanAmount amount of loan
    /// @param _platformFee platform fee for each currency
    function calculatePlatformFee(
        uint256 _loanAmount,
        uint256 _platformFee
    ) internal pure returns (uint256) {
        return _loanAmount * _platformFee / 10000;
    }

}

File 11 of 16 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

File 12 of 16 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

File 13 of 16 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

File 14 of 16 : ERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../IERC1155Receiver.sol";
import "../../../utils/introspection/ERC165.sol";

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

File 15 of 16 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

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

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

File 16 of 16 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_DAO","type":"address"},{"internalType":"bool","name":"_canChangeDurationUnit","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"lender","type":"address"},{"indexed":true,"internalType":"address","name":"borrower","type":"address"},{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"nftTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"loanId","type":"uint256"}],"name":"LoanCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"lender","type":"address"},{"indexed":true,"internalType":"address","name":"borrower","type":"address"},{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"nftTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"loanId","type":"uint256"}],"name":"LoanLiquidated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"lender","type":"address"},{"indexed":true,"internalType":"address","name":"borrower","type":"address"},{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"nftTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"loanId","type":"uint256"}],"name":"LoanTerminated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"DAO","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"availableCurrencies","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"changeDurationUnit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"lender","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"nftTokenId","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"expiration","type":"uint256"},{"internalType":"uint256","name":"loanAmount","type":"uint256"},{"internalType":"uint256","name":"apr","type":"uint256"},{"internalType":"uint8","name":"nftTokenType","type":"uint8"}],"internalType":"struct LendingCore.LoanPayload","name":"_payload","type":"tuple"},{"internalType":"bytes","name":"_sig","type":"bytes"}],"name":"createLoan","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"id","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_loanId","type":"uint256"}],"name":"liquidateLoan","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"loans","outputs":[{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"address","name":"lender","type":"address"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"enum LendingCore.Status","name":"status","type":"uint8"},{"internalType":"uint256","name":"nftTokenId","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"loanAmount","type":"uint256"},{"internalType":"uint256","name":"amountDue","type":"uint256"},{"internalType":"uint8","name":"nftTokenType","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"platformFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_currency","type":"address"}],"name":"removeCurrency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_loanId","type":"uint256"},{"internalType":"uint256","name":"_amountDue","type":"uint256"}],"name":"repayLoan","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bool","name":"_value","type":"bool"}],"name":"setOnlyExitLoan","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_currency","type":"address"},{"internalType":"uint256","name":"_platformFee","type":"uint256"}],"name":"setPlatformFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052620151806007553480156200001857600080fd5b5060405162002336380380620023368339810160408190526200003b9162000124565b6200004633620000d4565b600180556001600160a01b038216620000945760405162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b604482015260640160405180910390fd5b600580546001600160a01b039093166001600160a01b031990931692909217909155600880549115156101000261ff001990921691909117905562000172565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080604083850312156200013857600080fd5b82516001600160a01b03811681146200015057600080fd5b602084015190925080151581146200016757600080fd5b809150509250929050565b6121b480620001826000396000f3fe6080604052600436106101145760003560e01c80638db1afb1116100a0578063c5d3a10711610064578063c5d3a1071461032e578063ccdd9f5d1461034e578063e1ec3c681461036e578063f23a6e6114610409578063f2fde38b1461043557600080fd5b80638db1afb11461028c57806398fabd3a146102ac578063a730756a146102cc578063af640d0f146102ec578063bc197c811461030257600080fd5b806332e8bc72116100e757806332e8bc72146101e457806366934e191461021f578063715018a6146102325780638a700b53146102475780638da5cb5b1461025a57600080fd5b806301ffc9a714610119578063150b7a021461014e5780631858398a146101925780631af42c0f146101b4575b600080fd5b34801561012557600080fd5b50610139610134366004611a46565b610455565b60405190151581526020015b60405180910390f35b34801561015a57600080fd5b50610179610169366004611b6d565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610145565b34801561019e57600080fd5b506101b26101ad366004611bd5565b61048c565b005b3480156101c057600080fd5b506101396101cf366004611bee565b60036020526000908152604090205460ff1681565b3480156101f057600080fd5b506102116101ff366004611bee565b60046020526000908152604090205481565b604051908152602001610145565b61021161022d366004611c1a565b61051b565b34801561023e57600080fd5b506101b2610ebf565b6101b2610255366004611cfe565b610ef5565b34801561026657600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610145565b34801561029857600080fd5b506101b26102a7366004611d20565b611330565b3480156102b857600080fd5b50600554610274906001600160a01b031681565b3480156102d857600080fd5b506101b26102e7366004611d58565b6113d4565b3480156102f857600080fd5b5061021160065481565b34801561030e57600080fd5b5061017961031d366004611df5565b63bc197c8160e01b95945050505050565b34801561033a57600080fd5b506101b2610349366004611bee565b611411565b34801561035a57600080fd5b506101b2610369366004611bd5565b6114c9565b34801561037a57600080fd5b506103f2610389366004611bd5565b600260208190526000918252604090912080546001820154928201546003830154600484015460058501546006860154600787015460088801546009909801546001600160a01b03978816998816989688169786169660ff600160a01b9097048716969091168b565b6040516101459b9a99989796959493929190611eb5565b34801561041557600080fd5b50610179610424366004611f42565b63f23a6e6160e01b95945050505050565b34801561044157600080fd5b506101b2610450366004611bee565b611651565b60006001600160e01b03198216630271189760e51b148061048657506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000546001600160a01b031633146104bf5760405162461bcd60e51b81526004016104b690611fa7565b60405180910390fd5b600854610100900460ff166105165760405162461bcd60e51b815260206004820152601860248201527f4e4f545f4348414e47455f4455524154494f4e5f554e4954000000000000000060448201526064016104b6565b600755565b600060026001540361053f5760405162461bcd60e51b81526004016104b690611fdc565b600260015560085460ff16156105885760405162461bcd60e51b815260206004820152600e60248201526d27a7262cafa2ac24aa2fa627a0a760911b60448201526064016104b6565b6009826040516105989190612013565b9081526040519081900360200190205460ff16156105f85760405162461bcd60e51b815260206004820152601e60248201527f54686973207369676e617475726520697320616c72656164792075736564000060448201526064016104b6565b428360c0015110156106405760405162461bcd60e51b8152602060048201526011602482015270455850495245445f5349474e415455524560781b60448201526064016104b6565b6020808401516040808601516060870151608088015160a089015160c08a015160e08b01516101008c01516101208d0151975160009a6106d09a9991016001600160a01b03998a16815297891660208901529590971660408701526060860193909352608085019190915260a084015260c083015260e082019290925260ff919091166101008201526101200190565b60405160208183030381529060405280519060200120905060008160405160200161072791907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b60405160208183030381529060405280519060200120905084602001516001600160a01b0316336001600160a01b0316036107c05784516001600160a01b031661077182866116ec565b6001600160a01b0316146107bb5760405162461bcd60e51b8152602060048201526011602482015270494e56414c49445f5349474e415455524560781b60448201526064016104b6565b610822565b84602001516001600160a01b03166107d882866116ec565b6001600160a01b0316146108225760405162461bcd60e51b8152602060048201526011602482015270494e56414c49445f5349474e415455524560781b60448201526064016104b6565b60608501516001600160a01b031660009081526003602052604090205460ff166108855760405162461bcd60e51b81526020600482015260146024820152734e4f545f414c4c4f5745445f43555252454e435960601b60448201526064016104b6565b8460a001516000036108c95760405162461bcd60e51b815260206004820152600d60248201526c2d22a927afa22aa920aa24a7a760991b60448201526064016104b6565b6000600654905060405180610160016040528087604001516001600160a01b0316815260200187602001516001600160a01b0316815260200187600001516001600160a01b0316815260200187606001516001600160a01b031681526020016000600281111561093b5761093b611e9f565b8152602001876080015181526020014281526020016007548860a001516109629190612064565b61096c9042612083565b81526020018760e0015181526020016109938860e001518961010001518a60a001516117bf565b815261012088015160ff1660209182015260008381526002808352604091829020845181546001600160a01b03199081166001600160a01b0392831617835594860151600183018054871691831691909117905592850151818301805486169185169190911790556060850151600382018054958616919094169081178455608086015191949193926001600160a81b03199092161790600160a01b908490811115610a4157610a41611e9f565b021790555060a0820151816004015560c0820151816005015560e08201518160060155610100820151816007015561012082015181600801556101408201518160090160006101000a81548160ff021916908360ff160217905550905050610abf866020015130886040015189608001518a61012001516000611811565b60e086015160608701516001600160a01b03166000908152600460205260408120549091610aec916119a7565b60608801519091506001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14610c5c5760608701518751602089015160e08a01516040516323b872dd60e01b81526001600160a01b03909416936323b872dd93610b57939092909160040161209b565b6020604051808303816000875af1158015610b76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9a91906120bf565b610bb65760405162461bcd60e51b81526004016104b6906120dc565b8015610c5757606087015187516005546040516323b872dd60e01b81526001600160a01b03938416936323b872dd93610bf8939092911690869060040161209b565b6020604051808303816000875af1158015610c17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3b91906120bf565b610c575760405162461bcd60e51b81526004016104b6906120dc565b610df9565b808760e00151610c6c9190612083565b341015610cb65760405162461bcd60e51b815260206004820152601860248201527722aa24103b30b63ab29034b9903737ba1032b737bab3b41760411b60448201526064016104b6565b600087602001516001600160a01b03168860e0015160405160006040518083038185875af1925050503d8060008114610d0b576040519150601f19603f3d011682016040523d82523d6000602084013e610d10565b606091505b5050905080610d535760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016104b6565b8115610df7576005546040516000916001600160a01b03169084908381818185875af1925050503d8060008114610da6576040519150601f19603f3d011682016040523d82523d6000602084013e610dab565b606091505b5050905080610df55760405162461bcd60e51b81526020600482015260166024820152755472616e73666572206661696c656420746f2044414f60501b60448201526064016104b6565b505b505b86604001516001600160a01b031687602001516001600160a01b031688600001516001600160a01b03167f96992686c0b1cf8121575bfa4f8ebf796a1ca1d527594f879d4ac6a7988d7b5e8a6080015186604051610e61929190918252602082015260400190565b60405180910390a4600660008154610e789061211e565b90915550604051600190600990610e90908990612013565b908152604051908190036020019020805491151560ff1990921691909117905550925050506001805592915050565b6000546001600160a01b03163314610ee95760405162461bcd60e51b81526004016104b690611fa7565b610ef360006119c7565b565b600260015403610f175760405162461bcd60e51b81526004016104b690611fdc565b600260018181556000848152602092909252604090912060038101549181015490916001600160a01b0390811691163314610f875760405162461bcd60e51b815260206004820152601060248201526f2ba927a723afa6a9a3afa9a2a72222a960811b60448201526064016104b6565b60006003830154600160a01b900460ff166002811115610fa957610fa9611e9f565b14610fe95760405162461bcd60e51b815260206004820152601060248201526f1393d517d313d05397d0d4915055115160821b60448201526064016104b6565b816006015442111561102c5760405162461bcd60e51b815260206004820152600c60248201526b22ac2824a922a22fa627a0a760a11b60448201526064016104b6565b60003411801561104357506001600160a01b038116155b801561104e57508234145b801561105e575081600801548310155b8061108a57506001600160a01b0381161580159061107a575034155b801561108a575081600801548310155b6110d65760405162461bcd60e51b815260206004820152601e60248201527f506179206261636b20616d6f756e74206973206e6f7420656e6f7567682e000060448201526064016104b6565b60038201805460ff60a01b1916600160a01b17905560018083015483546004850154600986015461111b9430946001600160a01b039081169416929160ff1690611811565b60038201546001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146111e457600382015460028301546040516323b872dd60e01b81526001600160a01b03928316926323b872dd9261118092339290911690889060040161209b565b6020604051808303816000875af115801561119f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c391906120bf565b6111df5760405162461bcd60e51b81526004016104b6906120dc565b6112c8565b8234101561122f5760405162461bcd60e51b815260206004820152601860248201527722aa24103b30b63ab29034b9903737ba1032b737bab3b41760411b60448201526064016104b6565b60028201546040516000916001600160a01b03169085908381818185875af1925050503d806000811461127e576040519150601f19603f3d011682016040523d82523d6000602084013e611283565b606091505b50509050806112c65760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016104b6565b505b815460018301546002840154600485015460408051918252602082018990526001600160a01b039485169493841693909216917f1648de52e237e2cfe4fa99e1e1c008accb6165f17ba2f9d9622d697c98b15a1d910160405180910390a45050600180555050565b6000546001600160a01b0316331461135a5760405162461bcd60e51b81526004016104b690611fa7565b6103e881106113a35760405162461bcd60e51b8152602060048201526015602482015274544f4f5f484947485f504c4154464f524d5f46454560581b60448201526064016104b6565b6001600160a01b039091166000908152600360209081526040808320805460ff191660011790556004909152902055565b6000546001600160a01b031633146113fe5760405162461bcd60e51b81526004016104b690611fa7565b6008805460ff1916911515919091179055565b6000546001600160a01b0316331461143b5760405162461bcd60e51b81526004016104b690611fa7565b6001600160a01b03811660009081526003602052604090205460ff16151560011461149d5760405162461bcd60e51b815260206004820152601260248201527110d55494915390d657d393d517d1561254d560721b60448201526064016104b6565b6001600160a01b03166000908152600360209081526040808320805460ff191690556004909152812055565b6002600154036114eb5760405162461bcd60e51b81526004016104b690611fdc565b60026001819055600082815260209190915260408120906003820154600160a01b900460ff16600281111561152257611522611e9f565b1461155f5760405162461bcd60e51b815260206004820152600d60248201526c1313d05397d192539254d21151609a1b60448201526064016104b6565b80600601544210156115a65760405162461bcd60e51b815260206004820152601060248201526f2727aa2fa2ac2824a922a22fa627a0a760811b60448201526064016104b6565b60038101805460ff60a01b1916600160a11b17905560028101548154600483015460098401546115eb9330936001600160a01b039182169391169160ff166001611811565b805460018201546002830154600484015460408051918252602082018790526001600160a01b039485169493841693909216917f0bf28c16d70e6ac2c46b9946c64fe9dad4ca68e6edbba1f773ebe679c53b90fa910160405180910390a4505060018055565b6000546001600160a01b0316331461167b5760405162461bcd60e51b81526004016104b690611fa7565b6001600160a01b0381166116e05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104b6565b6116e9816119c7565b50565b600081516041146116ff57506000610486565b600080600061170d85611a17565b91945092509050601b60ff8416101561172e5761172b601b84612137565b92505b8260ff16601b1415801561174657508260ff16601c14155b156117575760009350505050610486565b60408051600081526020810180835288905260ff851691810191909152606081018390526080810182905260019060a0016020604051602081039080840390855afa1580156117aa573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b60006127106301e14320836117d48688612064565b6117de9190612064565b6117eb9062015180612064565b6117f5919061215c565b6117ff919061215c565b6118099085612083565b949350505050565b8160ff1660000361188357604051632142170760e11b81526001600160a01b038516906342842e0e9061184c9089908990889060040161209b565b600060405180830381600087803b15801561186657600080fd5b505af115801561187a573d6000803e3d6000fd5b5050505061199f565b8160ff166001036118ef57604051637921219560e11b81526001600160a01b038781166004808401919091528782166024840152604483018690526001606484015260a0608484015260a4830152630307830360e41b60c483015285169063f242432a9060e40161184c565b8160ff16600203611962578015611935576040516322dca8bb60e21b81526001600160a01b03868116600483015260248201859052851690638b72a2ec9060440161184c565b60405163104c9fd360e31b8152600481018490526001600160a01b03851690638264fe989060240161184c565b60405162461bcd60e51b8152602060048201526012602482015271554e4b4e4f574e5f544f4b454e5f5459504560701b60448201526064016104b6565b505050505050565b60006127106119b68385612064565b6119c0919061215c565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008060008351604114611a2a57600080fd5b5050506020810151604082015160609092015160001a92909190565b600060208284031215611a5857600080fd5b81356001600160e01b0319811681146119c057600080fd5b80356001600160a01b0381168114611a8757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051610140810167ffffffffffffffff81118282101715611ac657611ac6611a8c565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611af557611af5611a8c565b604052919050565b600082601f830112611b0e57600080fd5b813567ffffffffffffffff811115611b2857611b28611a8c565b611b3b601f8201601f1916602001611acc565b818152846020838601011115611b5057600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215611b8357600080fd5b611b8c85611a70565b9350611b9a60208601611a70565b925060408501359150606085013567ffffffffffffffff811115611bbd57600080fd5b611bc987828801611afd565b91505092959194509250565b600060208284031215611be757600080fd5b5035919050565b600060208284031215611c0057600080fd5b6119c082611a70565b803560ff81168114611a8757600080fd5b600080828403610160811215611c2f57600080fd5b61014080821215611c3f57600080fd5b611c47611aa2565b9150611c5285611a70565b8252611c6060208601611a70565b6020830152611c7160408601611a70565b6040830152611c8260608601611a70565b60608301526080850135608083015260a085013560a083015260c085013560c083015260e085013560e0830152610100808601358184015250610120611cc9818701611c09565b9083015290925083013567ffffffffffffffff811115611ce857600080fd5b611cf485828601611afd565b9150509250929050565b60008060408385031215611d1157600080fd5b50508035926020909101359150565b60008060408385031215611d3357600080fd5b611d3c83611a70565b946020939093013593505050565b80151581146116e957600080fd5b600060208284031215611d6a57600080fd5b81356119c081611d4a565b600082601f830112611d8657600080fd5b8135602067ffffffffffffffff821115611da257611da2611a8c565b8160051b611db1828201611acc565b9283528481018201928281019087851115611dcb57600080fd5b83870192505b84831015611dea57823582529183019190830190611dd1565b979650505050505050565b600080600080600060a08688031215611e0d57600080fd5b611e1686611a70565b9450611e2460208701611a70565b9350604086013567ffffffffffffffff80821115611e4157600080fd5b611e4d89838a01611d75565b94506060880135915080821115611e6357600080fd5b611e6f89838a01611d75565b93506080880135915080821115611e8557600080fd5b50611e9288828901611afd565b9150509295509295909350565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b038c811682528b811660208301528a8116604083015289166060820152610160810160038910611efc57634e487b7160e01b600052602160045260246000fd5b8860808301528760a08301528660c08301528560e08301528461010083015283610120830152611f3261014083018460ff169052565b9c9b505050505050505050505050565b600080600080600060a08688031215611f5a57600080fd5b611f6386611a70565b9450611f7160208701611a70565b93506040860135925060608601359150608086013567ffffffffffffffff811115611f9b57600080fd5b611e9288828901611afd565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6000825160005b81811015612034576020818601810151858301520161201a565b81811115612043576000828501525b509190910192915050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561207e5761207e61204e565b500290565b600082198211156120965761209661204e565b500190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6000602082840312156120d157600080fd5b81516119c081611d4a565b60208082526022908201527f5472616e7366657220746f6b656e20746f207265636569766572206661696c65604082015261321760f11b606082015260800190565b6000600182016121305761213061204e565b5060010190565b600060ff821660ff84168060ff038211156121545761215461204e565b019392505050565b60008261217957634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220e08a8acc56c51927b7dbecf32efa4d67d129b7716b79b810b9dfc660e8cf2d6f64736f6c634300080e003300000000000000000000000066a98cfcd5a0dcb4e578089e1d89134a3124f0b10000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106101145760003560e01c80638db1afb1116100a0578063c5d3a10711610064578063c5d3a1071461032e578063ccdd9f5d1461034e578063e1ec3c681461036e578063f23a6e6114610409578063f2fde38b1461043557600080fd5b80638db1afb11461028c57806398fabd3a146102ac578063a730756a146102cc578063af640d0f146102ec578063bc197c811461030257600080fd5b806332e8bc72116100e757806332e8bc72146101e457806366934e191461021f578063715018a6146102325780638a700b53146102475780638da5cb5b1461025a57600080fd5b806301ffc9a714610119578063150b7a021461014e5780631858398a146101925780631af42c0f146101b4575b600080fd5b34801561012557600080fd5b50610139610134366004611a46565b610455565b60405190151581526020015b60405180910390f35b34801561015a57600080fd5b50610179610169366004611b6d565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610145565b34801561019e57600080fd5b506101b26101ad366004611bd5565b61048c565b005b3480156101c057600080fd5b506101396101cf366004611bee565b60036020526000908152604090205460ff1681565b3480156101f057600080fd5b506102116101ff366004611bee565b60046020526000908152604090205481565b604051908152602001610145565b61021161022d366004611c1a565b61051b565b34801561023e57600080fd5b506101b2610ebf565b6101b2610255366004611cfe565b610ef5565b34801561026657600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610145565b34801561029857600080fd5b506101b26102a7366004611d20565b611330565b3480156102b857600080fd5b50600554610274906001600160a01b031681565b3480156102d857600080fd5b506101b26102e7366004611d58565b6113d4565b3480156102f857600080fd5b5061021160065481565b34801561030e57600080fd5b5061017961031d366004611df5565b63bc197c8160e01b95945050505050565b34801561033a57600080fd5b506101b2610349366004611bee565b611411565b34801561035a57600080fd5b506101b2610369366004611bd5565b6114c9565b34801561037a57600080fd5b506103f2610389366004611bd5565b600260208190526000918252604090912080546001820154928201546003830154600484015460058501546006860154600787015460088801546009909801546001600160a01b03978816998816989688169786169660ff600160a01b9097048716969091168b565b6040516101459b9a99989796959493929190611eb5565b34801561041557600080fd5b50610179610424366004611f42565b63f23a6e6160e01b95945050505050565b34801561044157600080fd5b506101b2610450366004611bee565b611651565b60006001600160e01b03198216630271189760e51b148061048657506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000546001600160a01b031633146104bf5760405162461bcd60e51b81526004016104b690611fa7565b60405180910390fd5b600854610100900460ff166105165760405162461bcd60e51b815260206004820152601860248201527f4e4f545f4348414e47455f4455524154494f4e5f554e4954000000000000000060448201526064016104b6565b600755565b600060026001540361053f5760405162461bcd60e51b81526004016104b690611fdc565b600260015560085460ff16156105885760405162461bcd60e51b815260206004820152600e60248201526d27a7262cafa2ac24aa2fa627a0a760911b60448201526064016104b6565b6009826040516105989190612013565b9081526040519081900360200190205460ff16156105f85760405162461bcd60e51b815260206004820152601e60248201527f54686973207369676e617475726520697320616c72656164792075736564000060448201526064016104b6565b428360c0015110156106405760405162461bcd60e51b8152602060048201526011602482015270455850495245445f5349474e415455524560781b60448201526064016104b6565b6020808401516040808601516060870151608088015160a089015160c08a015160e08b01516101008c01516101208d0151975160009a6106d09a9991016001600160a01b03998a16815297891660208901529590971660408701526060860193909352608085019190915260a084015260c083015260e082019290925260ff919091166101008201526101200190565b60405160208183030381529060405280519060200120905060008160405160200161072791907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b60405160208183030381529060405280519060200120905084602001516001600160a01b0316336001600160a01b0316036107c05784516001600160a01b031661077182866116ec565b6001600160a01b0316146107bb5760405162461bcd60e51b8152602060048201526011602482015270494e56414c49445f5349474e415455524560781b60448201526064016104b6565b610822565b84602001516001600160a01b03166107d882866116ec565b6001600160a01b0316146108225760405162461bcd60e51b8152602060048201526011602482015270494e56414c49445f5349474e415455524560781b60448201526064016104b6565b60608501516001600160a01b031660009081526003602052604090205460ff166108855760405162461bcd60e51b81526020600482015260146024820152734e4f545f414c4c4f5745445f43555252454e435960601b60448201526064016104b6565b8460a001516000036108c95760405162461bcd60e51b815260206004820152600d60248201526c2d22a927afa22aa920aa24a7a760991b60448201526064016104b6565b6000600654905060405180610160016040528087604001516001600160a01b0316815260200187602001516001600160a01b0316815260200187600001516001600160a01b0316815260200187606001516001600160a01b031681526020016000600281111561093b5761093b611e9f565b8152602001876080015181526020014281526020016007548860a001516109629190612064565b61096c9042612083565b81526020018760e0015181526020016109938860e001518961010001518a60a001516117bf565b815261012088015160ff1660209182015260008381526002808352604091829020845181546001600160a01b03199081166001600160a01b0392831617835594860151600183018054871691831691909117905592850151818301805486169185169190911790556060850151600382018054958616919094169081178455608086015191949193926001600160a81b03199092161790600160a01b908490811115610a4157610a41611e9f565b021790555060a0820151816004015560c0820151816005015560e08201518160060155610100820151816007015561012082015181600801556101408201518160090160006101000a81548160ff021916908360ff160217905550905050610abf866020015130886040015189608001518a61012001516000611811565b60e086015160608701516001600160a01b03166000908152600460205260408120549091610aec916119a7565b60608801519091506001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14610c5c5760608701518751602089015160e08a01516040516323b872dd60e01b81526001600160a01b03909416936323b872dd93610b57939092909160040161209b565b6020604051808303816000875af1158015610b76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9a91906120bf565b610bb65760405162461bcd60e51b81526004016104b6906120dc565b8015610c5757606087015187516005546040516323b872dd60e01b81526001600160a01b03938416936323b872dd93610bf8939092911690869060040161209b565b6020604051808303816000875af1158015610c17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3b91906120bf565b610c575760405162461bcd60e51b81526004016104b6906120dc565b610df9565b808760e00151610c6c9190612083565b341015610cb65760405162461bcd60e51b815260206004820152601860248201527722aa24103b30b63ab29034b9903737ba1032b737bab3b41760411b60448201526064016104b6565b600087602001516001600160a01b03168860e0015160405160006040518083038185875af1925050503d8060008114610d0b576040519150601f19603f3d011682016040523d82523d6000602084013e610d10565b606091505b5050905080610d535760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016104b6565b8115610df7576005546040516000916001600160a01b03169084908381818185875af1925050503d8060008114610da6576040519150601f19603f3d011682016040523d82523d6000602084013e610dab565b606091505b5050905080610df55760405162461bcd60e51b81526020600482015260166024820152755472616e73666572206661696c656420746f2044414f60501b60448201526064016104b6565b505b505b86604001516001600160a01b031687602001516001600160a01b031688600001516001600160a01b03167f96992686c0b1cf8121575bfa4f8ebf796a1ca1d527594f879d4ac6a7988d7b5e8a6080015186604051610e61929190918252602082015260400190565b60405180910390a4600660008154610e789061211e565b90915550604051600190600990610e90908990612013565b908152604051908190036020019020805491151560ff1990921691909117905550925050506001805592915050565b6000546001600160a01b03163314610ee95760405162461bcd60e51b81526004016104b690611fa7565b610ef360006119c7565b565b600260015403610f175760405162461bcd60e51b81526004016104b690611fdc565b600260018181556000848152602092909252604090912060038101549181015490916001600160a01b0390811691163314610f875760405162461bcd60e51b815260206004820152601060248201526f2ba927a723afa6a9a3afa9a2a72222a960811b60448201526064016104b6565b60006003830154600160a01b900460ff166002811115610fa957610fa9611e9f565b14610fe95760405162461bcd60e51b815260206004820152601060248201526f1393d517d313d05397d0d4915055115160821b60448201526064016104b6565b816006015442111561102c5760405162461bcd60e51b815260206004820152600c60248201526b22ac2824a922a22fa627a0a760a11b60448201526064016104b6565b60003411801561104357506001600160a01b038116155b801561104e57508234145b801561105e575081600801548310155b8061108a57506001600160a01b0381161580159061107a575034155b801561108a575081600801548310155b6110d65760405162461bcd60e51b815260206004820152601e60248201527f506179206261636b20616d6f756e74206973206e6f7420656e6f7567682e000060448201526064016104b6565b60038201805460ff60a01b1916600160a01b17905560018083015483546004850154600986015461111b9430946001600160a01b039081169416929160ff1690611811565b60038201546001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146111e457600382015460028301546040516323b872dd60e01b81526001600160a01b03928316926323b872dd9261118092339290911690889060040161209b565b6020604051808303816000875af115801561119f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c391906120bf565b6111df5760405162461bcd60e51b81526004016104b6906120dc565b6112c8565b8234101561122f5760405162461bcd60e51b815260206004820152601860248201527722aa24103b30b63ab29034b9903737ba1032b737bab3b41760411b60448201526064016104b6565b60028201546040516000916001600160a01b03169085908381818185875af1925050503d806000811461127e576040519150601f19603f3d011682016040523d82523d6000602084013e611283565b606091505b50509050806112c65760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016104b6565b505b815460018301546002840154600485015460408051918252602082018990526001600160a01b039485169493841693909216917f1648de52e237e2cfe4fa99e1e1c008accb6165f17ba2f9d9622d697c98b15a1d910160405180910390a45050600180555050565b6000546001600160a01b0316331461135a5760405162461bcd60e51b81526004016104b690611fa7565b6103e881106113a35760405162461bcd60e51b8152602060048201526015602482015274544f4f5f484947485f504c4154464f524d5f46454560581b60448201526064016104b6565b6001600160a01b039091166000908152600360209081526040808320805460ff191660011790556004909152902055565b6000546001600160a01b031633146113fe5760405162461bcd60e51b81526004016104b690611fa7565b6008805460ff1916911515919091179055565b6000546001600160a01b0316331461143b5760405162461bcd60e51b81526004016104b690611fa7565b6001600160a01b03811660009081526003602052604090205460ff16151560011461149d5760405162461bcd60e51b815260206004820152601260248201527110d55494915390d657d393d517d1561254d560721b60448201526064016104b6565b6001600160a01b03166000908152600360209081526040808320805460ff191690556004909152812055565b6002600154036114eb5760405162461bcd60e51b81526004016104b690611fdc565b60026001819055600082815260209190915260408120906003820154600160a01b900460ff16600281111561152257611522611e9f565b1461155f5760405162461bcd60e51b815260206004820152600d60248201526c1313d05397d192539254d21151609a1b60448201526064016104b6565b80600601544210156115a65760405162461bcd60e51b815260206004820152601060248201526f2727aa2fa2ac2824a922a22fa627a0a760811b60448201526064016104b6565b60038101805460ff60a01b1916600160a11b17905560028101548154600483015460098401546115eb9330936001600160a01b039182169391169160ff166001611811565b805460018201546002830154600484015460408051918252602082018790526001600160a01b039485169493841693909216917f0bf28c16d70e6ac2c46b9946c64fe9dad4ca68e6edbba1f773ebe679c53b90fa910160405180910390a4505060018055565b6000546001600160a01b0316331461167b5760405162461bcd60e51b81526004016104b690611fa7565b6001600160a01b0381166116e05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104b6565b6116e9816119c7565b50565b600081516041146116ff57506000610486565b600080600061170d85611a17565b91945092509050601b60ff8416101561172e5761172b601b84612137565b92505b8260ff16601b1415801561174657508260ff16601c14155b156117575760009350505050610486565b60408051600081526020810180835288905260ff851691810191909152606081018390526080810182905260019060a0016020604051602081039080840390855afa1580156117aa573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b60006127106301e14320836117d48688612064565b6117de9190612064565b6117eb9062015180612064565b6117f5919061215c565b6117ff919061215c565b6118099085612083565b949350505050565b8160ff1660000361188357604051632142170760e11b81526001600160a01b038516906342842e0e9061184c9089908990889060040161209b565b600060405180830381600087803b15801561186657600080fd5b505af115801561187a573d6000803e3d6000fd5b5050505061199f565b8160ff166001036118ef57604051637921219560e11b81526001600160a01b038781166004808401919091528782166024840152604483018690526001606484015260a0608484015260a4830152630307830360e41b60c483015285169063f242432a9060e40161184c565b8160ff16600203611962578015611935576040516322dca8bb60e21b81526001600160a01b03868116600483015260248201859052851690638b72a2ec9060440161184c565b60405163104c9fd360e31b8152600481018490526001600160a01b03851690638264fe989060240161184c565b60405162461bcd60e51b8152602060048201526012602482015271554e4b4e4f574e5f544f4b454e5f5459504560701b60448201526064016104b6565b505050505050565b60006127106119b68385612064565b6119c0919061215c565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008060008351604114611a2a57600080fd5b5050506020810151604082015160609092015160001a92909190565b600060208284031215611a5857600080fd5b81356001600160e01b0319811681146119c057600080fd5b80356001600160a01b0381168114611a8757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051610140810167ffffffffffffffff81118282101715611ac657611ac6611a8c565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611af557611af5611a8c565b604052919050565b600082601f830112611b0e57600080fd5b813567ffffffffffffffff811115611b2857611b28611a8c565b611b3b601f8201601f1916602001611acc565b818152846020838601011115611b5057600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215611b8357600080fd5b611b8c85611a70565b9350611b9a60208601611a70565b925060408501359150606085013567ffffffffffffffff811115611bbd57600080fd5b611bc987828801611afd565b91505092959194509250565b600060208284031215611be757600080fd5b5035919050565b600060208284031215611c0057600080fd5b6119c082611a70565b803560ff81168114611a8757600080fd5b600080828403610160811215611c2f57600080fd5b61014080821215611c3f57600080fd5b611c47611aa2565b9150611c5285611a70565b8252611c6060208601611a70565b6020830152611c7160408601611a70565b6040830152611c8260608601611a70565b60608301526080850135608083015260a085013560a083015260c085013560c083015260e085013560e0830152610100808601358184015250610120611cc9818701611c09565b9083015290925083013567ffffffffffffffff811115611ce857600080fd5b611cf485828601611afd565b9150509250929050565b60008060408385031215611d1157600080fd5b50508035926020909101359150565b60008060408385031215611d3357600080fd5b611d3c83611a70565b946020939093013593505050565b80151581146116e957600080fd5b600060208284031215611d6a57600080fd5b81356119c081611d4a565b600082601f830112611d8657600080fd5b8135602067ffffffffffffffff821115611da257611da2611a8c565b8160051b611db1828201611acc565b9283528481018201928281019087851115611dcb57600080fd5b83870192505b84831015611dea57823582529183019190830190611dd1565b979650505050505050565b600080600080600060a08688031215611e0d57600080fd5b611e1686611a70565b9450611e2460208701611a70565b9350604086013567ffffffffffffffff80821115611e4157600080fd5b611e4d89838a01611d75565b94506060880135915080821115611e6357600080fd5b611e6f89838a01611d75565b93506080880135915080821115611e8557600080fd5b50611e9288828901611afd565b9150509295509295909350565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b038c811682528b811660208301528a8116604083015289166060820152610160810160038910611efc57634e487b7160e01b600052602160045260246000fd5b8860808301528760a08301528660c08301528560e08301528461010083015283610120830152611f3261014083018460ff169052565b9c9b505050505050505050505050565b600080600080600060a08688031215611f5a57600080fd5b611f6386611a70565b9450611f7160208701611a70565b93506040860135925060608601359150608086013567ffffffffffffffff811115611f9b57600080fd5b611e9288828901611afd565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6000825160005b81811015612034576020818601810151858301520161201a565b81811115612043576000828501525b509190910192915050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561207e5761207e61204e565b500290565b600082198211156120965761209661204e565b500190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6000602082840312156120d157600080fd5b81516119c081611d4a565b60208082526022908201527f5472616e7366657220746f6b656e20746f207265636569766572206661696c65604082015261321760f11b606082015260800190565b6000600182016121305761213061204e565b5060010190565b600060ff821660ff84168060ff038211156121545761215461204e565b019392505050565b60008261217957634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220e08a8acc56c51927b7dbecf32efa4d67d129b7716b79b810b9dfc660e8cf2d6f64736f6c634300080e0033

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

00000000000000000000000066a98cfcd5a0dcb4e578089e1d89134a3124f0b10000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _DAO (address): 0x66a98CfCd5A0dCB4E578089E1D89134A3124F0b1
Arg [1] : _canChangeDurationUnit (bool): False

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000066a98cfcd5a0dcb4e578089e1d89134a3124f0b1
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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