ETH Price: $2,301.28 (-0.69%)

Contract

0x633ABd2b22F9acC015989F7504cF86B1FFcAD37D
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Create Order165418702023-02-02 15:00:23593 days ago1675350023IN
0x633ABd2b...1FFcAD37D
0 ETH0.0130779142.36048846
Create Order165418652023-02-02 14:59:23593 days ago1675349963IN
0x633ABd2b...1FFcAD37D
0 ETH0.0114148336.97363044
Create Order165418592023-02-02 14:58:11593 days ago1675349891IN
0x633ABd2b...1FFcAD37D
0 ETH0.0113557936.78239135
Create Order165418522023-02-02 14:56:47593 days ago1675349807IN
0x633ABd2b...1FFcAD37D
0 ETH0.0098901632.03508806
Create Order165418482023-02-02 14:55:59593 days ago1675349759IN
0x633ABd2b...1FFcAD37D
0 ETH0.0088456628.65186766
Create Order164983752023-01-27 13:13:35599 days ago1674825215IN
0x633ABd2b...1FFcAD37D
0 ETH0.0040931313.46870049
Create Order164982462023-01-27 12:47:35599 days ago1674823655IN
0x633ABd2b...1FFcAD37D
0 ETH0.0043662714.36746968
Create Order164982262023-01-27 12:43:35599 days ago1674823415IN
0x633ABd2b...1FFcAD37D
0 ETH0.004186313.56160134
Create Order164455332023-01-20 4:09:59607 days ago1674187799IN
0x633ABd2b...1FFcAD37D
0 ETH0.005306216.28608543
Safe Execute Ord...164417242023-01-19 15:23:59607 days ago1674141839IN
0x633ABd2b...1FFcAD37D
0 ETH0.0039203620.21014263
Create Order164417072023-01-19 15:20:35607 days ago1674141635IN
0x633ABd2b...1FFcAD37D
0 ETH0.0073475422.55149772
Cancel Order164416732023-01-19 15:13:35607 days ago1674141215IN
0x633ABd2b...1FFcAD37D
0 ETH0.0027947521.63361259
Create Order164412392023-01-19 13:46:23607 days ago1674135983IN
0x633ABd2b...1FFcAD37D
0 ETH0.0061295918.81397568
Set Validator164392042023-01-19 6:56:23608 days ago1674111383IN
0x633ABd2b...1FFcAD37D
0 ETH0.0007241714.3861609
Set Fee For Coll...164391722023-01-19 6:49:59608 days ago1674110999IN
0x633ABd2b...1FFcAD37D
0 ETH0.0007020714.71578509
Set Fee Receiver164391692023-01-19 6:49:23608 days ago1674110963IN
0x633ABd2b...1FFcAD37D
0 ETH0.000435814.33805209
Set Currency164391652023-01-19 6:48:35608 days ago1674110915IN
0x633ABd2b...1FFcAD37D
0 ETH0.0004302714.77190826
Set NFT164391392023-01-19 6:43:23608 days ago1674110603IN
0x633ABd2b...1FFcAD37D
0 ETH0.0007729515.75856391
Set Currency164391362023-01-19 6:42:47608 days ago1674110567IN
0x633ABd2b...1FFcAD37D
0 ETH0.000846617.26777718
Set Currency164391052023-01-19 6:36:35608 days ago1674110195IN
0x633ABd2b...1FFcAD37D
0 ETH0.0003656716.95147473
0x60806040164391042023-01-19 6:36:23608 days ago1674110183IN
 Create: MarketplaceV2
0 ETH0.071128517.15571474

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MarketplaceV2

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 2000 runs

Other Settings:
default evmVersion
File 1 of 18 : MarketplaceV2.sol
// SPDX-License-Identifier: Apache-2.0

pragma solidity ^0.6.8;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/cryptography/ECDSA.sol";

import "./FeeManager.sol";
import "./NativeMetaTransaction.sol";


interface IMarketplace {

    struct Order {
        // Order ID
        bytes32 id;
        // Owner of the NFT
        address payable seller;
        // NFT registry address
        address nftAddress;
        // Price (in wei) for the published item
        uint256 price;
        // Time when this sale ends
        uint256 expiresAt;
        // ERC20 currency address
        address currency;
        // Fixed price
        bool isAuction;
        // Creator
        address creator;
        // royal fee
        uint royalFee;
    }

    struct Bid {
        // Bid Id
        bytes32 id;
        // Bidder address
        address payable bidder;
        // Price for the bid in wei
        uint256 price;
        // Time when this bid ends
        uint256 expiresAt;
    }

    // ORDER EVENTS
    event OrderCreated(
        bytes32 id,
        address indexed seller,
        address indexed nftAddress,
        uint256 indexed assetId,
        uint256 priceInWei,
        uint256 expiresAt,
        address currency,
        bool isAuction
    );

    event OrderUpdated(
        bytes32 id,
        uint256 priceInWei,
        uint256 expiresAt
    );

    event OrderSuccessful(
        bytes32 id,
        address indexed buyer,
        uint256 priceInWei
    );

    event OrderCancelled(bytes32 id);

    // BID EVENTS
    event BidCreated(
        bytes32 id,
        address indexed nftAddress,
        uint256 indexed assetId,
        address indexed bidder,
        uint256 priceInWei,
        uint256 expiresAt
    );

    event BidAccepted(bytes32 id);
    event BidCancelled(bytes32 id);

    // INTERNAL EVENT
    event CreateOrderInternal(
        bytes32 id,
        address internalAddress
    );

    event BidCreatedInternal(
        bytes32 id,
        address indexed nftAddress,
        uint256 indexed assetId,
        address indexed bidder,
        uint256 priceInWei,
        uint256 expiresAt,
        address internalAddress
    );

    event LogInternal(
        bytes32 orderId,
        bytes32 bidId
    );

}

contract MarketplaceV2 is Pausable, FeeManager, IMarketplace, ERC721Holder, ReentrancyGuard {
    using ECDSA for bytes32;
    using ECDSA for bytes;
    using Address for address;
    using SafeMath for uint256;
    using SafeERC20 for IERC20;


    // From ERC721 registry assetId to Order (to avoid asset collision)
    mapping(address => mapping(uint256 => Order)) public orderByAssetId;

    // From ERC721 registry assetId to Bid (to avoid asset collision)
    mapping(address => mapping(uint256 => Bid)) public bidByOrderId;

    // From IERC20 to status for toggling accepted currencies
    mapping(address => bool) public acceptedCurrencies;

    // Allow NFT can be sold on this market
    mapping(address => bool) public whiteListNft;


    // 721 Interfaces
    bytes4 public constant _INTERFACE_ID_ERC721 = 0x80ac58cd;

    // Mocking a constant for ether as currency
    address public constant MARKETPLACE_ETHER = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    address public validator;

    address public internalLWC;

    modifier checkSigner(bytes memory _signature, address _creator, uint _royalFee) {
        require(_royalFee <= maxRoyalFee, "Marketplace: max royal fee");
        bytes32 _hash = keccak256(abi.encodePacked(_creator, msg.sender, address(this), _royalFee)).toEthSignedMessageHash();
        require(_hash.recover(_signature) == validator, "Marketplace: !verify");
        _;
    }

    modifier onlyInternalLWC() {
        require(msg.sender == internalLWC, "Only internal wallet");
        _;
    }

    event ChangeValidator(address indexed _old, address indexed _new);
    event ChangeInternalLWC(address indexed _old, address indexed _new);

    /**
     * @dev Initialize this contract. Acts as a constructor
     */
    constructor() public {
        acceptedCurrencies[MARKETPLACE_ETHER] = true;
        feeReceiver = msg.sender;
    }

    /**
     * @dev Sets the paused failsafe. Can only be called by owner
     * @param _setPaused - paused state
     */
    function setPaused(bool _setPaused) external onlyOwner {
        return (_setPaused) ? _pause() : _unpause();
    }

    /**
     * @dev Set accepted currencies as payments. Can only be called by owner
     * @param _token - ERC20 contract address
     * @param _status - status for the token
     */
    function setCurrency(address _token, bool _status) external onlyOwner {
        require(_token.isContract(), "The accepted token address must be a deployed contract");
        acceptedCurrencies[_token] = _status;
    }

    /**
     * @dev Set NFT can be sold on market. Can only be called by owner
     * @param _token - ERC721 contract address
     * @param _status - status for the token
     */
    function setNFT(address _token, bool _status) external onlyOwner {
        require(_token.isContract(), "The accepted token address must be a deployed contract");
        whiteListNft[_token] = _status;
    }


    function setValidator(address _validator) external onlyOwner {
        require(_validator != address(0) && !_validator.isContract(), "Marketplace: invalid address");
        address _old = validator;
        validator = _validator;
        emit ChangeValidator(_old, _validator);
    }

    function setInternalLWC(address _internalLWC) external onlyOwner {
        require(_internalLWC != address(0), "Marketplace: invalid address");
        address _old = internalLWC;
        internalLWC = _internalLWC;
        emit ChangeValidator(_old, _internalLWC);
    }

    /**
     * @dev Creates a new order
     * @param _nftAddress - Non fungible registry address
     * @param _assetId - ID of the published NFT
     * @param _priceInWei - Price in Wei for the supported coin
     * @param _expiresAt - Duration of the order (in hours)
     */
    function createOrder(address _nftAddress, uint256 _assetId, uint256 _priceInWei, uint256 _expiresAt, address _currency, bool _isAuction, address _creator, uint _royalFee, bytes memory _signature)
    external
    whenNotPaused
    checkSigner(_signature, _creator, _royalFee)
    {
        _createOrder(_nftAddress, _assetId, _priceInWei, _expiresAt, _currency, _isAuction, _creator, _royalFee);
    }

    function createOrderInternal(
        address _nftAddress,
        uint256 _assetId,
        uint256 _priceInWei,
        uint256 _expiresAt,
        address _currency,
        bool _isAuction,
        address _creator,
        uint _royalFee,
        bytes memory _signature,
        address _ownerInternal
    )
    external
    whenNotPaused
    checkSigner(_signature, _creator, _royalFee)
    onlyInternalLWC
    {
        bytes32 orderId = _createOrder(_nftAddress, _assetId, _priceInWei, _expiresAt, _currency, _isAuction, _creator, _royalFee);
        emit CreateOrderInternal(orderId, _ownerInternal);
    }
    /**
     * @dev Cancel an already published order
     *  can only be cancelled by seller or the contract owner
     * @param _nftAddress - Address of the NFT registry
     * @param _assetId - ID of the published NFT
     */
    function cancelOrder(address _nftAddress, uint256 _assetId) external {
        Order memory order = orderByAssetId[_nftAddress][_assetId];

        require(order.seller == msg.sender || msg.sender == owner(), "Marketplace: unauthorized sender");

        // Remove pending bid if any
        Bid memory bid = bidByOrderId[_nftAddress][_assetId];

        if (bid.id != 0) {
            _cancelBid(bid.id, _nftAddress, _assetId, bid.bidder, bid.price);
        }

        // Cancel order.
        _cancelOrder(order.id, _nftAddress, _assetId, order.seller);
    }

    /**
     * @dev Update an already published order
     *  can only be updated by seller
     * @param _nftAddress - Address of the NFT registry
     * @param _assetId - ID of the published NFT
     */
    function updateOrder(address _nftAddress, uint256 _assetId, uint256 _priceInWei, uint256 _expiresAt)
    external whenNotPaused {
        Order storage order = orderByAssetId[_nftAddress][_assetId];

        // Check valid order to update
        require(order.id != 0, "Marketplace: asset not published");
        require(order.seller == msg.sender, "Marketplace: sender not allowed");
        require(order.expiresAt >= block.timestamp, "Marketplace: order expired");

        // check order updated params
        require(_priceInWei > 0, "Marketplace: Price should be bigger than 0");
        require(_expiresAt > block.timestamp.add(1 minutes), "Marketplace: Expire time should be more than 1 minute in the future");

        order.price = _priceInWei;
        order.expiresAt = _expiresAt;

        emit OrderUpdated(order.id, _priceInWei, _expiresAt);
    }

    /**
     * @dev Executes the sale for a published NFT
     * @param _nftAddress - Address of the NFT registry
     * @param _assetId - ID of the published NFT
     */
    function safeExecuteOrder(address _nftAddress, uint256 _assetId, uint256 _priceInWei) external payable whenNotPaused {
        // Get the current valid order for the asset or fail
        Order memory order = _getValidOrder(_nftAddress, _assetId);

        /// Check the execution price matches the order price
        // require(order.price == msg.value, "Marketplace: invalid price");
        require(order.seller != msg.sender, "Marketplace: unauthorized sender");
        bool _isETH = order.currency == MARKETPLACE_ETHER;
        if(_isETH) {
            require(order.price == msg.value, "Marketplace: invalid price");
        } else {
            require(order.price == _priceInWei, "Marketplace: invalid price");
        }

        // market fee to cut
        uint256 saleShareAmount = 0;
        uint256 royalFeeShareAmount = 0;
        uint256 cutPerMillion = feeForCollection[order.nftAddress];
        uint256 sellerReceive = 0;

        if (cutPerMillion > 0) {
            // Calculate sale share
            if (_isETH) {
                saleShareAmount = (msg.value).mul(cutPerMillion).div(PERCENTAGE);
            } else {
                saleShareAmount = (order.price).mul(cutPerMillion).div(PERCENTAGE);
            }

            // Transfer share amount for marketplace Owner
//            order.currency == MARKETPLACE_ETHER ?
//            payable(owner()).transfer(saleShareAmount)
//            :
//            IERC20(order.currency).safeTransferFrom(msg.sender, owner(), saleShareAmount);
        }

        if (order.creator != address(0) && order.royalFee > 0 ) {
            // Calculate sale share
//            royalFeeShareAmount = (order.price).mul(order.royalFee).div(PERCENTAGE);
            if(_isETH) {
                royalFeeShareAmount = (msg.value).mul(order.royalFee).div(PERCENTAGE);
            } else {
                royalFeeShareAmount = (order.price).mul(order.royalFee).div(PERCENTAGE);
            }
//            order.currency == MARKETPLACE_ETHER ?
//            payable(order.creator).transfer(royalFeeShareAmount)
//            :
//            IERC20(order.currency).safeTransfer(order.creator, royalFeeShareAmount);
        }

        uint256 _totalFee = royalFeeShareAmount.add(saleShareAmount);
        if(order.price >= _totalFee) {
            sellerReceive = (order.price).sub(_totalFee);
        } else {
            revert("Fee is greater than price");
        }

        //payment
        if(_isETH) {
            payable(feeReceiver).transfer(saleShareAmount);
            payable(order.creator).transfer(royalFeeShareAmount);
            payable(order.seller).transfer(sellerReceive);
        } else {
            IERC20 _currency = IERC20(order.currency);
            _currency.safeTransferFrom(msg.sender, feeReceiver, saleShareAmount);
            _currency.safeTransferFrom(msg.sender, order.creator, royalFeeShareAmount);
            _currency.safeTransferFrom(msg.sender, order.seller, sellerReceive);
        }

//        // Transfer token amount minus market fee to seller
//        order.currency == MARKETPLACE_ETHER ?
//        order.seller.transfer(order.price.sub(saleShareAmount.add(royalFeeShareAmount)))
//        :
//        IERC20(order.currency).safeTransferFrom(msg.sender, order.seller, order.price.sub(saleShareAmount.add(royalFeeShareAmount)));

        // Remove pending bid if any
        Bid memory bid = bidByOrderId[_nftAddress][_assetId];
        if (bid.id != 0) {
            _cancelBid(bid.id, _nftAddress, _assetId, bid.bidder, bid.price);
        }
        _executeOrder(order.id, msg.sender, _nftAddress, _assetId, order.price);
    }

    /**
     * @dev Places a bid for a published NFT
     * @param _nftAddress - Address of the NFT registry
     * @param _assetId - ID of the published NFT
     * @param _expiresAt - Bid expiration time
     */
    function safePlaceBid(address _nftAddress, uint256 _assetId, uint256 _expiresAt, uint256 _priceInWei)
    external payable whenNotPaused nonReentrant {

        Order memory order = _getValidOrder(_nftAddress, _assetId);

        order.currency == MARKETPLACE_ETHER ?
        _createBid(_nftAddress, _assetId, msg.value, _expiresAt)
        :
        _createBid(_nftAddress, _assetId, _priceInWei, _expiresAt);
    }

    function safePlaceBidInternal(
        address _nftAddress,
        uint256 _assetId,
        uint256 _expiresAt,
        uint256 _priceInWei,
        address _internal)
    external payable whenNotPaused nonReentrant {

        Order memory order = _getValidOrder(_nftAddress, _assetId);

        bytes32 bidId = order.currency == MARKETPLACE_ETHER ?
        _createBid(_nftAddress, _assetId, msg.value, _expiresAt)
        :
        _createBid(_nftAddress, _assetId, _priceInWei, _expiresAt);

        emit BidCreatedInternal(bidId, _nftAddress, _assetId, msg.sender, _priceInWei, _expiresAt, _internal);

    }

    /**
     * @dev Cancel an already published bid
     *  can only be canceled by seller or the contract owner
     * @param _nftAddress - Address of the NFT registry
     * @param _assetId - ID of the published NFT
     */
    function cancelBid(address _nftAddress, uint256 _assetId) external whenNotPaused {
        Bid memory bid = bidByOrderId[_nftAddress][_assetId];

        require(bid.bidder == msg.sender, "Marketplace: Unauthorized sender");

        _cancelBid(bid.id, _nftAddress, _assetId, bid.bidder, bid.price);
    }

    /**
     * @dev Executes the sale for a published NFT by accepting a current bid
     * @param _nftAddress - Address of the NFT registry
     * @param _assetId - ID of the published NFT
     * @param _priceInWei - Bid price in wei in acceptedTokens currency
     */
    function acceptBid(address _nftAddress, uint256 _assetId, uint256 _priceInWei) external whenNotPaused {
        // check order validity
        Order memory order = _getValidOrder(_nftAddress, _assetId);

        // item seller is the only allowed to accept a bid
        require(order.seller == msg.sender, "Marketplace: unauthorized sender");

        Bid memory bid = bidByOrderId[_nftAddress][_assetId];

        require(bid.price == _priceInWei, "Marketplace: invalid bid price");
        require(bid.expiresAt >= block.timestamp, "Marketplace: the bid expired");

        // remove bid
        delete bidByOrderId[_nftAddress][_assetId];

        emit BidAccepted(bid.id);

        uint256 saleShareAmount = 0;
        uint256 royalFeeShareAmount = 0;
        uint256 cutPerMillion = feeForCollection[order.nftAddress];
        uint256 sellerReceive = 0;
        bool _isETH = order.currency == MARKETPLACE_ETHER;

        // Send market fees to owner
        if (cutPerMillion > 0) {
            // Calculate sale share
            saleShareAmount = (_priceInWei).mul(cutPerMillion).div(PERCENTAGE);

            // Transfer share amount for marketplace Owner
//            order.currency == MARKETPLACE_ETHER ?
//            payable(owner()).transfer(saleShareAmount)
//            :
//            IERC20(order.currency).safeTransfer(owner(), saleShareAmount);
        }

        if (order.creator != address(0) && order.royalFee > 0) {
            // Calculate sale share
            royalFeeShareAmount = (_priceInWei).mul(order.royalFee).div(PERCENTAGE);

//            order.currency == MARKETPLACE_ETHER ?
//            payable(order.creator).transfer(royalFeeShareAmount)
//            :
//            IERC20(order.currency).safeTransfer(order.creator, royalFeeShareAmount);
        }

        uint256 _totalFee = royalFeeShareAmount.add(saleShareAmount);
        if(_priceInWei >= _totalFee) {
            sellerReceive = (_priceInWei).sub(_totalFee);
        } else {
            revert("Fee is greater than price");
        }

        // Transfer token amount minus market fee to seller
//        order.currency == MARKETPLACE_ETHER ?
//        order.seller.transfer(bid.price.sub(saleShareAmount.add(royalFeeShareAmount)))
//        :
//        IERC20(order.currency).safeTransfer(order.seller, bid.price.sub(saleShareAmount.add(royalFeeShareAmount)));

        if(_isETH) {
            payable(feeReceiver).transfer(saleShareAmount);
            payable(order.creator).transfer(royalFeeShareAmount);
            payable(order.seller).transfer(sellerReceive);
        } else {
            IERC20 _currency = IERC20(order.currency);
            _currency.safeTransferFrom(msg.sender, feeReceiver, saleShareAmount);
            _currency.safeTransferFrom(msg.sender, order.creator, royalFeeShareAmount);
            _currency.safeTransferFrom(msg.sender, order.seller, sellerReceive);
        }

        _executeOrder(order.id, bid.bidder, _nftAddress, _assetId, _priceInWei);
        emit LogInternal(order.id, bid.id);
    }

    /**
     * @dev Internal function gets Order by nftRegistry and assetId. Checks for the order validity
     * @param _nftAddress - Address of the NFT registry
     * @param _assetId - ID of the published NFT
     */
    function _getValidOrder(address _nftAddress, uint256 _assetId) internal view returns (Order memory order) {
        order = orderByAssetId[_nftAddress][_assetId];

        require(order.id != 0, "Marketplace: asset not published");
        require(order.expiresAt >= block.timestamp, "Marketplace: order expired");
    }

    /**
     * @dev Executes the sale for a published NFT
     * @param _orderId - Order Id to execute
     * @param _buyer - address
     * @param _nftAddress - Address of the NFT registry
     * @param _assetId - NFT id
     * @param _priceInWei - Order price
     */
    function _executeOrder(bytes32 _orderId, address _buyer, address _nftAddress, uint256 _assetId, uint256 _priceInWei) internal {
        // remove order
        delete orderByAssetId[_nftAddress][_assetId];

        // Transfer NFT asset
        IERC721(_nftAddress).safeTransferFrom(address(this), _buyer, _assetId);

        // Notify ..
        emit OrderSuccessful(_orderId, _buyer, _priceInWei);
    }

    /**
     * @dev Creates a new order
     * @param _nftAddress - Non fungible registry address
     * @param _assetId - ID of the published NFT
     * @param _priceInWei - Price in Wei for the supported coin
     * @param _expiresAt - Expiration time for the order
     */
    function _createOrder(
        address _nftAddress,
        uint256 _assetId,
        uint256 _priceInWei,
        uint256 _expiresAt,
        address _currency,
        bool _isAuction,
        address _creator,
        uint256 _royalFee) internal returns(bytes32){
        // Check nft registry
        IERC721 nftRegistry = _requireERC721(_nftAddress);

        // Check _acceptedCurrency
        require(
            whiteListNft[_nftAddress],
            "Marketplace: Unacceptable marketplace nft"
        );

        // Check _acceptedCurrency
        require(
            acceptedCurrencies[_currency],
            "Marketplace: Unacceptable marketplace currency"
        );

        // Check order creator is the asset owner
        address assetOwner = nftRegistry.ownerOf(_assetId);

        require(
            assetOwner == msg.sender,
            "Marketplace: Only the asset owner can create orders"
        );

        require(_priceInWei > 0, "Marketplace: Price should be bigger than 0");

        require(
            _expiresAt > block.timestamp.add(1 minutes),
            "Marketplace: Publication should be more than 1 minute in the future"
        );

        // get NFT asset from seller
        nftRegistry.safeTransferFrom(assetOwner, address(this), _assetId);

        // create the orderId
        bytes32 orderId = keccak256(abi.encodePacked(block.timestamp, assetOwner, _nftAddress, _assetId, _priceInWei));

        // save order
        orderByAssetId[_nftAddress][_assetId] = Order({
        id : orderId,
        seller : payable(assetOwner),
        nftAddress : _nftAddress,
        price : _priceInWei,
        expiresAt : _expiresAt,
        currency : _currency,
        isAuction : _isAuction,
        creator : _creator,
        royalFee : _royalFee
        });

        emit OrderCreated(orderId, assetOwner, _nftAddress, _assetId, _priceInWei, _expiresAt, _currency, _isAuction);
        return orderId;
    }

    /**
     * @dev Creates a new bid on a existing order
     * @param _nftAddress - Non fungible registry address
     * @param _assetId - ID of the published NFT
     * @param _priceInWei - Price in Wei for the supported coin
     * @param _expiresAt - expires time
     */
    function _createBid(address _nftAddress, uint256 _assetId, uint256 _priceInWei, uint256 _expiresAt) internal  returns(bytes32){
        // Checks order validity
        Order memory order = _getValidOrder(_nftAddress, _assetId);
        require(order.isAuction, "Marketplace: only buy fixed price");
        // check on expire time
        if (_expiresAt > order.expiresAt) {
            _expiresAt = order.expiresAt;
        }

        // Check price if there's a previous bid
        Bid memory bid = bidByOrderId[_nftAddress][_assetId];

        // if theres no previous bid, just check price > 0
        if (bid.id != 0) {
            if (bid.expiresAt >= block.timestamp) {
                require(
                    _priceInWei > bid.price,
                    "Marketplace: bid price should be higher than last bid"
                );

            } else {
                require(_priceInWei > 0, "Marketplace: bid should be > 0");
            }

            _cancelBid(bid.id, _nftAddress, _assetId, bid.bidder, bid.price);

        } else {
            require(_priceInWei > 0, "Marketplace: bid should be > 0");
        }

        // Transfer sale amount from bidder to escrow
        // acceptedToken.safeTransferFrom(msg.sender, address(this), _priceInWei);

        // Create bid
        bytes32 bidId = keccak256(abi.encodePacked(block.timestamp, msg.sender, order.id, _priceInWei, _expiresAt));

        // Save Bid for this order
        bidByOrderId[_nftAddress][_assetId] = Bid({
        id : bidId,
        bidder : msg.sender,
        price : _priceInWei,
        expiresAt : _expiresAt
        });

        emit BidCreated(bidId, _nftAddress, _assetId, msg.sender, _priceInWei, _expiresAt);
        return bidId;
    }

    /**
     * @dev Cancel an already published order
     *  can only be canceled by seller or the contract owner
     * @param _orderId - Bid identifier
     * @param _nftAddress - Address of the NFT registry
     * @param _assetId - ID of the published NFT
     * @param _seller - Address
     */
    function _cancelOrder(bytes32 _orderId, address _nftAddress, uint256 _assetId, address _seller) internal {
        delete orderByAssetId[_nftAddress][_assetId];

        /// send asset back to seller
        IERC721(_nftAddress).safeTransferFrom(address(this), _seller, _assetId);

        emit OrderCancelled(_orderId);
    }

    /**
     * @dev Cancel bid from an already published order
     *  can only be canceled by seller or the contract owner
     * @param _bidId - Bid identifier
     * @param _nftAddress - registry address
     * @param _assetId - ID of the published NFT
     * @param _bidder - Address
     * @param _escrowAmount - in acceptenToken currency
     */
    function _cancelBid(bytes32 _bidId, address _nftAddress, uint256 _assetId, address payable _bidder, uint256 _escrowAmount) internal {
        delete bidByOrderId[_nftAddress][_assetId];

        Order memory order = _getValidOrder(_nftAddress, _assetId);

        order.currency == MARKETPLACE_ETHER ?
        _bidder.transfer(_escrowAmount)
        :
        IERC20(order.currency).safeTransfer(_bidder, _escrowAmount);

        emit BidCancelled(_bidId);
    }

    function _requireERC721(address _nftAddress) internal view returns (IERC721) {
        require(
            _nftAddress.isContract(),
            "The NFT Address should be a contract"
        );
        require(
            IERC721(_nftAddress).supportsInterface(_INTERFACE_ID_ERC721),
            "The NFT contract has an invalid ERC721 implementation"
        );
        return IERC721(_nftAddress);
    }

//    function _msgSender() internal virtual override(NativeMetaTransaction, Context) view returns (address payable) {
//        address payable sender;
//        if(msg.sender == address(this)) {
//            bytes memory array = msg.data;
//            uint256 index = msg.data.length;
//            assembly {
//            // Load the 32 bytes word from memory with the address on the lower 20 bytes, and mask those.
//                sender := and(mload(add(array, index)), 0xffffffffffffffffffffffffffffffffffffffff)
//            }
//        } else {
//            sender = msg.sender;
//        }
//        return sender;
//    }

    function resecureFund(IERC20 _erc20) external onlyOwner whenPaused {
        if(address(_erc20) == address(MARKETPLACE_ETHER)) {
            payable(owner()).transfer(address(this).balance);
        }else {
            _erc20.safeTransfer(owner(), _erc20.balanceOf(address(this)));
        }
    }
}

File 2 of 18 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

File 3 of 18 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

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

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

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

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 4 of 18 : Pausable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./Context.sol";

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

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

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor () internal {
        _paused = false;
    }

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

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

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

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

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

File 5 of 18 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 () internal {
        _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 make 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 6 of 18 : ERC721Holder.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 7 of 18 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

import "../../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 8 of 18 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;
    using Address for address;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 9 of 18 : ECDSA.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        // Check the signature length
        if (signature.length != 65) {
            revert("ECDSA: invalid signature length");
        }

        // Divide the signature in r, s and v variables
        bytes32 r;
        bytes32 s;
        uint8 v;

        // 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)))
        }

        return recover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover-bytes32-bytes-} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "ECDSA: invalid signature 's' value");
        require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value");

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        require(signer != address(0), "ECDSA: invalid signature");

        return signer;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * replicates the behavior of the
     * https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`]
     * JSON-RPC method.
     *
     * See {recover}.
     */
    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 10 of 18 : FeeManager.sol
// SPDX-License-Identifier: Apache-2.0

pragma solidity ^0.6.8;

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



contract FeeManager is Ownable {

    event ChangedFeePerMillion(uint256 cutPerMillion);
    event ChangedFeeForCollection(uint256 fee, address collection);
    event ChangedFeeReceiver(address _old, address _new);


    // Market fee on sales
//    uint256 public cutPerMillion;
    uint256 public constant maxCutPerMillion = 1e5; // 10% cut
    uint256 public constant PERCENTAGE = 1e6;
    uint256 public constant maxRoyalFee = 1e5;

    address public feeReceiver;

    mapping(address => uint256) public feeForCollection;

//    /**
//     * @dev Sets the share cut for the owner of the contract that's
//     *  charged to the seller on a successful sale
//     * @param _cutPerMillion - Share amount, from 0 to 99,999
//     */
//    function setOwnerCutPerMillion(uint256 _cutPerMillion) external onlyOwner {
//        require(
//            _cutPerMillion < maxCutPerMillion,
//            "The owner cut should be between 0 and maxCutPerMillion"
//        );
//
//        cutPerMillion = _cutPerMillion;
//        emit ChangedFeePerMillion(cutPerMillion);
//    }

    function setFeeForCollection(address _collection, uint256 _fee) external onlyOwner {
        require(
            _fee < maxCutPerMillion,
            "The owner cut should be between 0 and maxCutPerMillion"
        );
        feeForCollection[_collection] = _fee;
        emit ChangedFeeForCollection(_fee, _collection);

    }

    function setFeeReceiver(address _new) external onlyOwner {
        require(_new != address(0), "_new receiver is address zero");
        address _old =feeReceiver;
        feeReceiver = _new;
        emit ChangedFeeReceiver(_old, _new);
    }

}

File 11 of 18 : NativeMetaTransaction.sol
pragma solidity ^0.6.8;

import "./EIP712Base.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";


contract NativeMetaTransaction is EIP712Base {
    using SafeMath for uint256;
    bytes32 private constant META_TRANSACTION_TYPEHASH = keccak256(
        bytes(
            "MetaTransaction(uint256 nonce,address from,bytes functionSignature)"
        )
    );
    event MetaTransactionExecuted(
        address userAddress,
        address payable relayerAddress,
        bytes functionSignature
    );
    mapping(address => uint256) nonces;

    /*
     * Meta transaction structure.
     * No point of including value field here as if user is doing value transfer then he has the funds to pay for gas
     * He should call the desired function directly in that case.
     */
    struct MetaTransaction {
        uint256 nonce;
        address from;
        bytes functionSignature;
    }

    function executeMetaTransaction(
        address userAddress,
        bytes memory functionSignature,
        bytes32 sigR,
        bytes32 sigS,
        uint8 sigV
    ) public payable returns (bytes memory) {
        MetaTransaction memory metaTx = MetaTransaction({
        nonce: nonces[userAddress],
        from: userAddress,
        functionSignature: functionSignature
        });

        require(
            verify(userAddress, metaTx, sigR, sigS, sigV),
            "Signer and signature do not match"
        );

        // increase nonce for user (to avoid re-use)
        nonces[userAddress] = nonces[userAddress].add(1);

        emit MetaTransactionExecuted(
            userAddress,
            msg.sender,
            functionSignature
        );

        // Append userAddress and relayer address at the end to extract it from calling context
        (bool success, bytes memory returnData) = address(this).call(
            abi.encodePacked(functionSignature, userAddress)
        );
        require(success, "Function call not successful");

        return returnData;
    }

    function hashMetaTransaction(MetaTransaction memory metaTx)
    internal
    pure
    returns (bytes32)
    {
        return
        keccak256(
            abi.encode(
                META_TRANSACTION_TYPEHASH,
                metaTx.nonce,
                metaTx.from,
                keccak256(metaTx.functionSignature)
            )
        );
    }

    function getNonce(address user) public view returns (uint256 nonce) {
        nonce = nonces[user];
    }

    function verify(
        address signer,
        MetaTransaction memory metaTx,
        bytes32 sigR,
        bytes32 sigS,
        uint8 sigV
    ) internal view returns (bool) {
        require(signer != address(0), "NativeMetaTransaction: INVALID_SIGNER");
        return
        signer ==
        ecrecover(
            toTypedMessageHash(hashMetaTransaction(metaTx)),
            sigV,
            sigR,
            sigS
        );
    }

    function _msgSender() internal virtual view returns (address payable) {
        address payable sender;
        if(msg.sender == address(this)) {
            bytes memory array = msg.data;
            uint256 index = msg.data.length;
            assembly {
            // Load the 32 bytes word from memory with the address on the lower 20 bytes, and mask those.
                sender := and(mload(add(array, index)), 0xffffffffffffffffffffffffffffffffffffffff)
            }
        } else {
            sender = msg.sender;
        }
        return sender;
    }

}

File 12 of 18 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 13 of 18 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 18 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 15 of 18 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

File 16 of 18 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), 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 {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 17 of 18 : EIP712Base.sol
pragma solidity ^0.6.8;

import "@openzeppelin/contracts/proxy/Initializable.sol";

contract EIP712Base is Initializable {
    struct EIP712Domain {
        string name;
        string version;
        address verifyingContract;
        uint256 chainId;
    }

    string constant public ERC712_VERSION = "1";

    bytes32 internal constant EIP712_DOMAIN_TYPEHASH = keccak256(
        bytes(
            "EIP712Domain(string name,string version,address verifyingContract,uint256 chainId)"
        )
    );
    bytes32 internal domainSeperator;

    // supposed to be called once while initializing.
    // one of the contractsa that inherits this contract follows proxy pattern
    // so it is not possible to do this in a constructor
    function _initializeEIP712(
        string memory name
    )
    internal
    initializer
    {
        _setDomainSeperator(name);
    }

    function _setDomainSeperator(string memory name) internal {
        domainSeperator = keccak256(
            abi.encode(
                EIP712_DOMAIN_TYPEHASH,
                keccak256(bytes(name)),
                keccak256(bytes(ERC712_VERSION)),
                address(this),
                getChainId()
            )
        );
    }

    function getDomainSeperator() public view returns (bytes32) {
        return domainSeperator;
    }

    function getChainId() public pure returns (uint256) {
        uint256 id;
        assembly {
            id := chainid()
        }
        return id;
    }

    /**
     * Accept message hash and returns hash message in EIP712 compatible form
     * So that it can be used to recover signer from signature signed using EIP712 formatted data
     * https://eips.ethereum.org/EIPS/eip-712
     * "\\x19" makes the encoding deterministic
     * "\\x01" is the version byte to make it compatible to EIP-191
     */
    function toTypedMessageHash(bytes32 messageHash)
    internal
    view
    returns (bytes32)
    {
        return
        keccak256(
            abi.encodePacked("\x19\x01", getDomainSeperator(), messageHash)
        );
    }
}

File 18 of 18 : Initializable.sol
// SPDX-License-Identifier: MIT

// solhint-disable-next-line compiler-version
pragma solidity >=0.4.24 <0.8.0;

import "../utils/Address.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */
abstract contract Initializable {

    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

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

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized");

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

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /// @dev Returns true if and only if the function is running in the constructor
    function _isConstructor() private view returns (bool) {
        return !Address.isContract(address(this));
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"BidAccepted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"BidCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"assetId","type":"uint256"},{"indexed":true,"internalType":"address","name":"bidder","type":"address"},{"indexed":false,"internalType":"uint256","name":"priceInWei","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expiresAt","type":"uint256"}],"name":"BidCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"assetId","type":"uint256"},{"indexed":true,"internalType":"address","name":"bidder","type":"address"},{"indexed":false,"internalType":"uint256","name":"priceInWei","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expiresAt","type":"uint256"},{"indexed":false,"internalType":"address","name":"internalAddress","type":"address"}],"name":"BidCreatedInternal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_old","type":"address"},{"indexed":true,"internalType":"address","name":"_new","type":"address"}],"name":"ChangeInternalLWC","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_old","type":"address"},{"indexed":true,"internalType":"address","name":"_new","type":"address"}],"name":"ChangeValidator","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"},{"indexed":false,"internalType":"address","name":"collection","type":"address"}],"name":"ChangedFeeForCollection","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"cutPerMillion","type":"uint256"}],"name":"ChangedFeePerMillion","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_old","type":"address"},{"indexed":false,"internalType":"address","name":"_new","type":"address"}],"name":"ChangedFeeReceiver","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":false,"internalType":"address","name":"internalAddress","type":"address"}],"name":"CreateOrderInternal","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"orderId","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"bidId","type":"bytes32"}],"name":"LogInternal","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"OrderCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"assetId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"priceInWei","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expiresAt","type":"uint256"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"bool","name":"isAuction","type":"bool"}],"name":"OrderCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"priceInWei","type":"uint256"}],"name":"OrderSuccessful","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"priceInWei","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expiresAt","type":"uint256"}],"name":"OrderUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"MARKETPLACE_ETHER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERCENTAGE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_INTERFACE_ID_ERC721","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nftAddress","type":"address"},{"internalType":"uint256","name":"_assetId","type":"uint256"},{"internalType":"uint256","name":"_priceInWei","type":"uint256"}],"name":"acceptBid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"acceptedCurrencies","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"bidByOrderId","outputs":[{"internalType":"bytes32","name":"id","type":"bytes32"},{"internalType":"address payable","name":"bidder","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"expiresAt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nftAddress","type":"address"},{"internalType":"uint256","name":"_assetId","type":"uint256"}],"name":"cancelBid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftAddress","type":"address"},{"internalType":"uint256","name":"_assetId","type":"uint256"}],"name":"cancelOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftAddress","type":"address"},{"internalType":"uint256","name":"_assetId","type":"uint256"},{"internalType":"uint256","name":"_priceInWei","type":"uint256"},{"internalType":"uint256","name":"_expiresAt","type":"uint256"},{"internalType":"address","name":"_currency","type":"address"},{"internalType":"bool","name":"_isAuction","type":"bool"},{"internalType":"address","name":"_creator","type":"address"},{"internalType":"uint256","name":"_royalFee","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"createOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftAddress","type":"address"},{"internalType":"uint256","name":"_assetId","type":"uint256"},{"internalType":"uint256","name":"_priceInWei","type":"uint256"},{"internalType":"uint256","name":"_expiresAt","type":"uint256"},{"internalType":"address","name":"_currency","type":"address"},{"internalType":"bool","name":"_isAuction","type":"bool"},{"internalType":"address","name":"_creator","type":"address"},{"internalType":"uint256","name":"_royalFee","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"},{"internalType":"address","name":"_ownerInternal","type":"address"}],"name":"createOrderInternal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"feeForCollection","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"internalLWC","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxCutPerMillion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxRoyalFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"orderByAssetId","outputs":[{"internalType":"bytes32","name":"id","type":"bytes32"},{"internalType":"address payable","name":"seller","type":"address"},{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"expiresAt","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"bool","name":"isAuction","type":"bool"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint256","name":"royalFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_erc20","type":"address"}],"name":"resecureFund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftAddress","type":"address"},{"internalType":"uint256","name":"_assetId","type":"uint256"},{"internalType":"uint256","name":"_priceInWei","type":"uint256"}],"name":"safeExecuteOrder","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftAddress","type":"address"},{"internalType":"uint256","name":"_assetId","type":"uint256"},{"internalType":"uint256","name":"_expiresAt","type":"uint256"},{"internalType":"uint256","name":"_priceInWei","type":"uint256"}],"name":"safePlaceBid","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftAddress","type":"address"},{"internalType":"uint256","name":"_assetId","type":"uint256"},{"internalType":"uint256","name":"_expiresAt","type":"uint256"},{"internalType":"uint256","name":"_priceInWei","type":"uint256"},{"internalType":"address","name":"_internal","type":"address"}],"name":"safePlaceBidInternal","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"setCurrency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setFeeForCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_new","type":"address"}],"name":"setFeeReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_internalLWC","type":"address"}],"name":"setInternalLWC","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"setNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_setPaused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_validator","type":"address"}],"name":"setValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftAddress","type":"address"},{"internalType":"uint256","name":"_assetId","type":"uint256"},{"internalType":"uint256","name":"_priceInWei","type":"uint256"},{"internalType":"uint256","name":"_expiresAt","type":"uint256"}],"name":"updateOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"validator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whiteListNft","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b506000805460ff1916815562000026620000dd565b60008054610100600160a81b0319166101006001600160a01b038416908102919091178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506001600381905573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee60005260066020527fa2e5aefc6e2cbe2917a296f0fd89c5f915c487c803db1d98eccb43f14012d711805460ff19168217905580546001600160a01b03191633179055620000e1565b3390565b61486b80620000f16000396000f3fe6080604052600436106102345760003560e01c806374d2706911610138578063cf7ce01f116100b0578063efdcd9741161007f578063f2fde38b11610064578063f2fde38b14610a13578063f83b216214610a46578063fcedebd214610b4657610234565b8063efdcd974146109ad578063f2e2e2aa146109e057610234565b8063cf7ce01f14610881578063dece6854146108c6578063e13a40f0146108db578063e61f38511461091a57610234565b8063ad21981311610107578063b3f00674116100ec578063b3f0067414610805578063c555e05014610432578063cd08bfe11461081a57610234565b8063ad219813146106dd578063b1062fc61461071057610234565b806374d27069146106205780637a71ab41146106625780638da5cb5b14610695578063a30af25b146106aa57610234565b806339b6b1e5116101cb5780634206ebba1161019a5780635c975abb1161017f5780635c975abb146105a95780636a206137146105d2578063715018a61461060b57610234565b80634206ebba1461053d5780634ae2e50f1461057057610234565b806339b6b1e5146104795780633a5381b5146104b25780633ac44917146104c75780633db887611461050257610234565b8063293315f211610207578063293315f2146103da57806329ac3772146104015780632fe05b371461043257806338940b5b1461044757610234565b80631327d3d814610239578063150b7a021461026e57806316c38b3c146103765780631d22da91146103a2575b600080fd5b34801561024557600080fd5b5061026c6004803603602081101561025c57600080fd5b50356001600160a01b0316610b5b565b005b34801561027a57600080fd5b506103416004803603608081101561029157600080fd5b6001600160a01b038235811692602081013590911691604082013591908101906080810160608201356401000000008111156102cc57600080fd5b8201836020820111156102de57600080fd5b8035906020019184600183028401116401000000008311171561030057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610ca6945050505050565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b34801561038257600080fd5b5061026c6004803603602081101561039957600080fd5b50351515610ccf565b61026c600480360360808110156103b857600080fd5b506001600160a01b038135169060208101359060408101359060600135610d60565b3480156103e657600080fd5b506103ef610e71565b60408051918252519081900360200190f35b34801561040d57600080fd5b50610416610e78565b604080516001600160a01b039092168252519081900360200190f35b34801561043e57600080fd5b506103ef610e87565b61026c6004803603606081101561045d57600080fd5b506001600160a01b038135169060208101359060400135610e8e565b34801561048557600080fd5b5061026c6004803603604081101561049c57600080fd5b506001600160a01b03813516906020013561134f565b3480156104be57600080fd5b5061041661146c565b3480156104d357600080fd5b5061026c600480360360408110156104ea57600080fd5b506001600160a01b038135169060200135151561147b565b34801561050e57600080fd5b5061026c6004803603604081101561052557600080fd5b506001600160a01b0381351690602001351515611567565b34801561054957600080fd5b5061026c6004803603602081101561056057600080fd5b50356001600160a01b0316611653565b34801561057c57600080fd5b5061026c6004803603604081101561059357600080fd5b506001600160a01b038135169060200135611781565b3480156105b557600080fd5b506105be611891565b604080519115158252519081900360200190f35b3480156105de57600080fd5b5061026c600480360360408110156105f557600080fd5b506001600160a01b03813516906020013561189a565b34801561061757600080fd5b5061026c611a5a565b61026c600480360360a081101561063657600080fd5b506001600160a01b03813581169160208101359160408201359160608101359160809091013516611b34565b34801561066e57600080fd5b506103ef6004803603602081101561068557600080fd5b50356001600160a01b0316611cab565b3480156106a157600080fd5b50610416611cbd565b3480156106b657600080fd5b5061026c600480360360208110156106cd57600080fd5b50356001600160a01b0316611cd1565b3480156106e957600080fd5b506105be6004803603602081101561070057600080fd5b50356001600160a01b0316611eb0565b34801561071c57600080fd5b5061026c600480360361012081101561073457600080fd5b6001600160a01b038235811692602081013592604082013592606083013592608081013582169260a082013515159260c0830135169160e081013591810190610120810161010082013564010000000081111561079057600080fd5b8201836020820111156107a257600080fd5b803590602001918460018302840111640100000000831117156107c457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611ec5945050505050565b34801561081157600080fd5b5061041661206e565b34801561082657600080fd5b506108536004803603604081101561083d57600080fd5b506001600160a01b03813516906020013561207d565b604080519485526001600160a01b039093166020850152838301919091526060830152519081900360800190f35b34801561088d57600080fd5b5061026c600480360360808110156108a457600080fd5b506001600160a01b0381351690602081013590604081013590606001356120b9565b3480156108d257600080fd5b50610341612313565b3480156108e757600080fd5b5061026c600480360360608110156108fe57600080fd5b506001600160a01b038135169060208101359060400135612337565b34801561092657600080fd5b506109536004803603604081101561093d57600080fd5b506001600160a01b0381351690602001356127c9565b60408051998a526001600160a01b0398891660208b0152968816898801526060890195909552608088019390935290851660a0870152151560c086015290921660e084015261010083019190915251908190036101200190f35b3480156109b957600080fd5b5061026c600480360360208110156109d057600080fd5b50356001600160a01b0316612843565b3480156109ec57600080fd5b506105be60048036036020811015610a0357600080fd5b50356001600160a01b0316612982565b348015610a1f57600080fd5b5061026c60048036036020811015610a3657600080fd5b50356001600160a01b0316612997565b348015610a5257600080fd5b5061026c6004803603610140811015610a6a57600080fd5b6001600160a01b038235811692602081013592604082013592606083013592608081013582169260a082013515159260c0830135169160e0810135918101906101208101610100820135640100000000811115610ac657600080fd5b820183602082011115610ad857600080fd5b80359060200191846001830284011164010000000083111715610afa57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550505090356001600160a01b03169150612acd9050565b348015610b5257600080fd5b50610416612d1e565b610b63612d36565b6001600160a01b0316610b74611cbd565b6001600160a01b031614610bcf576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811615801590610bf65750610bf4816001600160a01b0316612d3a565b155b610c47576040805162461bcd60e51b815260206004820152601c60248201527f4d61726b6574706c6163653a20696e76616c6964206164647265737300000000604482015290519081900360640190fd5b600880546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f021e99fb14cdbadf08fceee0f5d5b97881f9c7853cea56cac83621f0b44ac36590600090a35050565b7f150b7a0200000000000000000000000000000000000000000000000000000000949350505050565b610cd7612d36565b6001600160a01b0316610ce8611cbd565b6001600160a01b031614610d43576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b80610d5557610d50612d40565b610d5d565b610d5d612de9565b50565b610d68611891565b15610dad576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b60026003541415610e05576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600355610e12614492565b610e1c8585612e6c565b60a08101519091506001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14610e5857610e5385858486612fce565b610e64565b610e6485853486612fce565b5050600160035550505050565b620f424081565b6009546001600160a01b031681565b620186a081565b610e96611891565b15610edb576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b610ee3614492565b610eed8484612e6c565b60208101519091506001600160a01b0316331415610f52576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a20756e617574686f72697a65642073656e646572604482015290519081900360640190fd5b60a08101516001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee148015610fd95734826060015114610fd4576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a20696e76616c6964207072696365000000000000604482015290519081900360640190fd5b611031565b82826060015114611031576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a20696e76616c6964207072696365000000000000604482015290519081900360640190fd5b6040808301516001600160a01b03166000908152600260205290812054819081811561109c57841561107b57611074620f424061106e3485613329565b90613389565b935061109c565b611099620f424061106e84896060015161332990919063ffffffff16565b93505b60e08601516001600160a01b0316158015906110bd57506000866101000151115b156111145784156110ee576110e7620f424061106e8861010001513461332990919063ffffffff16565b9250611114565b611111620f424061106e886101000151896060015161332990919063ffffffff16565b92505b600061112084866133f0565b90508087606001511061114357606087015161113c908261344a565b9150611190565b6040805162461bcd60e51b815260206004820152601960248201527f4665652069732067726561746572207468616e20707269636500000000000000604482015290519081900360640190fd5b8515611252576001546040516001600160a01b039091169086156108fc029087906000818181858888f193505050501580156111d0573d6000803e3d6000fd5b508660e001516001600160a01b03166108fc859081150290604051600060405180830381858888f1935050505015801561120e573d6000803e3d6000fd5b5086602001516001600160a01b03166108fc839081150290604051600060405180830381858888f1935050505015801561124c573d6000803e3d6000fd5b506112ad565b60a0870151600154611273906001600160a01b0380841691339116896134a7565b60e088015161128f906001600160a01b038316903390886134a7565b60208801516112ab906001600160a01b038316903390866134a7565b505b6112b56144de565b506001600160a01b03808b1660009081526005602090815260408083208d8452825291829020825160808101845281548082526001830154909516928101929092526002810154928201929092526003909101546060820152901561132d5761132d81600001518c8c8460200151856040015161352f565b6113428860000151338d8d8c6060015161364d565b5050505050505050505050565b611357611891565b1561139c576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6113a46144de565b506001600160a01b03808316600090815260056020908152604080832085845282529182902082516080810184528154815260018201549094169184018290526002810154928401929092526003909101546060830152331461144e576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a20556e617574686f72697a65642073656e646572604482015290519081900360640190fd5b611467816000015184848460200151856040015161352f565b505050565b6008546001600160a01b031681565b611483612d36565b6001600160a01b0316611494611cbd565b6001600160a01b0316146114ef576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b611501826001600160a01b0316612d3a565b61153c5760405162461bcd60e51b81526004018080602001828103825260368152602001806145066036913960400191505060405180910390fd5b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b61156f612d36565b6001600160a01b0316611580611cbd565b6001600160a01b0316146115db576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6115ed826001600160a01b0316612d3a565b6116285760405162461bcd60e51b81526004018080602001828103825260368152602001806145066036913960400191505060405180910390fd5b6001600160a01b03919091166000908152600760205260409020805460ff1916911515919091179055565b61165b612d36565b6001600160a01b031661166c611cbd565b6001600160a01b0316146116c7576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116611722576040805162461bcd60e51b815260206004820152601c60248201527f4d61726b6574706c6163653a20696e76616c6964206164647265737300000000604482015290519081900360640190fd5b600980546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f021e99fb14cdbadf08fceee0f5d5b97881f9c7853cea56cac83621f0b44ac36590600090a35050565b611789612d36565b6001600160a01b031661179a611cbd565b6001600160a01b0316146117f5576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b620186a081106118365760405162461bcd60e51b81526004018080602001828103825260368152602001806148006036913960400191505060405180910390fd5b6001600160a01b03821660008181526002602090815260409182902084905581518481529081019290925280517f2975d7c97017ea947833e51a609466c628e7803e404c57000d24c4c3a9250bbd9281900390910190a15050565b60005460ff1690565b6118a2614492565b506001600160a01b0382811660009081526004602081815260408084208685528252928390208351610120810185528154815260018201548616928101839052600282015486169481019490945260038101546060850152918201546080840152600582015480851660a085015274010000000000000000000000000000000000000000900460ff16151560c0840152600682015490931660e0830152600701546101008201529033148061196f575061195a611cbd565b6001600160a01b0316336001600160a01b0316145b6119c0576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a20756e617574686f72697a65642073656e646572604482015290519081900360640190fd5b6119c86144de565b506001600160a01b0380841660009081526005602090815260408083208684528252918290208251608081018452815480825260018301549095169281019290925260028101549282019290925260039091015460608201529015611a4057611a40816000015185858460200151856040015161352f565b611a54826000015185858560200151613797565b50505050565b611a62612d36565b6001600160a01b0316611a73611cbd565b6001600160a01b031614611ace576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516101009091046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffff0000000000000000000000000000000000000000ff169055565b611b3c611891565b15611b81576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b60026003541415611bd9576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600355611be6614492565b611bf08686612e6c565b9050600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b03168260a001516001600160a01b031614611c3657611c3187878688612fce565b611c42565b611c4287873488612fce565b60408051828152602081018790528082018890526001600160a01b0386811660608301529151929350339289928b16917f24035b4609386405033f1e34954019c016ad17aa0a0c43bb88fdd4fdcbe6b952919081900360800190a4505060016003555050505050565b60026020526000908152604090205481565b60005461010090046001600160a01b031690565b611cd9612d36565b6001600160a01b0316611cea611cbd565b6001600160a01b031614611d45576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b611d4d611891565b611d9e576040805162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611e0957611dcb611cbd565b6001600160a01b03166108fc479081150290604051600060405180830381858888f19350505050158015611e03573d6000803e3d6000fd5b50610d5d565b610d5d611e14611cbd565b604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290516001600160a01b038516916370a08231916024808301926020929190829003018186803b158015611e7357600080fd5b505afa158015611e87573d6000803e3d6000fd5b505050506040513d6020811015611e9d57600080fd5b50516001600160a01b03841691906138ce565b60076020526000908152604090205460ff1681565b611ecd611891565b15611f12576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b808383620186a0811115611f6d576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a206d617820726f79616c20666565000000000000604482015290519081900360640190fd5b6000611fda8333308560405160200180856001600160a01b031660601b8152601401846001600160a01b031660601b8152601401836001600160a01b031660601b81526014018281526020019450505050506040516020818303038152906040528051906020012061394e565b6008549091506001600160a01b0316611ff3828661399f565b6001600160a01b03161461204e576040805162461bcd60e51b815260206004820152601460248201527f4d61726b6574706c6163653a2021766572696679000000000000000000000000604482015290519081900360640190fd5b61205e8d8d8d8d8d8d8d8d613a1f565b5050505050505050505050505050565b6001546001600160a01b031681565b6005602090815260009283526040808420909152908252902080546001820154600283015460039093015491926001600160a01b039091169184565b6120c1611891565b15612106576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6001600160a01b03841660009081526004602090815260408083208684529091529020805461217c576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a206173736574206e6f74207075626c6973686564604482015290519081900360640190fd5b60018101546001600160a01b031633146121dd576040805162461bcd60e51b815260206004820152601f60248201527f4d61726b6574706c6163653a2073656e646572206e6f7420616c6c6f77656400604482015290519081900360640190fd5b4281600401541015612236576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a206f726465722065787069726564000000000000604482015290519081900360640190fd5b600083116122755760405162461bcd60e51b815260040180806020018281038252602a8152602001806145c6602a913960400191505060405180910390fd5b61228042603c6133f0565b82116122bd5760405162461bcd60e51b81526004018080602001828103825260438152602001806145626043913960600191505060405180910390fd5b600381018390556004810182905580546040805191825260208201859052818101849052517f37de993802f8ab9c75f6d7d3065ba8ab95ce30051219b14251415925e68e0a489181900360600190a15050505050565b7f80ac58cd0000000000000000000000000000000000000000000000000000000081565b61233f611891565b15612384576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b61238c614492565b6123968484612e6c565b60208101519091506001600160a01b031633146123fa576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a20756e617574686f72697a65642073656e646572604482015290519081900360640190fd5b6124026144de565b506001600160a01b038085166000908152600560209081526040808320878452825291829020825160808101845281548152600182015490941691840191909152600281015491830182905260030154606083015283146124aa576040805162461bcd60e51b815260206004820152601e60248201527f4d61726b6574706c6163653a20696e76616c6964206269642070726963650000604482015290519081900360640190fd5b4281606001511015612503576040805162461bcd60e51b815260206004820152601c60248201527f4d61726b6574706c6163653a2074686520626964206578706972656400000000604482015290519081900360640190fd5b6001600160a01b0385166000908152600560209081526040808320878452825280832083815560018101805473ffffffffffffffffffffffffffffffffffffffff1916905560028101849055600301929092558251825190815291517ff8c7d5572fa269efc040934ae7553d57f8906bffd616254bef0b94e2b569e4169281900390910190a16040808301516001600160a01b03908116600090815260026020529182205460a0850151839283911673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1482156125e2576125df620f424061106e8a86613329565b94505b60e08701516001600160a01b03161580159061260357506000876101000151115b1561262a57612627620f424061106e8961010001518b61332990919063ffffffff16565b93505b600061263685876133f0565b905080891061114357612649898261344a565b9250811561270d576001546040516001600160a01b039091169087156108fc029088906000818181858888f1935050505015801561268b573d6000803e3d6000fd5b508760e001516001600160a01b03166108fc869081150290604051600060405180830381858888f193505050501580156126c9573d6000803e3d6000fd5b5087602001516001600160a01b03166108fc849081150290604051600060405180830381858888f19350505050158015612707573d6000803e3d6000fd5b50612768565b60a088015160015461272e906001600160a01b03808416913391168a6134a7565b60e089015161274a906001600160a01b038316903390896134a7565b6020890151612766906001600160a01b038316903390876134a7565b505b61277d886000015188602001518d8d8d61364d565b8751875160408051928352602083019190915280517fb3fd31fc3ad6e598b907aad9aa3cc523ac01201169000666e95e5438a17cb3699281900390910190a15050505050505050505050565b600460208181526000938452604080852090915291835291208054600182015460028301546003840154948401546005850154600686015460079096015494966001600160a01b03948516969385169590949293838316937401000000000000000000000000000000000000000090930460ff1692169089565b61284b612d36565b6001600160a01b031661285c611cbd565b6001600160a01b0316146128b7576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116612912576040805162461bcd60e51b815260206004820152601d60248201527f5f6e65772072656365697665722069732061646472657373207a65726f000000604482015290519081900360640190fd5b600180546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040805191909216808252602082019390935281517fd79a033509d5860f46d2ea09749b135bd89cc001a397067f42a80dbe250e9d8d929181900390910190a15050565b60066020526000908152604090205460ff1681565b61299f612d36565b6001600160a01b03166129b0611cbd565b6001600160a01b031614612a0b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116612a505760405162461bcd60e51b815260040180806020018281038252602681526020018061453c6026913960400191505060405180910390fd5b600080546040516001600160a01b038085169361010090930416917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b03909216610100027fffffffffffffffffffffff0000000000000000000000000000000000000000ff909216919091179055565b612ad5611891565b15612b1a576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b818484620186a0811115612b75576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a206d617820726f79616c20666565000000000000604482015290519081900360640190fd5b6000612be28333308560405160200180856001600160a01b031660601b8152601401846001600160a01b031660601b8152601401836001600160a01b031660601b81526014018281526020019450505050506040516020818303038152906040528051906020012061394e565b6008549091506001600160a01b0316612bfb828661399f565b6001600160a01b031614612c56576040805162461bcd60e51b815260206004820152601460248201527f4d61726b6574706c6163653a2021766572696679000000000000000000000000604482015290519081900360640190fd5b6009546001600160a01b03163314612cb5576040805162461bcd60e51b815260206004820152601460248201527f4f6e6c7920696e7465726e616c2077616c6c6574000000000000000000000000604482015290519081900360640190fd5b6000612cc78f8f8f8f8f8f8f8f613a1f565b604080518281526001600160a01b038916602082015281519293507f50109e39e61de37cb6c25dd49620dd16c4c1a5c8d264b563d18756180cbec7bc929081900390910190a1505050505050505050505050505050565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b3390565b3b151590565b612d48611891565b612d99576040805162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612dcc612d36565b604080516001600160a01b039092168252519081900360200190a1565b612df1611891565b15612e36576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612dcc612d36565b612e74614492565b506001600160a01b03828116600090815260046020818152604080842086855282529283902083516101208101855281548082526001830154871693820193909352600282015486169481019490945260038101546060850152918201546080840152600582015480851660a085015274010000000000000000000000000000000000000000900460ff16151560c0840152600682015490931660e08301526007015461010082015290612f6f576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a206173736574206e6f74207075626c6973686564604482015290519081900360640190fd5b4281608001511015612fc8576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a206f726465722065787069726564000000000000604482015290519081900360640190fd5b92915050565b6000612fd8614492565b612fe28686612e6c565b90508060c001516130245760405162461bcd60e51b81526004018080602001828103825260218152602001806145a56021913960400191505060405180910390fd5b806080015183111561303857806080015192505b6130406144de565b506001600160a01b038087166000908152600560209081526040808320898452825291829020825160808101845281548082526001830154909516928101929092526002810154928201929092526003909101546060820152901561316457428160600151106130f157806040015185116130ec5760405162461bcd60e51b81526004018080602001828103825260358152602001806147a16035913960400191505060405180910390fd5b613146565b60008511613146576040805162461bcd60e51b815260206004820152601e60248201527f4d61726b6574706c6163653a206269642073686f756c64206265203e20300000604482015290519081900360640190fd5b61315f816000015188888460200151856040015161352f565b6131b9565b600085116131b9576040805162461bcd60e51b815260206004820152601e60248201527f4d61726b6574706c6163653a206269642073686f756c64206265203e20300000604482015290519081900360640190fd5b600042338460000151888860405160200180868152602001856001600160a01b031660601b8152601401848152602001838152602001828152602001955050505050506040516020818303038152906040528051906020012090506040518060800160405280828152602001336001600160a01b0316815260200187815260200186815250600560008a6001600160a01b03166001600160a01b0316815260200190815260200160002060008981526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506040820151816002015560608201518160030155905050336001600160a01b031687896001600160a01b03167fae7b5aee7763f3e7771076de8f7b61accb70ad42245fee23308e19c8bcd518e4848a8a60405180848152602001838152602001828152602001935050505060405180910390a4979650505050505050565b60008261333857506000612fc8565b8282028284828161334557fe5b04146133825760405162461bcd60e51b81526004018080602001828103825260218152602001806147056021913960400191505060405180910390fd5b9392505050565b60008082116133df576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816133e857fe5b049392505050565b600082820183811015613382576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000828211156134a1576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052611a54908590613f13565b6001600160a01b0384166000908152600560209081526040808320868452909152812081815560018101805473ffffffffffffffffffffffffffffffffffffffff191690556002810182905560030155613587614492565b6135918585612e6c565b60a08101519091506001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146135da5760a08101516135d5906001600160a01b031684846138ce565b613612565b6040516001600160a01b0384169083156108fc029084906000818181858888f19350505050158015613610573d6000803e3d6000fd5b505b6040805187815290517fb56dc4096011ba5fd2e46e5c3e7b04dec423b5e7b5fce9a17a419d77c832177c9181900360200190a1505050505050565b6001600160a01b03808416600081815260046020818152604080842088855290915280832083815560018101805473ffffffffffffffffffffffffffffffffffffffff1990811690915560028201805482169055600382018590558184018590556005820180547fffffffffffffffffffffff00000000000000000000000000000000000000000016905560068201805490911690556007018390558051632142170760e11b81523092810192909252938816602482015260448101869052925191926342842e0e926064808301939282900301818387803b15801561373257600080fd5b505af1158015613746573d6000803e3d6000fd5b5050604080518881526020810185905281516001600160a01b03891694507f012d66d656f295c1a84576b9b7f0a83474ed09578e80f7f1a715fb958e1d546393509081900390910190a25050505050565b6001600160a01b03808416600081815260046020818152604080842088855290915280832083815560018101805473ffffffffffffffffffffffffffffffffffffffff1990811690915560028201805482169055600382018590558184018590556005820180547fffffffffffffffffffffff00000000000000000000000000000000000000000016905560068201805490911690556007018390558051632142170760e11b81523092810192909252938516602482015260448101869052925191926342842e0e926064808301939282900301818387803b15801561387c57600080fd5b505af1158015613890573d6000803e3d6000fd5b50506040805187815290517f5152abf959f6564662358c2e52b702259b78bac5ee7842a0f01937e670efcc7d9350908190036020019150a150505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052611467908490613f13565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b600081516041146139f7576040805162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015290519081900360640190fd5b60208201516040830151606084015160001a613a1586828585613fc4565b9695505050505050565b600080613a2b8a614142565b6001600160a01b038b1660009081526007602052604090205490915060ff16613a855760405162461bcd60e51b81526004018080602001828103825260298152602001806147546029913960400191505060405180910390fd5b6001600160a01b03861660009081526006602052604090205460ff16613adc5760405162461bcd60e51b815260040180806020018281038252602e815260200180614726602e913960400191505060405180910390fd5b6000816001600160a01b0316636352211e8b6040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015613b2257600080fd5b505afa158015613b36573d6000803e3d6000fd5b505050506040513d6020811015613b4c57600080fd5b505190506001600160a01b0381163314613b975760405162461bcd60e51b81526004018080602001828103825260338152602001806145f06033913960400191505060405180910390fd5b60008911613bd65760405162461bcd60e51b815260040180806020018281038252602a8152602001806145c6602a913960400191505060405180910390fd5b613be142603c6133f0565b8811613c1e5760405162461bcd60e51b81526004018080602001828103825260438152602001806146236043913960600191505060405180910390fd5b60408051632142170760e11b81526001600160a01b038381166004830152306024830152604482018d90529151918416916342842e0e9160648082019260009290919082900301818387803b158015613c7657600080fd5b505af1158015613c8a573d6000803e3d6000fd5b50505050600042828d8d8d60405160200180868152602001856001600160a01b031660601b8152601401846001600160a01b031660601b815260140183815260200182815260200195505050505050604051602081830303815290604052805190602001209050604051806101200160405280828152602001836001600160a01b031681526020018d6001600160a01b031681526020018b81526020018a8152602001896001600160a01b031681526020018815158152602001876001600160a01b0316815260200186815250600460008e6001600160a01b03166001600160a01b0316815260200190815260200160002060008d81526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550606082015181600301556080820151816004015560a08201518160050160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060c08201518160050160146101000a81548160ff02191690831515021790555060e08201518160060160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555061010082015181600701559050508a8c6001600160a01b0316836001600160a01b03167f824ac4c21c415646c2086042c220821208efc3c5f1c76761234340e2e261ab47848e8e8e8e60405180868152602001858152602001848152602001836001600160a01b0316815260200182151581526020019550505050505060405180910390a49b9a5050505050505050505050565b6060613f68826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661427b9092919063ffffffff16565b80519091501561146757808060200190516020811015613f8757600080fd5b50516114675760405162461bcd60e51b815260040180806020018281038252602a8152602001806147d6602a913960400191505060405180910390fd5b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08211156140255760405162461bcd60e51b815260040180806020018281038252602281526020018061469b6022913960400191505060405180910390fd5b8360ff16601b148061403a57508360ff16601c145b6140755760405162461bcd60e51b81526004018080602001828103825260228152602001806146e36022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156140d1573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116614139576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b6000614156826001600160a01b0316612d3a565b6141915760405162461bcd60e51b815260040180806020018281038252602481526020018061477d6024913960400191505060405180910390fd5b604080517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f80ac58cd00000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038416916301ffc9a7916024808301926020929190829003018186803b15801561421057600080fd5b505afa158015614224573d6000803e3d6000fd5b505050506040513d602081101561423a57600080fd5b50516142775760405162461bcd60e51b81526004018080602001828103825260358152602001806146666035913960400191505060405180910390fd5b5090565b606061428a8484600085614292565b949350505050565b6060824710156142d35760405162461bcd60e51b81526004018080602001828103825260268152602001806146bd6026913960400191505060405180910390fd5b6142dc85612d3a565b61432d576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b6020831061436c5780518252601f19909201916020918201910161434d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146143ce576040519150601f19603f3d011682016040523d82523d6000602084013e6143d3565b606091505b50915091506143e38282866143ee565b979650505050505050565b606083156143fd575081613382565b82511561440d5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561445757818101518382015260200161443f565b50505050905090810190601f1680156144845780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810182905261010081019190915290565b6040805160808101825260008082526020820181905291810182905260608101919091529056fe54686520616363657074656420746f6b656e2061646472657373206d7573742062652061206465706c6f79656420636f6e74726163744f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734d61726b6574706c6163653a204578706972652074696d652073686f756c64206265206d6f7265207468616e2031206d696e75746520696e20746865206675747572654d61726b6574706c6163653a206f6e6c79206275792066697865642070726963654d61726b6574706c6163653a2050726963652073686f756c6420626520626967676572207468616e20304d61726b6574706c6163653a204f6e6c7920746865206173736574206f776e65722063616e20637265617465206f72646572734d61726b6574706c6163653a205075626c69636174696f6e2073686f756c64206265206d6f7265207468616e2031206d696e75746520696e2074686520667574757265546865204e465420636f6e74726163742068617320616e20696e76616c69642045524337323120696d706c656d656e746174696f6e45434453413a20696e76616c6964207369676e6174757265202773272076616c7565416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c45434453413a20696e76616c6964207369676e6174757265202776272076616c7565536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774d61726b6574706c6163653a20556e61636365707461626c65206d61726b6574706c6163652063757272656e63794d61726b6574706c6163653a20556e61636365707461626c65206d61726b6574706c616365206e6674546865204e465420416464726573732073686f756c64206265206120636f6e74726163744d61726b6574706c6163653a206269642070726963652073686f756c6420626520686967686572207468616e206c617374206269645361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564546865206f776e6572206375742073686f756c64206265206265747765656e203020616e64206d61784375745065724d696c6c696f6ea26469706673582212209eeacd58dc7a433fc0f34d63604598e3f6a9bb1238d66f40e0fc22482685789464736f6c634300060c0033

Deployed Bytecode

0x6080604052600436106102345760003560e01c806374d2706911610138578063cf7ce01f116100b0578063efdcd9741161007f578063f2fde38b11610064578063f2fde38b14610a13578063f83b216214610a46578063fcedebd214610b4657610234565b8063efdcd974146109ad578063f2e2e2aa146109e057610234565b8063cf7ce01f14610881578063dece6854146108c6578063e13a40f0146108db578063e61f38511461091a57610234565b8063ad21981311610107578063b3f00674116100ec578063b3f0067414610805578063c555e05014610432578063cd08bfe11461081a57610234565b8063ad219813146106dd578063b1062fc61461071057610234565b806374d27069146106205780637a71ab41146106625780638da5cb5b14610695578063a30af25b146106aa57610234565b806339b6b1e5116101cb5780634206ebba1161019a5780635c975abb1161017f5780635c975abb146105a95780636a206137146105d2578063715018a61461060b57610234565b80634206ebba1461053d5780634ae2e50f1461057057610234565b806339b6b1e5146104795780633a5381b5146104b25780633ac44917146104c75780633db887611461050257610234565b8063293315f211610207578063293315f2146103da57806329ac3772146104015780632fe05b371461043257806338940b5b1461044757610234565b80631327d3d814610239578063150b7a021461026e57806316c38b3c146103765780631d22da91146103a2575b600080fd5b34801561024557600080fd5b5061026c6004803603602081101561025c57600080fd5b50356001600160a01b0316610b5b565b005b34801561027a57600080fd5b506103416004803603608081101561029157600080fd5b6001600160a01b038235811692602081013590911691604082013591908101906080810160608201356401000000008111156102cc57600080fd5b8201836020820111156102de57600080fd5b8035906020019184600183028401116401000000008311171561030057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610ca6945050505050565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b34801561038257600080fd5b5061026c6004803603602081101561039957600080fd5b50351515610ccf565b61026c600480360360808110156103b857600080fd5b506001600160a01b038135169060208101359060408101359060600135610d60565b3480156103e657600080fd5b506103ef610e71565b60408051918252519081900360200190f35b34801561040d57600080fd5b50610416610e78565b604080516001600160a01b039092168252519081900360200190f35b34801561043e57600080fd5b506103ef610e87565b61026c6004803603606081101561045d57600080fd5b506001600160a01b038135169060208101359060400135610e8e565b34801561048557600080fd5b5061026c6004803603604081101561049c57600080fd5b506001600160a01b03813516906020013561134f565b3480156104be57600080fd5b5061041661146c565b3480156104d357600080fd5b5061026c600480360360408110156104ea57600080fd5b506001600160a01b038135169060200135151561147b565b34801561050e57600080fd5b5061026c6004803603604081101561052557600080fd5b506001600160a01b0381351690602001351515611567565b34801561054957600080fd5b5061026c6004803603602081101561056057600080fd5b50356001600160a01b0316611653565b34801561057c57600080fd5b5061026c6004803603604081101561059357600080fd5b506001600160a01b038135169060200135611781565b3480156105b557600080fd5b506105be611891565b604080519115158252519081900360200190f35b3480156105de57600080fd5b5061026c600480360360408110156105f557600080fd5b506001600160a01b03813516906020013561189a565b34801561061757600080fd5b5061026c611a5a565b61026c600480360360a081101561063657600080fd5b506001600160a01b03813581169160208101359160408201359160608101359160809091013516611b34565b34801561066e57600080fd5b506103ef6004803603602081101561068557600080fd5b50356001600160a01b0316611cab565b3480156106a157600080fd5b50610416611cbd565b3480156106b657600080fd5b5061026c600480360360208110156106cd57600080fd5b50356001600160a01b0316611cd1565b3480156106e957600080fd5b506105be6004803603602081101561070057600080fd5b50356001600160a01b0316611eb0565b34801561071c57600080fd5b5061026c600480360361012081101561073457600080fd5b6001600160a01b038235811692602081013592604082013592606083013592608081013582169260a082013515159260c0830135169160e081013591810190610120810161010082013564010000000081111561079057600080fd5b8201836020820111156107a257600080fd5b803590602001918460018302840111640100000000831117156107c457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611ec5945050505050565b34801561081157600080fd5b5061041661206e565b34801561082657600080fd5b506108536004803603604081101561083d57600080fd5b506001600160a01b03813516906020013561207d565b604080519485526001600160a01b039093166020850152838301919091526060830152519081900360800190f35b34801561088d57600080fd5b5061026c600480360360808110156108a457600080fd5b506001600160a01b0381351690602081013590604081013590606001356120b9565b3480156108d257600080fd5b50610341612313565b3480156108e757600080fd5b5061026c600480360360608110156108fe57600080fd5b506001600160a01b038135169060208101359060400135612337565b34801561092657600080fd5b506109536004803603604081101561093d57600080fd5b506001600160a01b0381351690602001356127c9565b60408051998a526001600160a01b0398891660208b0152968816898801526060890195909552608088019390935290851660a0870152151560c086015290921660e084015261010083019190915251908190036101200190f35b3480156109b957600080fd5b5061026c600480360360208110156109d057600080fd5b50356001600160a01b0316612843565b3480156109ec57600080fd5b506105be60048036036020811015610a0357600080fd5b50356001600160a01b0316612982565b348015610a1f57600080fd5b5061026c60048036036020811015610a3657600080fd5b50356001600160a01b0316612997565b348015610a5257600080fd5b5061026c6004803603610140811015610a6a57600080fd5b6001600160a01b038235811692602081013592604082013592606083013592608081013582169260a082013515159260c0830135169160e0810135918101906101208101610100820135640100000000811115610ac657600080fd5b820183602082011115610ad857600080fd5b80359060200191846001830284011164010000000083111715610afa57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550505090356001600160a01b03169150612acd9050565b348015610b5257600080fd5b50610416612d1e565b610b63612d36565b6001600160a01b0316610b74611cbd565b6001600160a01b031614610bcf576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811615801590610bf65750610bf4816001600160a01b0316612d3a565b155b610c47576040805162461bcd60e51b815260206004820152601c60248201527f4d61726b6574706c6163653a20696e76616c6964206164647265737300000000604482015290519081900360640190fd5b600880546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f021e99fb14cdbadf08fceee0f5d5b97881f9c7853cea56cac83621f0b44ac36590600090a35050565b7f150b7a0200000000000000000000000000000000000000000000000000000000949350505050565b610cd7612d36565b6001600160a01b0316610ce8611cbd565b6001600160a01b031614610d43576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b80610d5557610d50612d40565b610d5d565b610d5d612de9565b50565b610d68611891565b15610dad576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b60026003541415610e05576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600355610e12614492565b610e1c8585612e6c565b60a08101519091506001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14610e5857610e5385858486612fce565b610e64565b610e6485853486612fce565b5050600160035550505050565b620f424081565b6009546001600160a01b031681565b620186a081565b610e96611891565b15610edb576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b610ee3614492565b610eed8484612e6c565b60208101519091506001600160a01b0316331415610f52576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a20756e617574686f72697a65642073656e646572604482015290519081900360640190fd5b60a08101516001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee148015610fd95734826060015114610fd4576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a20696e76616c6964207072696365000000000000604482015290519081900360640190fd5b611031565b82826060015114611031576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a20696e76616c6964207072696365000000000000604482015290519081900360640190fd5b6040808301516001600160a01b03166000908152600260205290812054819081811561109c57841561107b57611074620f424061106e3485613329565b90613389565b935061109c565b611099620f424061106e84896060015161332990919063ffffffff16565b93505b60e08601516001600160a01b0316158015906110bd57506000866101000151115b156111145784156110ee576110e7620f424061106e8861010001513461332990919063ffffffff16565b9250611114565b611111620f424061106e886101000151896060015161332990919063ffffffff16565b92505b600061112084866133f0565b90508087606001511061114357606087015161113c908261344a565b9150611190565b6040805162461bcd60e51b815260206004820152601960248201527f4665652069732067726561746572207468616e20707269636500000000000000604482015290519081900360640190fd5b8515611252576001546040516001600160a01b039091169086156108fc029087906000818181858888f193505050501580156111d0573d6000803e3d6000fd5b508660e001516001600160a01b03166108fc859081150290604051600060405180830381858888f1935050505015801561120e573d6000803e3d6000fd5b5086602001516001600160a01b03166108fc839081150290604051600060405180830381858888f1935050505015801561124c573d6000803e3d6000fd5b506112ad565b60a0870151600154611273906001600160a01b0380841691339116896134a7565b60e088015161128f906001600160a01b038316903390886134a7565b60208801516112ab906001600160a01b038316903390866134a7565b505b6112b56144de565b506001600160a01b03808b1660009081526005602090815260408083208d8452825291829020825160808101845281548082526001830154909516928101929092526002810154928201929092526003909101546060820152901561132d5761132d81600001518c8c8460200151856040015161352f565b6113428860000151338d8d8c6060015161364d565b5050505050505050505050565b611357611891565b1561139c576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6113a46144de565b506001600160a01b03808316600090815260056020908152604080832085845282529182902082516080810184528154815260018201549094169184018290526002810154928401929092526003909101546060830152331461144e576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a20556e617574686f72697a65642073656e646572604482015290519081900360640190fd5b611467816000015184848460200151856040015161352f565b505050565b6008546001600160a01b031681565b611483612d36565b6001600160a01b0316611494611cbd565b6001600160a01b0316146114ef576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b611501826001600160a01b0316612d3a565b61153c5760405162461bcd60e51b81526004018080602001828103825260368152602001806145066036913960400191505060405180910390fd5b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b61156f612d36565b6001600160a01b0316611580611cbd565b6001600160a01b0316146115db576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6115ed826001600160a01b0316612d3a565b6116285760405162461bcd60e51b81526004018080602001828103825260368152602001806145066036913960400191505060405180910390fd5b6001600160a01b03919091166000908152600760205260409020805460ff1916911515919091179055565b61165b612d36565b6001600160a01b031661166c611cbd565b6001600160a01b0316146116c7576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116611722576040805162461bcd60e51b815260206004820152601c60248201527f4d61726b6574706c6163653a20696e76616c6964206164647265737300000000604482015290519081900360640190fd5b600980546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f021e99fb14cdbadf08fceee0f5d5b97881f9c7853cea56cac83621f0b44ac36590600090a35050565b611789612d36565b6001600160a01b031661179a611cbd565b6001600160a01b0316146117f5576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b620186a081106118365760405162461bcd60e51b81526004018080602001828103825260368152602001806148006036913960400191505060405180910390fd5b6001600160a01b03821660008181526002602090815260409182902084905581518481529081019290925280517f2975d7c97017ea947833e51a609466c628e7803e404c57000d24c4c3a9250bbd9281900390910190a15050565b60005460ff1690565b6118a2614492565b506001600160a01b0382811660009081526004602081815260408084208685528252928390208351610120810185528154815260018201548616928101839052600282015486169481019490945260038101546060850152918201546080840152600582015480851660a085015274010000000000000000000000000000000000000000900460ff16151560c0840152600682015490931660e0830152600701546101008201529033148061196f575061195a611cbd565b6001600160a01b0316336001600160a01b0316145b6119c0576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a20756e617574686f72697a65642073656e646572604482015290519081900360640190fd5b6119c86144de565b506001600160a01b0380841660009081526005602090815260408083208684528252918290208251608081018452815480825260018301549095169281019290925260028101549282019290925260039091015460608201529015611a4057611a40816000015185858460200151856040015161352f565b611a54826000015185858560200151613797565b50505050565b611a62612d36565b6001600160a01b0316611a73611cbd565b6001600160a01b031614611ace576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516101009091046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffff0000000000000000000000000000000000000000ff169055565b611b3c611891565b15611b81576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b60026003541415611bd9576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600355611be6614492565b611bf08686612e6c565b9050600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b03168260a001516001600160a01b031614611c3657611c3187878688612fce565b611c42565b611c4287873488612fce565b60408051828152602081018790528082018890526001600160a01b0386811660608301529151929350339289928b16917f24035b4609386405033f1e34954019c016ad17aa0a0c43bb88fdd4fdcbe6b952919081900360800190a4505060016003555050505050565b60026020526000908152604090205481565b60005461010090046001600160a01b031690565b611cd9612d36565b6001600160a01b0316611cea611cbd565b6001600160a01b031614611d45576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b611d4d611891565b611d9e576040805162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611e0957611dcb611cbd565b6001600160a01b03166108fc479081150290604051600060405180830381858888f19350505050158015611e03573d6000803e3d6000fd5b50610d5d565b610d5d611e14611cbd565b604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290516001600160a01b038516916370a08231916024808301926020929190829003018186803b158015611e7357600080fd5b505afa158015611e87573d6000803e3d6000fd5b505050506040513d6020811015611e9d57600080fd5b50516001600160a01b03841691906138ce565b60076020526000908152604090205460ff1681565b611ecd611891565b15611f12576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b808383620186a0811115611f6d576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a206d617820726f79616c20666565000000000000604482015290519081900360640190fd5b6000611fda8333308560405160200180856001600160a01b031660601b8152601401846001600160a01b031660601b8152601401836001600160a01b031660601b81526014018281526020019450505050506040516020818303038152906040528051906020012061394e565b6008549091506001600160a01b0316611ff3828661399f565b6001600160a01b03161461204e576040805162461bcd60e51b815260206004820152601460248201527f4d61726b6574706c6163653a2021766572696679000000000000000000000000604482015290519081900360640190fd5b61205e8d8d8d8d8d8d8d8d613a1f565b5050505050505050505050505050565b6001546001600160a01b031681565b6005602090815260009283526040808420909152908252902080546001820154600283015460039093015491926001600160a01b039091169184565b6120c1611891565b15612106576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6001600160a01b03841660009081526004602090815260408083208684529091529020805461217c576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a206173736574206e6f74207075626c6973686564604482015290519081900360640190fd5b60018101546001600160a01b031633146121dd576040805162461bcd60e51b815260206004820152601f60248201527f4d61726b6574706c6163653a2073656e646572206e6f7420616c6c6f77656400604482015290519081900360640190fd5b4281600401541015612236576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a206f726465722065787069726564000000000000604482015290519081900360640190fd5b600083116122755760405162461bcd60e51b815260040180806020018281038252602a8152602001806145c6602a913960400191505060405180910390fd5b61228042603c6133f0565b82116122bd5760405162461bcd60e51b81526004018080602001828103825260438152602001806145626043913960600191505060405180910390fd5b600381018390556004810182905580546040805191825260208201859052818101849052517f37de993802f8ab9c75f6d7d3065ba8ab95ce30051219b14251415925e68e0a489181900360600190a15050505050565b7f80ac58cd0000000000000000000000000000000000000000000000000000000081565b61233f611891565b15612384576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b61238c614492565b6123968484612e6c565b60208101519091506001600160a01b031633146123fa576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a20756e617574686f72697a65642073656e646572604482015290519081900360640190fd5b6124026144de565b506001600160a01b038085166000908152600560209081526040808320878452825291829020825160808101845281548152600182015490941691840191909152600281015491830182905260030154606083015283146124aa576040805162461bcd60e51b815260206004820152601e60248201527f4d61726b6574706c6163653a20696e76616c6964206269642070726963650000604482015290519081900360640190fd5b4281606001511015612503576040805162461bcd60e51b815260206004820152601c60248201527f4d61726b6574706c6163653a2074686520626964206578706972656400000000604482015290519081900360640190fd5b6001600160a01b0385166000908152600560209081526040808320878452825280832083815560018101805473ffffffffffffffffffffffffffffffffffffffff1916905560028101849055600301929092558251825190815291517ff8c7d5572fa269efc040934ae7553d57f8906bffd616254bef0b94e2b569e4169281900390910190a16040808301516001600160a01b03908116600090815260026020529182205460a0850151839283911673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1482156125e2576125df620f424061106e8a86613329565b94505b60e08701516001600160a01b03161580159061260357506000876101000151115b1561262a57612627620f424061106e8961010001518b61332990919063ffffffff16565b93505b600061263685876133f0565b905080891061114357612649898261344a565b9250811561270d576001546040516001600160a01b039091169087156108fc029088906000818181858888f1935050505015801561268b573d6000803e3d6000fd5b508760e001516001600160a01b03166108fc869081150290604051600060405180830381858888f193505050501580156126c9573d6000803e3d6000fd5b5087602001516001600160a01b03166108fc849081150290604051600060405180830381858888f19350505050158015612707573d6000803e3d6000fd5b50612768565b60a088015160015461272e906001600160a01b03808416913391168a6134a7565b60e089015161274a906001600160a01b038316903390896134a7565b6020890151612766906001600160a01b038316903390876134a7565b505b61277d886000015188602001518d8d8d61364d565b8751875160408051928352602083019190915280517fb3fd31fc3ad6e598b907aad9aa3cc523ac01201169000666e95e5438a17cb3699281900390910190a15050505050505050505050565b600460208181526000938452604080852090915291835291208054600182015460028301546003840154948401546005850154600686015460079096015494966001600160a01b03948516969385169590949293838316937401000000000000000000000000000000000000000090930460ff1692169089565b61284b612d36565b6001600160a01b031661285c611cbd565b6001600160a01b0316146128b7576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116612912576040805162461bcd60e51b815260206004820152601d60248201527f5f6e65772072656365697665722069732061646472657373207a65726f000000604482015290519081900360640190fd5b600180546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040805191909216808252602082019390935281517fd79a033509d5860f46d2ea09749b135bd89cc001a397067f42a80dbe250e9d8d929181900390910190a15050565b60066020526000908152604090205460ff1681565b61299f612d36565b6001600160a01b03166129b0611cbd565b6001600160a01b031614612a0b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116612a505760405162461bcd60e51b815260040180806020018281038252602681526020018061453c6026913960400191505060405180910390fd5b600080546040516001600160a01b038085169361010090930416917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b03909216610100027fffffffffffffffffffffff0000000000000000000000000000000000000000ff909216919091179055565b612ad5611891565b15612b1a576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b818484620186a0811115612b75576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a206d617820726f79616c20666565000000000000604482015290519081900360640190fd5b6000612be28333308560405160200180856001600160a01b031660601b8152601401846001600160a01b031660601b8152601401836001600160a01b031660601b81526014018281526020019450505050506040516020818303038152906040528051906020012061394e565b6008549091506001600160a01b0316612bfb828661399f565b6001600160a01b031614612c56576040805162461bcd60e51b815260206004820152601460248201527f4d61726b6574706c6163653a2021766572696679000000000000000000000000604482015290519081900360640190fd5b6009546001600160a01b03163314612cb5576040805162461bcd60e51b815260206004820152601460248201527f4f6e6c7920696e7465726e616c2077616c6c6574000000000000000000000000604482015290519081900360640190fd5b6000612cc78f8f8f8f8f8f8f8f613a1f565b604080518281526001600160a01b038916602082015281519293507f50109e39e61de37cb6c25dd49620dd16c4c1a5c8d264b563d18756180cbec7bc929081900390910190a1505050505050505050505050505050565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b3390565b3b151590565b612d48611891565b612d99576040805162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612dcc612d36565b604080516001600160a01b039092168252519081900360200190a1565b612df1611891565b15612e36576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612dcc612d36565b612e74614492565b506001600160a01b03828116600090815260046020818152604080842086855282529283902083516101208101855281548082526001830154871693820193909352600282015486169481019490945260038101546060850152918201546080840152600582015480851660a085015274010000000000000000000000000000000000000000900460ff16151560c0840152600682015490931660e08301526007015461010082015290612f6f576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a206173736574206e6f74207075626c6973686564604482015290519081900360640190fd5b4281608001511015612fc8576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a206f726465722065787069726564000000000000604482015290519081900360640190fd5b92915050565b6000612fd8614492565b612fe28686612e6c565b90508060c001516130245760405162461bcd60e51b81526004018080602001828103825260218152602001806145a56021913960400191505060405180910390fd5b806080015183111561303857806080015192505b6130406144de565b506001600160a01b038087166000908152600560209081526040808320898452825291829020825160808101845281548082526001830154909516928101929092526002810154928201929092526003909101546060820152901561316457428160600151106130f157806040015185116130ec5760405162461bcd60e51b81526004018080602001828103825260358152602001806147a16035913960400191505060405180910390fd5b613146565b60008511613146576040805162461bcd60e51b815260206004820152601e60248201527f4d61726b6574706c6163653a206269642073686f756c64206265203e20300000604482015290519081900360640190fd5b61315f816000015188888460200151856040015161352f565b6131b9565b600085116131b9576040805162461bcd60e51b815260206004820152601e60248201527f4d61726b6574706c6163653a206269642073686f756c64206265203e20300000604482015290519081900360640190fd5b600042338460000151888860405160200180868152602001856001600160a01b031660601b8152601401848152602001838152602001828152602001955050505050506040516020818303038152906040528051906020012090506040518060800160405280828152602001336001600160a01b0316815260200187815260200186815250600560008a6001600160a01b03166001600160a01b0316815260200190815260200160002060008981526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506040820151816002015560608201518160030155905050336001600160a01b031687896001600160a01b03167fae7b5aee7763f3e7771076de8f7b61accb70ad42245fee23308e19c8bcd518e4848a8a60405180848152602001838152602001828152602001935050505060405180910390a4979650505050505050565b60008261333857506000612fc8565b8282028284828161334557fe5b04146133825760405162461bcd60e51b81526004018080602001828103825260218152602001806147056021913960400191505060405180910390fd5b9392505050565b60008082116133df576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816133e857fe5b049392505050565b600082820183811015613382576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000828211156134a1576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052611a54908590613f13565b6001600160a01b0384166000908152600560209081526040808320868452909152812081815560018101805473ffffffffffffffffffffffffffffffffffffffff191690556002810182905560030155613587614492565b6135918585612e6c565b60a08101519091506001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146135da5760a08101516135d5906001600160a01b031684846138ce565b613612565b6040516001600160a01b0384169083156108fc029084906000818181858888f19350505050158015613610573d6000803e3d6000fd5b505b6040805187815290517fb56dc4096011ba5fd2e46e5c3e7b04dec423b5e7b5fce9a17a419d77c832177c9181900360200190a1505050505050565b6001600160a01b03808416600081815260046020818152604080842088855290915280832083815560018101805473ffffffffffffffffffffffffffffffffffffffff1990811690915560028201805482169055600382018590558184018590556005820180547fffffffffffffffffffffff00000000000000000000000000000000000000000016905560068201805490911690556007018390558051632142170760e11b81523092810192909252938816602482015260448101869052925191926342842e0e926064808301939282900301818387803b15801561373257600080fd5b505af1158015613746573d6000803e3d6000fd5b5050604080518881526020810185905281516001600160a01b03891694507f012d66d656f295c1a84576b9b7f0a83474ed09578e80f7f1a715fb958e1d546393509081900390910190a25050505050565b6001600160a01b03808416600081815260046020818152604080842088855290915280832083815560018101805473ffffffffffffffffffffffffffffffffffffffff1990811690915560028201805482169055600382018590558184018590556005820180547fffffffffffffffffffffff00000000000000000000000000000000000000000016905560068201805490911690556007018390558051632142170760e11b81523092810192909252938516602482015260448101869052925191926342842e0e926064808301939282900301818387803b15801561387c57600080fd5b505af1158015613890573d6000803e3d6000fd5b50506040805187815290517f5152abf959f6564662358c2e52b702259b78bac5ee7842a0f01937e670efcc7d9350908190036020019150a150505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052611467908490613f13565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b600081516041146139f7576040805162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015290519081900360640190fd5b60208201516040830151606084015160001a613a1586828585613fc4565b9695505050505050565b600080613a2b8a614142565b6001600160a01b038b1660009081526007602052604090205490915060ff16613a855760405162461bcd60e51b81526004018080602001828103825260298152602001806147546029913960400191505060405180910390fd5b6001600160a01b03861660009081526006602052604090205460ff16613adc5760405162461bcd60e51b815260040180806020018281038252602e815260200180614726602e913960400191505060405180910390fd5b6000816001600160a01b0316636352211e8b6040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015613b2257600080fd5b505afa158015613b36573d6000803e3d6000fd5b505050506040513d6020811015613b4c57600080fd5b505190506001600160a01b0381163314613b975760405162461bcd60e51b81526004018080602001828103825260338152602001806145f06033913960400191505060405180910390fd5b60008911613bd65760405162461bcd60e51b815260040180806020018281038252602a8152602001806145c6602a913960400191505060405180910390fd5b613be142603c6133f0565b8811613c1e5760405162461bcd60e51b81526004018080602001828103825260438152602001806146236043913960600191505060405180910390fd5b60408051632142170760e11b81526001600160a01b038381166004830152306024830152604482018d90529151918416916342842e0e9160648082019260009290919082900301818387803b158015613c7657600080fd5b505af1158015613c8a573d6000803e3d6000fd5b50505050600042828d8d8d60405160200180868152602001856001600160a01b031660601b8152601401846001600160a01b031660601b815260140183815260200182815260200195505050505050604051602081830303815290604052805190602001209050604051806101200160405280828152602001836001600160a01b031681526020018d6001600160a01b031681526020018b81526020018a8152602001896001600160a01b031681526020018815158152602001876001600160a01b0316815260200186815250600460008e6001600160a01b03166001600160a01b0316815260200190815260200160002060008d81526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550606082015181600301556080820151816004015560a08201518160050160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060c08201518160050160146101000a81548160ff02191690831515021790555060e08201518160060160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555061010082015181600701559050508a8c6001600160a01b0316836001600160a01b03167f824ac4c21c415646c2086042c220821208efc3c5f1c76761234340e2e261ab47848e8e8e8e60405180868152602001858152602001848152602001836001600160a01b0316815260200182151581526020019550505050505060405180910390a49b9a5050505050505050505050565b6060613f68826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661427b9092919063ffffffff16565b80519091501561146757808060200190516020811015613f8757600080fd5b50516114675760405162461bcd60e51b815260040180806020018281038252602a8152602001806147d6602a913960400191505060405180910390fd5b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08211156140255760405162461bcd60e51b815260040180806020018281038252602281526020018061469b6022913960400191505060405180910390fd5b8360ff16601b148061403a57508360ff16601c145b6140755760405162461bcd60e51b81526004018080602001828103825260228152602001806146e36022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156140d1573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116614139576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b6000614156826001600160a01b0316612d3a565b6141915760405162461bcd60e51b815260040180806020018281038252602481526020018061477d6024913960400191505060405180910390fd5b604080517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f80ac58cd00000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038416916301ffc9a7916024808301926020929190829003018186803b15801561421057600080fd5b505afa158015614224573d6000803e3d6000fd5b505050506040513d602081101561423a57600080fd5b50516142775760405162461bcd60e51b81526004018080602001828103825260358152602001806146666035913960400191505060405180910390fd5b5090565b606061428a8484600085614292565b949350505050565b6060824710156142d35760405162461bcd60e51b81526004018080602001828103825260268152602001806146bd6026913960400191505060405180910390fd5b6142dc85612d3a565b61432d576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b6020831061436c5780518252601f19909201916020918201910161434d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146143ce576040519150601f19603f3d011682016040523d82523d6000602084013e6143d3565b606091505b50915091506143e38282866143ee565b979650505050505050565b606083156143fd575081613382565b82511561440d5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561445757818101518382015260200161443f565b50505050905090810190601f1680156144845780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810182905261010081019190915290565b6040805160808101825260008082526020820181905291810182905260608101919091529056fe54686520616363657074656420746f6b656e2061646472657373206d7573742062652061206465706c6f79656420636f6e74726163744f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734d61726b6574706c6163653a204578706972652074696d652073686f756c64206265206d6f7265207468616e2031206d696e75746520696e20746865206675747572654d61726b6574706c6163653a206f6e6c79206275792066697865642070726963654d61726b6574706c6163653a2050726963652073686f756c6420626520626967676572207468616e20304d61726b6574706c6163653a204f6e6c7920746865206173736574206f776e65722063616e20637265617465206f72646572734d61726b6574706c6163653a205075626c69636174696f6e2073686f756c64206265206d6f7265207468616e2031206d696e75746520696e2074686520667574757265546865204e465420636f6e74726163742068617320616e20696e76616c69642045524337323120696d706c656d656e746174696f6e45434453413a20696e76616c6964207369676e6174757265202773272076616c7565416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c45434453413a20696e76616c6964207369676e6174757265202776272076616c7565536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774d61726b6574706c6163653a20556e61636365707461626c65206d61726b6574706c6163652063757272656e63794d61726b6574706c6163653a20556e61636365707461626c65206d61726b6574706c616365206e6674546865204e465420416464726573732073686f756c64206265206120636f6e74726163744d61726b6574706c6163653a206269642070726963652073686f756c6420626520686967686572207468616e206c617374206269645361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564546865206f776e6572206375742073686f756c64206265206265747765656e203020616e64206d61784375745065724d696c6c696f6ea26469706673582212209eeacd58dc7a433fc0f34d63604598e3f6a9bb1238d66f40e0fc22482685789464736f6c634300060c0033

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.