ETH Price: $2,710.42 (+0.89%)

Contract

0xb6D245c9b9c744DdfF115713BFCF34606239B010
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Create Order161646212022-12-11 23:02:35796 days ago1670799755IN
0xb6D245c9...06239B010
0 ETH0.0035304114.07571583
Cancel Order161395882022-12-08 11:06:59800 days ago1670497619IN
0xb6D245c9...06239B010
0 ETH0.0019836315.19359679
Create Order161395852022-12-08 11:06:23800 days ago1670497583IN
0xb6D245c9...06239B010
0 ETH0.0035146113.74895514
Create Order161395682022-12-08 11:02:59800 days ago1670497379IN
0xb6D245c9...06239B010
0 ETH0.0038809715.1821363
Create Order161395652022-12-08 11:02:23800 days ago1670497343IN
0xb6D245c9...06239B010
0 ETH0.004020415.14686463
Create Order161389672022-12-08 9:01:59800 days ago1670490119IN
0xb6D245c9...06239B010
0 ETH0.0036271214.18906713
Create Order161389542022-12-08 8:59:23800 days ago1670489963IN
0xb6D245c9...06239B010
0 ETH0.003665114.33765704
Create Order161389492022-12-08 8:58:23800 days ago1670489903IN
0xb6D245c9...06239B010
0 ETH0.0036671413.81597402
Create Order161176522022-12-05 9:16:59803 days ago1670231819IN
0xb6D245c9...06239B010
0 ETH0.0035644713.94531645
Create Order161175062022-12-05 8:47:35803 days ago1670230055IN
0xb6D245c9...06239B010
0 ETH0.0034405313.45977157
Create Order161080532022-12-04 1:05:47804 days ago1670115947IN
0xb6D245c9...06239B010
0 ETH0.0028310211.07583272
Cancel Order161075852022-12-03 23:31:47804 days ago1670110307IN
0xb6D245c9...06239B010
0 ETH0.0015370211.7728062
Create Order161073892022-12-03 22:52:23804 days ago1670107943IN
0xb6D245c9...06239B010
0 ETH0.0029868711.68446403
Create Order161053802022-12-03 16:08:23804 days ago1670083703IN
0xb6D245c9...06239B010
0 ETH0.0032096712.55722752
Create Order161053502022-12-03 16:02:23804 days ago1670083343IN
0xb6D245c9...06239B010
0 ETH0.0033426613.07752717
Create Order161052772022-12-03 15:47:35804 days ago1670082455IN
0xb6D245c9...06239B010
0 ETH0.0029142211.61951568
Create Order160975902022-12-02 14:01:59805 days ago1669989719IN
0xb6D245c9...06239B010
0 ETH0.0044349216.70859131
Create Order160975872022-12-02 14:01:23805 days ago1669989683IN
0xb6D245c9...06239B010
0 ETH0.0041274515.55019781
Create Order160975762022-12-02 13:59:11805 days ago1669989551IN
0xb6D245c9...06239B010
0 ETH0.0044590816.79959349
Create Order160975712022-12-02 13:58:11805 days ago1669989491IN
0xb6D245c9...06239B010
0 ETH0.0044076716.606675
Create Order160975662022-12-02 13:57:11805 days ago1669989431IN
0xb6D245c9...06239B010
0 ETH0.0041698515.7099307
Create Order160975602022-12-02 13:55:59805 days ago1669989359IN
0xb6D245c9...06239B010
0 ETH0.0048215718.16526759
Create Order160975572022-12-02 13:55:23805 days ago1669989323IN
0xb6D245c9...06239B010
0 ETH0.0044451716.74721266
Create Order160975532022-12-02 13:54:35805 days ago1669989275IN
0xb6D245c9...06239B010
0 ETH0.003694513.91906645
Create Order160975492022-12-02 13:53:47805 days ago1669989227IN
0xb6D245c9...06239B010
0 ETH0.0029883511.69025287
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PayableTokenMarketplace

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 2000 runs

Other Settings:
default evmVersion, Apache-2.0 license
File 1 of 14 : PayableTokenMarketplace.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 "./FeeManager.sol";

pragma solidity ^0.6.8;


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;
    }

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

contract PayableTokenMarketplace is Pausable, FeeManager, IMarketplace, ERC721Holder, ReentrancyGuard {

    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;

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

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

    /**
     * @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) external whenNotPaused {
        _createOrder(_nftAddress, _assetId, _priceInWei, _expiresAt, _currency, _isAuction);
    }

    /**
     * @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 whenNotPaused {
        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");

        order.currency == MARKETPLACE_ETHER ?
            require(order.price == msg.value, "Marketplace: invalid price")
            :
            require(order.price == _priceInWei, "Marketplace: invalid price");

        // market fee to cut
        uint256 saleShareAmount = 0;

        // Send market fees to owner

        if (cutPerMillion > 0) {

            // Calculate sale share
            order.currency == MARKETPLACE_ETHER ?
            saleShareAmount = (msg.value).mul(cutPerMillion).div(PERCENTAGE)
            :
            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);
        }

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

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

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

        // market fee to cut
        uint256 saleShareAmount = 0;

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

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

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

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

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

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

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

File 2 of 14 : 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 3 of 14 : 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 4 of 14 : 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 5 of 14 : 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 6 of 14 : 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 14 : 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 14 : 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 9 of 14 : 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 10 of 14 : 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 11 of 14 : 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 12 of 14 : 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 13 of 14 : FeeManager.sol
// SPDX-License-Identifier: Apache-2.0

pragma solidity ^0.6.8;

import "./Ownable.sol";


contract FeeManager is Ownable {

    event ChangedFeePerMillion(uint256 cutPerMillion);

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

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

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

pragma solidity >=0.6.0 <0.8.0;

import '@openzeppelin/contracts/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");
        _;
    }
}

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

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":"uint256","name":"cutPerMillion","type":"uint256"}],"name":"ChangedFeePerMillion","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"}],"name":"createOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cutPerMillion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxCutPerMillion","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"}],"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":[{"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":"_token","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"setCurrency","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":"uint256","name":"_cutPerMillion","type":"uint256"}],"name":"setOwnerCutPerMillion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_setPaused","type":"bool"}],"name":"setPaused","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":[{"internalType":"address","name":"","type":"address"}],"name":"whiteListNft","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b506000805460ff191681556100236100ca565b60008054610100600160a81b0319166101006001600160a01b038416908102919091178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506001600281905573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee60005260056020527fa1829a9003092132f585b6ccdd167c19fe9774dbdea4260287e8a8e8ca8185d7805460ff191690911790556100ce565b3390565b6132a280620000de6000396000f3fe6080604052600436106101805760003560e01c8063673c8553116100d6578063cf7ce01f1161007f578063e61f385111610059578063e61f38511461066a578063f2e2e2aa146106ec578063fcedebd21461071f57610180565b8063cf7ce01f146105d1578063dece685414610616578063e13a40f01461062b57610180565b8063ad219813116100b0578063ad21981314610522578063c555e05014610555578063cd08bfe11461056a57610180565b8063673c8553146104a35780636a206137146104b85780638da5cb5b146104f157610180565b806338940b5b116101385780633db88761116101125780633db88761146103ea5780633fbec39a146104255780635c975abb1461047a57610180565b806338940b5b1461034457806339b6b1e5146103765780633ac44917146103af57610180565b806319dad16d1161016957806319dad16d146102bb5780631d22da91146102e5578063293315f21461031d57610180565b8063150b7a021461018557806316c38b3c1461028d575b600080fd5b34801561019157600080fd5b50610258600480360360808110156101a857600080fd5b6001600160a01b038235811692602081013590911691604082013591908101906080810160608201356401000000008111156101e357600080fd5b8201836020820111156101f557600080fd5b8035906020019184600183028401116401000000008311171561021757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610734945050505050565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b34801561029957600080fd5b506102b9600480360360208110156102b057600080fd5b5035151561075d565b005b3480156102c757600080fd5b506102b9600480360360208110156102de57600080fd5b50356107ee565b6102b9600480360360808110156102fb57600080fd5b506001600160a01b0381351690602081013590604081013590606001356108de565b34801561032957600080fd5b506103326109ec565b60408051918252519081900360200190f35b6102b96004803603606081101561035a57600080fd5b506001600160a01b0381351690602081013590604001356109f3565b34801561038257600080fd5b506102b96004803603604081101561039957600080fd5b506001600160a01b038135169060200135610df9565b3480156103bb57600080fd5b506102b9600480360360408110156103d257600080fd5b506001600160a01b0381351690602001351515610f16565b3480156103f657600080fd5b506102b96004803603604081101561040d57600080fd5b506001600160a01b0381351690602001351515611002565b34801561043157600080fd5b506102b9600480360360c081101561044857600080fd5b506001600160a01b0381358116916020810135916040820135916060810135916080820135169060a0013515156110ee565b34801561048657600080fd5b5061048f611149565b604080519115158252519081900360200190f35b3480156104af57600080fd5b50610332611152565b3480156104c457600080fd5b506102b9600480360360408110156104db57600080fd5b506001600160a01b038135169060200135611158565b3480156104fd57600080fd5b5061050661134f565b604080516001600160a01b039092168252519081900360200190f35b34801561052e57600080fd5b5061048f6004803603602081101561054557600080fd5b50356001600160a01b0316611363565b34801561056157600080fd5b50610332611378565b34801561057657600080fd5b506105a36004803603604081101561058d57600080fd5b506001600160a01b03813516906020013561137f565b604080519485526001600160a01b039093166020850152838301919091526060830152519081900360800190f35b3480156105dd57600080fd5b506102b9600480360360808110156105f457600080fd5b506001600160a01b0381351690602081013590604081013590606001356113bb565b34801561062257600080fd5b50610258611615565b34801561063757600080fd5b506102b96004803603606081101561064e57600080fd5b506001600160a01b038135169060208101359060400135611639565b34801561067657600080fd5b506106a36004803603604081101561068d57600080fd5b506001600160a01b038135169060200135611a0c565b604080519788526001600160a01b039687166020890152948616878601526060870193909352608086019190915290921660a084015290151560c0830152519081900360e00190f35b3480156106f857600080fd5b5061048f6004803603602081101561070f57600080fd5b50356001600160a01b0316611a78565b34801561072b57600080fd5b50610506611a8d565b7f150b7a0200000000000000000000000000000000000000000000000000000000949350505050565b610765611aa5565b6001600160a01b031661077661134f565b6001600160a01b0316146107d1576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b806107e3576107de611aa9565b6107eb565b6107eb611b52565b50565b6107f6611aa5565b6001600160a01b031661080761134f565b6001600160a01b031614610862576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b620186a081106108a35760405162461bcd60e51b81526004018080602001828103825260368152602001806132376036913960400191505060405180910390fd5b60018190556040805182815290517fdb629698afb23c88e17ec4d29f97b3907c3e1fbfd116fa15f97569c7c16b3e4d9181900360200190a150565b6108e6611149565b1561092b576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b600280541415610982576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002805561098e612f43565b6109988585611bd5565b60a08101519091506001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146109d4576109cf85858486611d21565b6109e0565b6109e085853486611d21565b50506001600255505050565b620f424081565b6109fb611149565b15610a40576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b610a48612f43565b610a528484611bd5565b60208101519091506001600160a01b0316331415610ab7576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a20756e617574686f72697a65642073656e646572604482015290519081900360640190fd5b60a08101516001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14610b3c5781816060015114610b37576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a20696e76616c6964207072696365000000000000604482015290519081900360640190fd5b610b94565b34816060015114610b94576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a20696e76616c6964207072696365000000000000604482015290519081900360640190fd5b60015460009015610ca75760a08201516001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14610bf557610bed620f4240610be7600154856060015161207890919063ffffffff16565b906120d8565b905080610c15565b610c11620f4240610be76001543461207890919063ffffffff16565b9050805b5060a08201516001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14610c6557610c6033610c4a61134f565b60a08501516001600160a01b031691908461213f565b610ca7565b610c6d61134f565b6001600160a01b03166108fc829081150290604051600060405180830381858888f19350505050158015610ca5573d6000803e3d6000fd5b505b60a08201516001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14610d0a57610d05338360200151610cef8486606001516121c790919063ffffffff16565b60a08601516001600160a01b031692919061213f565b610d5c565b81602001516001600160a01b03166108fc610d328385606001516121c790919063ffffffff16565b6040518115909202916000818181858888f19350505050158015610d5a573d6000803e3d6000fd5b505b610d64612f7f565b506001600160a01b0380861660009081526004602090815260408083208884528252918290208251608081018452815480825260018301549095169281019290925260028101549282019290925260039091015460608201529015610ddc57610ddc8160000151878784602001518560400151612224565b610df183600001513388888760600151612342565b505050505050565b610e01611149565b15610e46576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b610e4e612f7f565b506001600160a01b038083166000908152600460209081526040808320858452825291829020825160808101845281548152600182015490941691840182905260028101549284019290925260039091015460608301523314610ef8576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a20556e617574686f72697a65642073656e646572604482015290519081900360640190fd5b610f118160000151848484602001518560400151612224565b505050565b610f1e611aa5565b6001600160a01b0316610f2f61134f565b6001600160a01b031614610f8a576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b610f9c826001600160a01b031661247e565b610fd75760405162461bcd60e51b8152600401808060200182810382526036815260200180612fa76036913960400191505060405180910390fd5b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b61100a611aa5565b6001600160a01b031661101b61134f565b6001600160a01b031614611076576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b611088826001600160a01b031661247e565b6110c35760405162461bcd60e51b8152600401808060200182810382526036815260200180612fa76036913960400191505060405180910390fd5b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6110f6611149565b1561113b576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b610df1868686868686612484565b60005460ff1690565b60015481565b611160611149565b156111a5576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6111ad612f43565b506001600160a01b038281166000908152600360208181526040808420868552825292839020835160e081018552815481526001820154861692810183905260028201548616948101949094529182015460608401526004820154608084015260059091015492831660a08301527401000000000000000000000000000000000000000090920460ff16151560c082015290331480611264575061124f61134f565b6001600160a01b0316336001600160a01b0316145b6112b5576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a20756e617574686f72697a65642073656e646572604482015290519081900360640190fd5b6112bd612f7f565b506001600160a01b0380841660009081526004602090815260408083208684528252918290208251608081018452815480825260018301549095169281019290925260028101549282019290925260039091015460608201529015611335576113358160000151858584602001518560400151612224565b611349826000015185858560200151612925565b50505050565b60005461010090046001600160a01b031690565b60066020526000908152604090205460ff1681565b620186a081565b6004602090815260009283526040808420909152908252902080546001820154600283015460039093015491926001600160a01b039091169184565b6113c3611149565b15611408576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6001600160a01b03841660009081526003602090815260408083208684529091529020805461147e576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a206173736574206e6f74207075626c6973686564604482015290519081900360640190fd5b60018101546001600160a01b031633146114df576040805162461bcd60e51b815260206004820152601f60248201527f4d61726b6574706c6163653a2073656e646572206e6f7420616c6c6f77656400604482015290519081900360640190fd5b4281600401541015611538576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a206f726465722065787069726564000000000000604482015290519081900360640190fd5b600083116115775760405162461bcd60e51b815260040180806020018281038252602a815260200180613041602a913960400191505060405180910390fd5b61158242603c612a4e565b82116115bf5760405162461bcd60e51b8152600401808060200182810382526043815260200180612fdd6043913960600191505060405180910390fd5b600381018390556004810182905580546040805191825260208201859052818101849052517f37de993802f8ab9c75f6d7d3065ba8ab95ce30051219b14251415925e68e0a489181900360600190a15050505050565b7f80ac58cd0000000000000000000000000000000000000000000000000000000081565b611641611149565b15611686576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b61168e612f43565b6116988484611bd5565b60208101519091506001600160a01b031633146116fc576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a20756e617574686f72697a65642073656e646572604482015290519081900360640190fd5b611704612f7f565b506001600160a01b038085166000908152600460209081526040808320878452825291829020825160808101845281548152600182015490941691840191909152600281015491830182905260030154606083015283146117ac576040805162461bcd60e51b815260206004820152601e60248201527f4d61726b6574706c6163653a20696e76616c6964206269642070726963650000604482015290519081900360640190fd5b4281606001511015611805576040805162461bcd60e51b815260206004820152601c60248201527f4d61726b6574706c6163653a2074686520626964206578706972656400000000604482015290519081900360640190fd5b6001600160a01b0385166000908152600460209081526040808320878452825280832083815560018101805473ffffffffffffffffffffffffffffffffffffffff1916905560028101849055600301929092558251825190815291517ff8c7d5572fa269efc040934ae7553d57f8906bffd616254bef0b94e2b569e4169281900390910190a160015460009015611944576118b2620f4240610be76001548761207890919063ffffffff16565b60a08401519091506001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14611902576118fd6118e861134f565b60a08501516001600160a01b03169083612aa8565b611944565b61190a61134f565b6001600160a01b03166108fc829081150290604051600060405180830381858888f19350505050158015611942573d6000803e3d6000fd5b505b60a08301516001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146119a5576119a0836020015161198b8385604001516121c790919063ffffffff16565b60a08601516001600160a01b03169190612aa8565b6119f7565b82602001516001600160a01b03166108fc6119cd8385604001516121c790919063ffffffff16565b6040518115909202916000818181858888f193505050501580156119f5573d6000803e3d6000fd5b505b610df183600001518360200151888888612342565b6003602081815260009384526040808520909152918352912080546001820154600283015493830154600484015460059094015492946001600160a01b039283169490831693919290919081169074010000000000000000000000000000000000000000900460ff1687565b60056020526000908152604090205460ff1681565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b3390565b611ab1611149565b611b02576040805162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611b35611aa5565b604080516001600160a01b039092168252519081900360200190a1565b611b5a611149565b15611b9f576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611b35611aa5565b611bdd612f43565b506001600160a01b038281166000908152600360208181526040808420868552825292839020835160e0810185528154808252600183015487169382019390935260028201548616948101949094529182015460608401526004820154608084015260059091015492831660a08301527401000000000000000000000000000000000000000090920460ff16151560c082015290611cc2576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a206173736574206e6f74207075626c6973686564604482015290519081900360640190fd5b4281608001511015611d1b576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a206f726465722065787069726564000000000000604482015290519081900360640190fd5b92915050565b611d29612f43565b611d338585611bd5565b90508060c00151611d755760405162461bcd60e51b81526004018080602001828103825260218152602001806130206021913960400191505060405180910390fd5b8060800151821115611d8957806080015191505b611d91612f7f565b506001600160a01b0380861660009081526004602090815260408083208884528252918290208251608081018452815480825260018301549095169281019290925260028101549282019290925260039091015460608201529015611eb55742816060015110611e425780604001518411611e3d5760405162461bcd60e51b81526004018080602001828103825260358152602001806131d86035913960400191505060405180910390fd5b611e97565b60008411611e97576040805162461bcd60e51b815260206004820152601e60248201527f4d61726b6574706c6163653a206269642073686f756c64206265203e20300000604482015290519081900360640190fd5b611eb08160000151878784602001518560400151612224565b611f0a565b60008411611f0a576040805162461bcd60e51b815260206004820152601e60248201527f4d61726b6574706c6163653a206269642073686f756c64206265203e20300000604482015290519081900360640190fd5b600042338460000151878760405160200180868152602001856001600160a01b031660601b8152601401848152602001838152602001828152602001955050505050506040516020818303038152906040528051906020012090506040518060800160405280828152602001336001600160a01b031681526020018681526020018581525060046000896001600160a01b03166001600160a01b0316815260200190815260200160002060008881526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506040820151816002015560608201518160030155905050336001600160a01b031686886001600160a01b03167fae7b5aee7763f3e7771076de8f7b61accb70ad42245fee23308e19c8bcd518e484898960405180848152602001838152602001828152602001935050505060405180910390a450505050505050565b60008261208757506000611d1b565b8282028284828161209457fe5b04146120d15760405162461bcd60e51b815260040180806020018281038252602181526020018061313c6021913960400191505060405180910390fd5b9392505050565b600080821161212e576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161213757fe5b049392505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052611349908590612b24565b60008282111561221e576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6001600160a01b0384166000908152600460209081526040808320868452909152812081815560018101805473ffffffffffffffffffffffffffffffffffffffff19169055600281018290556003015561227c612f43565b6122868585611bd5565b60a08101519091506001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146122cf5760a08101516122ca906001600160a01b03168484612aa8565b612307565b6040516001600160a01b0384169083156108fc029084906000818181858888f19350505050158015612305573d6000803e3d6000fd5b505b6040805187815290517fb56dc4096011ba5fd2e46e5c3e7b04dec423b5e7b5fce9a17a419d77c832177c9181900360200190a1505050505050565b6001600160a01b03808416600081815260036020818152604080842088855290915280832083815560018101805473ffffffffffffffffffffffffffffffffffffffff1990811690915560028201805490911690559182018390556004808301849055600590920180547fffffffffffffffffffffff0000000000000000000000000000000000000000001690558051632142170760e11b81523092810192909252938816602482015260448101869052925191926342842e0e926064808301939282900301818387803b15801561241957600080fd5b505af115801561242d573d6000803e3d6000fd5b5050604080518881526020810185905281516001600160a01b03891694507f012d66d656f295c1a84576b9b7f0a83474ed09578e80f7f1a715fb958e1d546393509081900390910190a25050505050565b3b151590565b600061248f87612bd5565b6001600160a01b03881660009081526006602052604090205490915060ff166124e95760405162461bcd60e51b815260040180806020018281038252602981526020018061318b6029913960400191505060405180910390fd5b6001600160a01b03831660009081526005602052604090205460ff166125405760405162461bcd60e51b815260040180806020018281038252602e81526020018061315d602e913960400191505060405180910390fd5b6000816001600160a01b0316636352211e886040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561258657600080fd5b505afa15801561259a573d6000803e3d6000fd5b505050506040513d60208110156125b057600080fd5b505190506001600160a01b03811633146125fb5760405162461bcd60e51b815260040180806020018281038252603381526020018061306b6033913960400191505060405180910390fd5b6000861161263a5760405162461bcd60e51b815260040180806020018281038252602a815260200180613041602a913960400191505060405180910390fd5b61264542603c612a4e565b85116126825760405162461bcd60e51b815260040180806020018281038252604381526020018061309e6043913960600191505060405180910390fd5b60408051632142170760e11b81526001600160a01b038381166004830152306024830152604482018a90529151918416916342842e0e9160648082019260009290919082900301818387803b1580156126da57600080fd5b505af11580156126ee573d6000803e3d6000fd5b50505050600042828a8a8a60405160200180868152602001856001600160a01b031660601b8152601401846001600160a01b031660601b8152601401838152602001828152602001955050505050506040516020818303038152906040528051906020012090506040518060e00160405280828152602001836001600160a01b031681526020018a6001600160a01b03168152602001888152602001878152602001866001600160a01b03168152602001851515815250600360008b6001600160a01b03166001600160a01b0316815260200190815260200160002060008a81526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550606082015181600301556080820151816004015560a08201518160050160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060c08201518160050160146101000a81548160ff02191690831515021790555090505087896001600160a01b0316836001600160a01b03167f824ac4c21c415646c2086042c220821208efc3c5f1c76761234340e2e261ab47848b8b8b8b60405180868152602001858152602001848152602001836001600160a01b0316815260200182151581526020019550505050505060405180910390a4505050505050505050565b6001600160a01b03808416600081815260036020818152604080842088855290915280832083815560018101805473ffffffffffffffffffffffffffffffffffffffff1990811690915560028201805490911690559182018390556004808301849055600590920180547fffffffffffffffffffffff0000000000000000000000000000000000000000001690558051632142170760e11b81523092810192909252938516602482015260448101869052925191926342842e0e926064808301939282900301818387803b1580156129fc57600080fd5b505af1158015612a10573d6000803e3d6000fd5b50506040805187815290517f5152abf959f6564662358c2e52b702259b78bac5ee7842a0f01937e670efcc7d9350908190036020019150a150505050565b6000828201838110156120d1576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610f119084905b6060612b79826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612d0e9092919063ffffffff16565b805190915015610f1157808060200190516020811015612b9857600080fd5b5051610f115760405162461bcd60e51b815260040180806020018281038252602a81526020018061320d602a913960400191505060405180910390fd5b6000612be9826001600160a01b031661247e565b612c245760405162461bcd60e51b81526004018080602001828103825260248152602001806131b46024913960400191505060405180910390fd5b604080517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f80ac58cd00000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038416916301ffc9a7916024808301926020929190829003018186803b158015612ca357600080fd5b505afa158015612cb7573d6000803e3d6000fd5b505050506040513d6020811015612ccd57600080fd5b5051612d0a5760405162461bcd60e51b81526004018080602001828103825260358152602001806130e16035913960400191505060405180910390fd5b5090565b6060612d1d8484600085612d25565b949350505050565b606082471015612d665760405162461bcd60e51b81526004018080602001828103825260268152602001806131166026913960400191505060405180910390fd5b612d6f8561247e565b612dc0576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310612e1d57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101612de0565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612e7f576040519150601f19603f3d011682016040523d82523d6000602084013e612e84565b606091505b5091509150612e94828286612e9f565b979650505050505050565b60608315612eae5750816120d1565b825115612ebe5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612f08578181015183820152602001612ef0565b50505050905090810190601f168015612f355780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b6040805160808101825260008082526020820181905291810182905260608101919091529056fe54686520616363657074656420746f6b656e2061646472657373206d7573742062652061206465706c6f79656420636f6e74726163744d61726b6574706c6163653a204578706972652074696d652073686f756c64206265206d6f7265207468616e2031206d696e75746520696e20746865206675747572654d61726b6574706c6163653a206f6e6c79206275792066697865642070726963654d61726b6574706c6163653a2050726963652073686f756c6420626520626967676572207468616e20304d61726b6574706c6163653a204f6e6c7920746865206173736574206f776e65722063616e20637265617465206f72646572734d61726b6574706c6163653a205075626c69636174696f6e2073686f756c64206265206d6f7265207468616e2031206d696e75746520696e2074686520667574757265546865204e465420636f6e74726163742068617320616e20696e76616c69642045524337323120696d706c656d656e746174696f6e416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774d61726b6574706c6163653a20556e61636365707461626c65206d61726b6574706c6163652063757272656e63794d61726b6574706c6163653a20556e61636365707461626c65206d61726b6574706c616365206e6674546865204e465420416464726573732073686f756c64206265206120636f6e74726163744d61726b6574706c6163653a206269642070726963652073686f756c6420626520686967686572207468616e206c617374206269645361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564546865206f776e6572206375742073686f756c64206265206265747765656e203020616e64206d61784375745065724d696c6c696f6ea2646970667358221220092475da806348407eaaff1a8433ec0644ec867ac3713b75900e24c361b390e064736f6c634300060c0033

Deployed Bytecode

0x6080604052600436106101805760003560e01c8063673c8553116100d6578063cf7ce01f1161007f578063e61f385111610059578063e61f38511461066a578063f2e2e2aa146106ec578063fcedebd21461071f57610180565b8063cf7ce01f146105d1578063dece685414610616578063e13a40f01461062b57610180565b8063ad219813116100b0578063ad21981314610522578063c555e05014610555578063cd08bfe11461056a57610180565b8063673c8553146104a35780636a206137146104b85780638da5cb5b146104f157610180565b806338940b5b116101385780633db88761116101125780633db88761146103ea5780633fbec39a146104255780635c975abb1461047a57610180565b806338940b5b1461034457806339b6b1e5146103765780633ac44917146103af57610180565b806319dad16d1161016957806319dad16d146102bb5780631d22da91146102e5578063293315f21461031d57610180565b8063150b7a021461018557806316c38b3c1461028d575b600080fd5b34801561019157600080fd5b50610258600480360360808110156101a857600080fd5b6001600160a01b038235811692602081013590911691604082013591908101906080810160608201356401000000008111156101e357600080fd5b8201836020820111156101f557600080fd5b8035906020019184600183028401116401000000008311171561021757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610734945050505050565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b34801561029957600080fd5b506102b9600480360360208110156102b057600080fd5b5035151561075d565b005b3480156102c757600080fd5b506102b9600480360360208110156102de57600080fd5b50356107ee565b6102b9600480360360808110156102fb57600080fd5b506001600160a01b0381351690602081013590604081013590606001356108de565b34801561032957600080fd5b506103326109ec565b60408051918252519081900360200190f35b6102b96004803603606081101561035a57600080fd5b506001600160a01b0381351690602081013590604001356109f3565b34801561038257600080fd5b506102b96004803603604081101561039957600080fd5b506001600160a01b038135169060200135610df9565b3480156103bb57600080fd5b506102b9600480360360408110156103d257600080fd5b506001600160a01b0381351690602001351515610f16565b3480156103f657600080fd5b506102b96004803603604081101561040d57600080fd5b506001600160a01b0381351690602001351515611002565b34801561043157600080fd5b506102b9600480360360c081101561044857600080fd5b506001600160a01b0381358116916020810135916040820135916060810135916080820135169060a0013515156110ee565b34801561048657600080fd5b5061048f611149565b604080519115158252519081900360200190f35b3480156104af57600080fd5b50610332611152565b3480156104c457600080fd5b506102b9600480360360408110156104db57600080fd5b506001600160a01b038135169060200135611158565b3480156104fd57600080fd5b5061050661134f565b604080516001600160a01b039092168252519081900360200190f35b34801561052e57600080fd5b5061048f6004803603602081101561054557600080fd5b50356001600160a01b0316611363565b34801561056157600080fd5b50610332611378565b34801561057657600080fd5b506105a36004803603604081101561058d57600080fd5b506001600160a01b03813516906020013561137f565b604080519485526001600160a01b039093166020850152838301919091526060830152519081900360800190f35b3480156105dd57600080fd5b506102b9600480360360808110156105f457600080fd5b506001600160a01b0381351690602081013590604081013590606001356113bb565b34801561062257600080fd5b50610258611615565b34801561063757600080fd5b506102b96004803603606081101561064e57600080fd5b506001600160a01b038135169060208101359060400135611639565b34801561067657600080fd5b506106a36004803603604081101561068d57600080fd5b506001600160a01b038135169060200135611a0c565b604080519788526001600160a01b039687166020890152948616878601526060870193909352608086019190915290921660a084015290151560c0830152519081900360e00190f35b3480156106f857600080fd5b5061048f6004803603602081101561070f57600080fd5b50356001600160a01b0316611a78565b34801561072b57600080fd5b50610506611a8d565b7f150b7a0200000000000000000000000000000000000000000000000000000000949350505050565b610765611aa5565b6001600160a01b031661077661134f565b6001600160a01b0316146107d1576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b806107e3576107de611aa9565b6107eb565b6107eb611b52565b50565b6107f6611aa5565b6001600160a01b031661080761134f565b6001600160a01b031614610862576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b620186a081106108a35760405162461bcd60e51b81526004018080602001828103825260368152602001806132376036913960400191505060405180910390fd5b60018190556040805182815290517fdb629698afb23c88e17ec4d29f97b3907c3e1fbfd116fa15f97569c7c16b3e4d9181900360200190a150565b6108e6611149565b1561092b576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b600280541415610982576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002805561098e612f43565b6109988585611bd5565b60a08101519091506001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146109d4576109cf85858486611d21565b6109e0565b6109e085853486611d21565b50506001600255505050565b620f424081565b6109fb611149565b15610a40576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b610a48612f43565b610a528484611bd5565b60208101519091506001600160a01b0316331415610ab7576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a20756e617574686f72697a65642073656e646572604482015290519081900360640190fd5b60a08101516001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14610b3c5781816060015114610b37576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a20696e76616c6964207072696365000000000000604482015290519081900360640190fd5b610b94565b34816060015114610b94576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a20696e76616c6964207072696365000000000000604482015290519081900360640190fd5b60015460009015610ca75760a08201516001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14610bf557610bed620f4240610be7600154856060015161207890919063ffffffff16565b906120d8565b905080610c15565b610c11620f4240610be76001543461207890919063ffffffff16565b9050805b5060a08201516001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14610c6557610c6033610c4a61134f565b60a08501516001600160a01b031691908461213f565b610ca7565b610c6d61134f565b6001600160a01b03166108fc829081150290604051600060405180830381858888f19350505050158015610ca5573d6000803e3d6000fd5b505b60a08201516001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14610d0a57610d05338360200151610cef8486606001516121c790919063ffffffff16565b60a08601516001600160a01b031692919061213f565b610d5c565b81602001516001600160a01b03166108fc610d328385606001516121c790919063ffffffff16565b6040518115909202916000818181858888f19350505050158015610d5a573d6000803e3d6000fd5b505b610d64612f7f565b506001600160a01b0380861660009081526004602090815260408083208884528252918290208251608081018452815480825260018301549095169281019290925260028101549282019290925260039091015460608201529015610ddc57610ddc8160000151878784602001518560400151612224565b610df183600001513388888760600151612342565b505050505050565b610e01611149565b15610e46576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b610e4e612f7f565b506001600160a01b038083166000908152600460209081526040808320858452825291829020825160808101845281548152600182015490941691840182905260028101549284019290925260039091015460608301523314610ef8576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a20556e617574686f72697a65642073656e646572604482015290519081900360640190fd5b610f118160000151848484602001518560400151612224565b505050565b610f1e611aa5565b6001600160a01b0316610f2f61134f565b6001600160a01b031614610f8a576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b610f9c826001600160a01b031661247e565b610fd75760405162461bcd60e51b8152600401808060200182810382526036815260200180612fa76036913960400191505060405180910390fd5b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b61100a611aa5565b6001600160a01b031661101b61134f565b6001600160a01b031614611076576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b611088826001600160a01b031661247e565b6110c35760405162461bcd60e51b8152600401808060200182810382526036815260200180612fa76036913960400191505060405180910390fd5b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6110f6611149565b1561113b576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b610df1868686868686612484565b60005460ff1690565b60015481565b611160611149565b156111a5576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6111ad612f43565b506001600160a01b038281166000908152600360208181526040808420868552825292839020835160e081018552815481526001820154861692810183905260028201548616948101949094529182015460608401526004820154608084015260059091015492831660a08301527401000000000000000000000000000000000000000090920460ff16151560c082015290331480611264575061124f61134f565b6001600160a01b0316336001600160a01b0316145b6112b5576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a20756e617574686f72697a65642073656e646572604482015290519081900360640190fd5b6112bd612f7f565b506001600160a01b0380841660009081526004602090815260408083208684528252918290208251608081018452815480825260018301549095169281019290925260028101549282019290925260039091015460608201529015611335576113358160000151858584602001518560400151612224565b611349826000015185858560200151612925565b50505050565b60005461010090046001600160a01b031690565b60066020526000908152604090205460ff1681565b620186a081565b6004602090815260009283526040808420909152908252902080546001820154600283015460039093015491926001600160a01b039091169184565b6113c3611149565b15611408576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6001600160a01b03841660009081526003602090815260408083208684529091529020805461147e576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a206173736574206e6f74207075626c6973686564604482015290519081900360640190fd5b60018101546001600160a01b031633146114df576040805162461bcd60e51b815260206004820152601f60248201527f4d61726b6574706c6163653a2073656e646572206e6f7420616c6c6f77656400604482015290519081900360640190fd5b4281600401541015611538576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a206f726465722065787069726564000000000000604482015290519081900360640190fd5b600083116115775760405162461bcd60e51b815260040180806020018281038252602a815260200180613041602a913960400191505060405180910390fd5b61158242603c612a4e565b82116115bf5760405162461bcd60e51b8152600401808060200182810382526043815260200180612fdd6043913960600191505060405180910390fd5b600381018390556004810182905580546040805191825260208201859052818101849052517f37de993802f8ab9c75f6d7d3065ba8ab95ce30051219b14251415925e68e0a489181900360600190a15050505050565b7f80ac58cd0000000000000000000000000000000000000000000000000000000081565b611641611149565b15611686576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b61168e612f43565b6116988484611bd5565b60208101519091506001600160a01b031633146116fc576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a20756e617574686f72697a65642073656e646572604482015290519081900360640190fd5b611704612f7f565b506001600160a01b038085166000908152600460209081526040808320878452825291829020825160808101845281548152600182015490941691840191909152600281015491830182905260030154606083015283146117ac576040805162461bcd60e51b815260206004820152601e60248201527f4d61726b6574706c6163653a20696e76616c6964206269642070726963650000604482015290519081900360640190fd5b4281606001511015611805576040805162461bcd60e51b815260206004820152601c60248201527f4d61726b6574706c6163653a2074686520626964206578706972656400000000604482015290519081900360640190fd5b6001600160a01b0385166000908152600460209081526040808320878452825280832083815560018101805473ffffffffffffffffffffffffffffffffffffffff1916905560028101849055600301929092558251825190815291517ff8c7d5572fa269efc040934ae7553d57f8906bffd616254bef0b94e2b569e4169281900390910190a160015460009015611944576118b2620f4240610be76001548761207890919063ffffffff16565b60a08401519091506001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14611902576118fd6118e861134f565b60a08501516001600160a01b03169083612aa8565b611944565b61190a61134f565b6001600160a01b03166108fc829081150290604051600060405180830381858888f19350505050158015611942573d6000803e3d6000fd5b505b60a08301516001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146119a5576119a0836020015161198b8385604001516121c790919063ffffffff16565b60a08601516001600160a01b03169190612aa8565b6119f7565b82602001516001600160a01b03166108fc6119cd8385604001516121c790919063ffffffff16565b6040518115909202916000818181858888f193505050501580156119f5573d6000803e3d6000fd5b505b610df183600001518360200151888888612342565b6003602081815260009384526040808520909152918352912080546001820154600283015493830154600484015460059094015492946001600160a01b039283169490831693919290919081169074010000000000000000000000000000000000000000900460ff1687565b60056020526000908152604090205460ff1681565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b3390565b611ab1611149565b611b02576040805162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611b35611aa5565b604080516001600160a01b039092168252519081900360200190a1565b611b5a611149565b15611b9f576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611b35611aa5565b611bdd612f43565b506001600160a01b038281166000908152600360208181526040808420868552825292839020835160e0810185528154808252600183015487169382019390935260028201548616948101949094529182015460608401526004820154608084015260059091015492831660a08301527401000000000000000000000000000000000000000090920460ff16151560c082015290611cc2576040805162461bcd60e51b815260206004820181905260248201527f4d61726b6574706c6163653a206173736574206e6f74207075626c6973686564604482015290519081900360640190fd5b4281608001511015611d1b576040805162461bcd60e51b815260206004820152601a60248201527f4d61726b6574706c6163653a206f726465722065787069726564000000000000604482015290519081900360640190fd5b92915050565b611d29612f43565b611d338585611bd5565b90508060c00151611d755760405162461bcd60e51b81526004018080602001828103825260218152602001806130206021913960400191505060405180910390fd5b8060800151821115611d8957806080015191505b611d91612f7f565b506001600160a01b0380861660009081526004602090815260408083208884528252918290208251608081018452815480825260018301549095169281019290925260028101549282019290925260039091015460608201529015611eb55742816060015110611e425780604001518411611e3d5760405162461bcd60e51b81526004018080602001828103825260358152602001806131d86035913960400191505060405180910390fd5b611e97565b60008411611e97576040805162461bcd60e51b815260206004820152601e60248201527f4d61726b6574706c6163653a206269642073686f756c64206265203e20300000604482015290519081900360640190fd5b611eb08160000151878784602001518560400151612224565b611f0a565b60008411611f0a576040805162461bcd60e51b815260206004820152601e60248201527f4d61726b6574706c6163653a206269642073686f756c64206265203e20300000604482015290519081900360640190fd5b600042338460000151878760405160200180868152602001856001600160a01b031660601b8152601401848152602001838152602001828152602001955050505050506040516020818303038152906040528051906020012090506040518060800160405280828152602001336001600160a01b031681526020018681526020018581525060046000896001600160a01b03166001600160a01b0316815260200190815260200160002060008881526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506040820151816002015560608201518160030155905050336001600160a01b031686886001600160a01b03167fae7b5aee7763f3e7771076de8f7b61accb70ad42245fee23308e19c8bcd518e484898960405180848152602001838152602001828152602001935050505060405180910390a450505050505050565b60008261208757506000611d1b565b8282028284828161209457fe5b04146120d15760405162461bcd60e51b815260040180806020018281038252602181526020018061313c6021913960400191505060405180910390fd5b9392505050565b600080821161212e576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161213757fe5b049392505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052611349908590612b24565b60008282111561221e576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6001600160a01b0384166000908152600460209081526040808320868452909152812081815560018101805473ffffffffffffffffffffffffffffffffffffffff19169055600281018290556003015561227c612f43565b6122868585611bd5565b60a08101519091506001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146122cf5760a08101516122ca906001600160a01b03168484612aa8565b612307565b6040516001600160a01b0384169083156108fc029084906000818181858888f19350505050158015612305573d6000803e3d6000fd5b505b6040805187815290517fb56dc4096011ba5fd2e46e5c3e7b04dec423b5e7b5fce9a17a419d77c832177c9181900360200190a1505050505050565b6001600160a01b03808416600081815260036020818152604080842088855290915280832083815560018101805473ffffffffffffffffffffffffffffffffffffffff1990811690915560028201805490911690559182018390556004808301849055600590920180547fffffffffffffffffffffff0000000000000000000000000000000000000000001690558051632142170760e11b81523092810192909252938816602482015260448101869052925191926342842e0e926064808301939282900301818387803b15801561241957600080fd5b505af115801561242d573d6000803e3d6000fd5b5050604080518881526020810185905281516001600160a01b03891694507f012d66d656f295c1a84576b9b7f0a83474ed09578e80f7f1a715fb958e1d546393509081900390910190a25050505050565b3b151590565b600061248f87612bd5565b6001600160a01b03881660009081526006602052604090205490915060ff166124e95760405162461bcd60e51b815260040180806020018281038252602981526020018061318b6029913960400191505060405180910390fd5b6001600160a01b03831660009081526005602052604090205460ff166125405760405162461bcd60e51b815260040180806020018281038252602e81526020018061315d602e913960400191505060405180910390fd5b6000816001600160a01b0316636352211e886040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561258657600080fd5b505afa15801561259a573d6000803e3d6000fd5b505050506040513d60208110156125b057600080fd5b505190506001600160a01b03811633146125fb5760405162461bcd60e51b815260040180806020018281038252603381526020018061306b6033913960400191505060405180910390fd5b6000861161263a5760405162461bcd60e51b815260040180806020018281038252602a815260200180613041602a913960400191505060405180910390fd5b61264542603c612a4e565b85116126825760405162461bcd60e51b815260040180806020018281038252604381526020018061309e6043913960600191505060405180910390fd5b60408051632142170760e11b81526001600160a01b038381166004830152306024830152604482018a90529151918416916342842e0e9160648082019260009290919082900301818387803b1580156126da57600080fd5b505af11580156126ee573d6000803e3d6000fd5b50505050600042828a8a8a60405160200180868152602001856001600160a01b031660601b8152601401846001600160a01b031660601b8152601401838152602001828152602001955050505050506040516020818303038152906040528051906020012090506040518060e00160405280828152602001836001600160a01b031681526020018a6001600160a01b03168152602001888152602001878152602001866001600160a01b03168152602001851515815250600360008b6001600160a01b03166001600160a01b0316815260200190815260200160002060008a81526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550606082015181600301556080820151816004015560a08201518160050160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060c08201518160050160146101000a81548160ff02191690831515021790555090505087896001600160a01b0316836001600160a01b03167f824ac4c21c415646c2086042c220821208efc3c5f1c76761234340e2e261ab47848b8b8b8b60405180868152602001858152602001848152602001836001600160a01b0316815260200182151581526020019550505050505060405180910390a4505050505050505050565b6001600160a01b03808416600081815260036020818152604080842088855290915280832083815560018101805473ffffffffffffffffffffffffffffffffffffffff1990811690915560028201805490911690559182018390556004808301849055600590920180547fffffffffffffffffffffff0000000000000000000000000000000000000000001690558051632142170760e11b81523092810192909252938516602482015260448101869052925191926342842e0e926064808301939282900301818387803b1580156129fc57600080fd5b505af1158015612a10573d6000803e3d6000fd5b50506040805187815290517f5152abf959f6564662358c2e52b702259b78bac5ee7842a0f01937e670efcc7d9350908190036020019150a150505050565b6000828201838110156120d1576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610f119084905b6060612b79826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612d0e9092919063ffffffff16565b805190915015610f1157808060200190516020811015612b9857600080fd5b5051610f115760405162461bcd60e51b815260040180806020018281038252602a81526020018061320d602a913960400191505060405180910390fd5b6000612be9826001600160a01b031661247e565b612c245760405162461bcd60e51b81526004018080602001828103825260248152602001806131b46024913960400191505060405180910390fd5b604080517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f80ac58cd00000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038416916301ffc9a7916024808301926020929190829003018186803b158015612ca357600080fd5b505afa158015612cb7573d6000803e3d6000fd5b505050506040513d6020811015612ccd57600080fd5b5051612d0a5760405162461bcd60e51b81526004018080602001828103825260358152602001806130e16035913960400191505060405180910390fd5b5090565b6060612d1d8484600085612d25565b949350505050565b606082471015612d665760405162461bcd60e51b81526004018080602001828103825260268152602001806131166026913960400191505060405180910390fd5b612d6f8561247e565b612dc0576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310612e1d57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101612de0565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612e7f576040519150601f19603f3d011682016040523d82523d6000602084013e612e84565b606091505b5091509150612e94828286612e9f565b979650505050505050565b60608315612eae5750816120d1565b825115612ebe5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612f08578181015183820152602001612ef0565b50505050905090810190601f168015612f355780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b6040805160808101825260008082526020820181905291810182905260608101919091529056fe54686520616363657074656420746f6b656e2061646472657373206d7573742062652061206465706c6f79656420636f6e74726163744d61726b6574706c6163653a204578706972652074696d652073686f756c64206265206d6f7265207468616e2031206d696e75746520696e20746865206675747572654d61726b6574706c6163653a206f6e6c79206275792066697865642070726963654d61726b6574706c6163653a2050726963652073686f756c6420626520626967676572207468616e20304d61726b6574706c6163653a204f6e6c7920746865206173736574206f776e65722063616e20637265617465206f72646572734d61726b6574706c6163653a205075626c69636174696f6e2073686f756c64206265206d6f7265207468616e2031206d696e75746520696e2074686520667574757265546865204e465420636f6e74726163742068617320616e20696e76616c69642045524337323120696d706c656d656e746174696f6e416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774d61726b6574706c6163653a20556e61636365707461626c65206d61726b6574706c6163652063757272656e63794d61726b6574706c6163653a20556e61636365707461626c65206d61726b6574706c616365206e6674546865204e465420416464726573732073686f756c64206265206120636f6e74726163744d61726b6574706c6163653a206269642070726963652073686f756c6420626520686967686572207468616e206c617374206269645361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564546865206f776e6572206375742073686f756c64206265206265747765656e203020616e64206d61784375745065724d696c6c696f6ea2646970667358221220092475da806348407eaaff1a8433ec0644ec867ac3713b75900e24c361b390e064736f6c634300060c0033

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.