Contract 0x92EBc6FB4Cb68872ee9C1Fcd5717A1ceee5Ea8e6

Contract Overview

Balance:
0 Ether

Token:
Txn Hash
Method
Block
From
To
Value
0xf70a1d65ffc86d355e233d82d3a96f6b68807ecf85f757438c406866ea86d4a1Sell111141302022-07-30 9:24:2962 days 14 hrs ago0xc6ef8a96f20d50e347ed9a1c84142d02b1efedc0 IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00032124 1.10220543
0x3d1dce4c68de111498a76ad8df91e06c41e7537c66303485aa0789dae0301e6dCancel Sell108685982022-06-17 15:38:19105 days 8 hrs ago0x41afea06e4d0237166219594328a3fdf48a92ff8 IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00015103 1.10000002
0x3523eec78d61a4ed0361621609b7fcf53361d70200d4870179cafea1ab593756Sell108685952022-06-17 15:37:34105 days 8 hrs ago0x41afea06e4d0237166219594328a3fdf48a92ff8 IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00017193 1.10000002
0x5989a867b4fb8edcd45b7698e5c29f162588c10af0b4f41a0f8ee352b9e6c007Buy108555092022-06-15 8:59:31107 days 14 hrs ago0x41afea06e4d0237166219594328a3fdf48a92ff8 IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60.00001 Ether0.00021579 1.10000003
0xb5852211093029ed4891b4f1587b37a9bdac1aaac4a1d283e7cf26cfb1f55170Sell108555002022-06-15 8:57:16107 days 14 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00017413 1.10000003
0xc103553502273c4ee3f1562662662b8ebe16f780840ae006734c4cc8678fbdd7Cancel Sell108553942022-06-15 8:30:43107 days 15 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00015103 1.10000003
0x5deb1b34956b6e757e9d57450bd39d54734598ee734a489da9fe30f008e2c679Sell108553872022-06-15 8:28:58107 days 15 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00017412 1.10000003
0x262a8fd61be3a6edcdb1c49da41486fa338c2d71bfe29b04d95ac6171feeb296Cancel Sell108553812022-06-15 8:27:28107 days 15 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00015103 1.10000003
0x16fa6314dd6ad1792bed2f2858821af2f35ca8749963507af28c766eb417e5cfSell108553672022-06-15 8:23:58107 days 15 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00018271 1.10000003
0xf2bfc1c168aaab6c953a406b6e30c36cbc2f515ecd94953f0cc843b58d6699c6Cancel Sell108513382022-06-14 15:34:02108 days 8 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00004941 1.65000019
0x58c93829a5fdc881dc4cefdf80ac4ef3c35e2a78240f4ac05a369e0d854a4a76Cancel Sell108513382022-06-14 15:34:02108 days 8 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00016613 1.21000017
0x176be68aa257d6816b004475103efbf6ae194f129990e9aa05c03c5efdbf6f53Sell108512752022-06-14 15:18:15108 days 8 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00019154 1.21000002
0x756b5c30668844c5cb3ac3412679d173b35c5a86c2df435d764ef420eec1a2c8Cancel Sell108510952022-06-14 14:33:04108 days 9 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00015103 1.10000002
0x3c3c9a10f9191e716603e471e5868513307aee90f120a550465a3e8fa403aeedSell108510822022-06-14 14:29:49108 days 9 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00017413 1.10000002
0xb7772fa85d6fd9f0c06f30bdaa3aedb97441078ab484e939a607b339b219c4b2Cancel Sell108510662022-06-14 14:25:49108 days 9 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00015103 1.10000003
0x2c3bac77064c60c9aaec91eb99bb600128eacea7beb688ae3c9f2f5b047dc9cfSell108510332022-06-14 14:17:32108 days 9 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00017413 1.10000003
0x87e2662e55b858dde00f37f40b9d2f1b7faa4226ea3664b1fadc2a048427ac92Cancel Sell108510092022-06-14 14:11:30108 days 9 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00015103 1.10000002
0x81142e6e270e8402700b6b5f189b1660309b5092944c3bcd5ca711a143b7fef8Sell108510042022-06-14 14:10:15108 days 9 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00030921 1.10000002
0xa6dcdd34bae7baa71b9ee099029e4e034f277a423559fe2f768b96d89007c974Cancel Sell108509902022-06-14 14:06:45108 days 9 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00015103 1.10000002
0x3a5926fe29ae5e3575e404ea2a0f556f523ed924b74019e72cf4274aa5ab99c0Sell108500902022-06-14 10:21:21108 days 13 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00017529 1.10000006
0x07b188db4b7be068fb6bf25b89a13b02795fe50369e4bdcd161e48ea4a3e0faeBuy108500882022-06-14 10:20:51108 days 13 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00027574 1.10000007
0x884399caf29b54d3770f1fcf302f8fdc89483f584d6ab5e4eeb89b3f3713f284Cancel Sell108500542022-06-14 10:12:19108 days 13 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00015103 1.10000004
0xf600d5547e299519e5fe2a4445ac9d8eb7ef1f1136f47f9c7401ba293a04dd00Sell108500052022-06-14 10:00:03108 days 13 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00017527 1.10000003
0x0cb29701197062adb36248b0d3ea49c6e77f3a3628320d3752e5d67365cbe169Buy108499722022-06-14 9:51:46108 days 13 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00027574 1.10000003
0xe93266a2f4827abcd8707af22dd37d3dc62822961f5e4dbf40c52f186af814edCancel Sell108229762022-06-09 17:06:35113 days 6 hrs ago0xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf IN  0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether0.00015103 1.10000002
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xf70a1d65ffc86d355e233d82d3a96f6b68807ecf85f757438c406866ea86d4a1111141302022-07-30 9:24:2962 days 14 hrs ago 0x7115abcca5f0702e177f172c1c14b3f686d6a63a 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether
0xf70a1d65ffc86d355e233d82d3a96f6b68807ecf85f757438c406866ea86d4a1111141302022-07-30 9:24:2962 days 14 hrs ago 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e6 0x7115abcca5f0702e177f172c1c14b3f686d6a63a0 Ether
0x3d1dce4c68de111498a76ad8df91e06c41e7537c66303485aa0789dae0301e6d108685982022-06-17 15:38:19105 days 8 hrs ago 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e6 0x7115abcca5f0702e177f172c1c14b3f686d6a63a0 Ether
0x3523eec78d61a4ed0361621609b7fcf53361d70200d4870179cafea1ab593756108685952022-06-17 15:37:34105 days 8 hrs ago 0x7115abcca5f0702e177f172c1c14b3f686d6a63a 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether
0x3523eec78d61a4ed0361621609b7fcf53361d70200d4870179cafea1ab593756108685952022-06-17 15:37:34105 days 8 hrs ago 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e6 0x7115abcca5f0702e177f172c1c14b3f686d6a63a0 Ether
0x5989a867b4fb8edcd45b7698e5c29f162588c10af0b4f41a0f8ee352b9e6c007108555092022-06-15 8:59:31107 days 14 hrs ago 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e6 0x7115abcca5f0702e177f172c1c14b3f686d6a63a0 Ether
0x5989a867b4fb8edcd45b7698e5c29f162588c10af0b4f41a0f8ee352b9e6c007108555092022-06-15 8:59:31107 days 14 hrs ago 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60xc2a191f98784592863d2e2d4b3c62fbbb7bcdcdf0.000009 Ether
0x5989a867b4fb8edcd45b7698e5c29f162588c10af0b4f41a0f8ee352b9e6c007108555092022-06-15 8:59:31107 days 14 hrs ago 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60x5bded8f6bdae766c361edae25c5dc966bcaf8f430.000001 Ether
0x5989a867b4fb8edcd45b7698e5c29f162588c10af0b4f41a0f8ee352b9e6c007108555092022-06-15 8:59:31107 days 14 hrs ago 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e6 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether
0xb5852211093029ed4891b4f1587b37a9bdac1aaac4a1d283e7cf26cfb1f55170108555002022-06-15 8:57:16107 days 14 hrs ago 0x7115abcca5f0702e177f172c1c14b3f686d6a63a 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether
0xb5852211093029ed4891b4f1587b37a9bdac1aaac4a1d283e7cf26cfb1f55170108555002022-06-15 8:57:16107 days 14 hrs ago 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e6 0x7115abcca5f0702e177f172c1c14b3f686d6a63a0 Ether
0xc103553502273c4ee3f1562662662b8ebe16f780840ae006734c4cc8678fbdd7108553942022-06-15 8:30:43107 days 15 hrs ago 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e6 0x7115abcca5f0702e177f172c1c14b3f686d6a63a0 Ether
0x5deb1b34956b6e757e9d57450bd39d54734598ee734a489da9fe30f008e2c679108553872022-06-15 8:28:58107 days 15 hrs ago 0x7115abcca5f0702e177f172c1c14b3f686d6a63a 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether
0x5deb1b34956b6e757e9d57450bd39d54734598ee734a489da9fe30f008e2c679108553872022-06-15 8:28:58107 days 15 hrs ago 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e6 0x7115abcca5f0702e177f172c1c14b3f686d6a63a0 Ether
0x262a8fd61be3a6edcdb1c49da41486fa338c2d71bfe29b04d95ac6171feeb296108553812022-06-15 8:27:28107 days 15 hrs ago 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e6 0x7115abcca5f0702e177f172c1c14b3f686d6a63a0 Ether
0x16fa6314dd6ad1792bed2f2858821af2f35ca8749963507af28c766eb417e5cf108553672022-06-15 8:23:58107 days 15 hrs ago 0x7115abcca5f0702e177f172c1c14b3f686d6a63a 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether
0x16fa6314dd6ad1792bed2f2858821af2f35ca8749963507af28c766eb417e5cf108553672022-06-15 8:23:58107 days 15 hrs ago 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e6 0x7115abcca5f0702e177f172c1c14b3f686d6a63a0 Ether
0x58c93829a5fdc881dc4cefdf80ac4ef3c35e2a78240f4ac05a369e0d854a4a76108513382022-06-14 15:34:02108 days 8 hrs ago 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e6 0x7115abcca5f0702e177f172c1c14b3f686d6a63a0 Ether
0x176be68aa257d6816b004475103efbf6ae194f129990e9aa05c03c5efdbf6f53108512752022-06-14 15:18:15108 days 8 hrs ago 0x7115abcca5f0702e177f172c1c14b3f686d6a63a 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether
0x176be68aa257d6816b004475103efbf6ae194f129990e9aa05c03c5efdbf6f53108512752022-06-14 15:18:15108 days 8 hrs ago 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e6 0x7115abcca5f0702e177f172c1c14b3f686d6a63a0 Ether
0x756b5c30668844c5cb3ac3412679d173b35c5a86c2df435d764ef420eec1a2c8108510952022-06-14 14:33:04108 days 9 hrs ago 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e6 0x7115abcca5f0702e177f172c1c14b3f686d6a63a0 Ether
0x3c3c9a10f9191e716603e471e5868513307aee90f120a550465a3e8fa403aeed108510822022-06-14 14:29:49108 days 9 hrs ago 0x7115abcca5f0702e177f172c1c14b3f686d6a63a 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether
0x3c3c9a10f9191e716603e471e5868513307aee90f120a550465a3e8fa403aeed108510822022-06-14 14:29:49108 days 9 hrs ago 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e6 0x7115abcca5f0702e177f172c1c14b3f686d6a63a0 Ether
0xb7772fa85d6fd9f0c06f30bdaa3aedb97441078ab484e939a607b339b219c4b2108510662022-06-14 14:25:49108 days 9 hrs ago 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e6 0x7115abcca5f0702e177f172c1c14b3f686d6a63a0 Ether
0x2c3bac77064c60c9aaec91eb99bb600128eacea7beb688ae3c9f2f5b047dc9cf108510332022-06-14 14:17:32108 days 9 hrs ago 0x7115abcca5f0702e177f172c1c14b3f686d6a63a 0x92ebc6fb4cb68872ee9c1fcd5717a1ceee5ea8e60 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
NftMarket

Compiler Version
v0.6.7+commit.b8d736ae

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 21 : NftMarket.sol
pragma solidity ^0.6.7;
pragma experimental ABIEncoderV2;

import "./../openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./../openzeppelin/contracts/math/SafeMath.sol";
import "./../openzeppelin/contracts/token/ERC721/IERC721.sol";
import "./../openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "./../openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "./../openzeppelin/contracts/access/Ownable.sol";
import "./../seascape_nft/SeascapeNft.sol";
import "./ReentrancyGuard.sol";

/// @title Nft Market is a trading platform on seascape network allowing to buy and sell Nfts
/// @author Nejc Schneider
contract NftMarket is IERC721Receiver, ReentrancyGuard, Ownable {
    using SafeERC20 for IERC20;
    using SafeMath for uint256;

    /// @notice individual sale related data
    struct SalesObject {
        uint256 id;               // sales ID
        uint256 tokenId;          // token unique id
        address nft;              // nft address
        address currency;         // currency address
        address payable seller;   // seller address
        address payable buyer;    // buyer address
        uint256 startTime;        // timestamp when the sale starts
        uint256 price;            // nft price
        uint8 status;             // 2 = sale canceled, 1 = sold, 0 = for sale
    }

    /// @dev keep count of SalesObject amount
    uint256 public salesAmount;

    /// @dev store sales objects.
    /// @param nft token address => (nft id => salesObject)
    mapping(address => mapping(uint256 => SalesObject)) salesObjects; // store sales in a mapping

    /// @dev supported ERC721 and ERC20 contracts
    mapping(address => bool) public supportedNft;
    mapping(address => bool) public supportedCurrency;

    /// @notice enable/disable trading
    bool public salesEnabled;

    /// @dev fee rate and fee reciever. feeAmount = (feeRate / 1000) * price
    uint256 public feeRate;
    address payable feeReceiver;

    event Buy(
        uint256 indexed id,
        uint256 tokenId,
        address buyer,
        uint256 price,
        uint256 tipsFee,
        address currency
    );

    event Sell(
        uint256 indexed id,
        uint256 tokenId,
        address nft,
        address currency,
        address seller,
        address buyer,
        uint256 startTime,
        uint256 price
    );

    event SaleCanceled(uint256 indexed id, uint256 tokenId);
    event NftReceived(address operator, address from, uint256 tokenId, bytes data);

    /// @dev set fee reciever address and fee rate
    /// @param _feeReceiver fee receiving address
    /// @param _feeRate fee amount
    constructor(address payable _feeReceiver, uint256 _feeRate) public {
        feeReceiver = _feeReceiver;
        feeRate = _feeRate;
        initReentrancyStatus();
    }

    //--------------------------------------------------
    // External methods
    //--------------------------------------------------

    /// @notice enable/disable sales
    /// @param _salesEnabled set sales to true/false
    function enableSales(bool _salesEnabled) external onlyOwner { salesEnabled = _salesEnabled; }

    /// @notice add supported nft token
    /// @param _nftAddress ERC721 contract address
    function addSupportedNft(address _nftAddress) external onlyOwner {
        require(_nftAddress != address(0x0), "invalid address");
        supportedNft[_nftAddress] = true;
    }

    /// @notice disable supported nft token
    /// @param _nftAddress ERC721 contract address
    function removeSupportedNft(address _nftAddress) external onlyOwner {
        require(_nftAddress != address(0x0), "invalid address");
        supportedNft[_nftAddress] = false;
    }

    /// @notice add supported currency token
    /// @param _currencyAddress ERC20 contract address
    function addSupportedCurrency(address _currencyAddress) external onlyOwner {
        require(!supportedCurrency[_currencyAddress], "currency already supported");
        supportedCurrency[_currencyAddress] = true;
    }

    /// @notice disable supported currency token
    /// @param _currencyAddress ERC20 contract address
    function removeSupportedCurrency(address _currencyAddress) external onlyOwner {
        require(supportedCurrency[_currencyAddress], "currency already removed");
        supportedCurrency[_currencyAddress] = false;
    }

    /// @notice change fee receiver address
    /// @param _walletAddress address of the new fee receiver
    function setFeeReceiver(address payable _walletAddress) external onlyOwner {
        require(_walletAddress != address(0x0), "invalid address");
        feeReceiver = _walletAddress;
    }

    /// @notice change fee rate
    /// @param _rate amount value. Actual rate in percent = _rate / 10
    function setFeeRate(uint256 _rate) external onlyOwner {
        require(_rate <= 100, "Rate should be bellow 100 (10%)");
        feeRate = _rate;
    }

    /// @notice returns sales amount
    /// @return total amount of sales objects
    function getSalesAmount() external view returns(uint) { return salesAmount; }

    //--------------------------------------------------
    // Public methods
    //--------------------------------------------------

    /// @notice cancel nft sale
    /// @param _tokenId nft unique ID
    /// @param _nftAddress nft token address
    function cancelSell(uint _tokenId, address _nftAddress) public nonReentrant {
        SalesObject storage obj = salesObjects[_nftAddress][_tokenId];
        require(obj.status == 0, "status: sold or canceled");
        require(obj.seller == msg.sender, "seller not nft owner");
        require(salesEnabled, "sales are closed");
        
        obj.status = 2;
        IERC721 nft = IERC721(obj.nft);
        nft.safeTransferFrom(address(this), obj.seller, obj.tokenId);

        emit SaleCanceled(_tokenId, obj.tokenId);
    }

    /// @notice put nft for sale
    /// @param _tokenId nft unique ID
    /// @param _price required price to pay by buyer. Seller receives less: price - fees
    /// @param _nftAddress nft token address
    /// @param _currency currency token address
    /// @return salesAmount total amount of sales
    function sell(uint256 _tokenId, uint256 _price, address _nftAddress, address _currency)
        public
        nonReentrant
        returns(uint)
    {
        require(_nftAddress != address(0x0), "invalid nft address");
        require(_tokenId != 0, "invalid nft token");
        require(salesEnabled, "sales are closed");
        require(supportedNft[_nftAddress], "nft address unsupported");
        require(supportedCurrency[_currency], "currency not supported");
        IERC721(_nftAddress).safeTransferFrom(msg.sender, address(this), _tokenId);

        salesAmount++;

        salesObjects[_nftAddress][_tokenId] = SalesObject(
            salesAmount,
            _tokenId,
            _nftAddress,
            _currency,
            msg.sender,
            address(0x0),
            now,
            _price,
            0
        );

        emit Sell(
            salesAmount,
            _tokenId,
            _nftAddress,
            _currency,
            msg.sender,
            address(0x0),
            now,
            _price
        );

        return salesAmount;
    }

    /// @dev encrypt token data
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes memory data
    )
        public
        override
        returns (bytes4)
    {
        //only receive the _nft staff
        if (address(this) != operator) {
            //invalid from nft
            return 0;
        }

        //success
        emit NftReceived(operator, from, tokenId, data);
        return bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"));
    }

    /// @notice buy nft
    /// @param _tokenId nft unique ID
    /// @param _nftAddress nft token address
    /// @param _currency currency token address
    function buy(uint _tokenId, address _nftAddress, address _currency)
        public
        nonReentrant
        payable
    {
        SalesObject storage obj = salesObjects[_nftAddress][_tokenId];
        require(obj.status == 0, "status: sold or canceled");
        require(obj.startTime <= now, "not yet for sale");
        require(salesEnabled, "sales are closed");
        require(msg.sender != obj.seller, "cant buy from yourself");

        require(obj.currency == _currency, "must pay same currency as sold");
        uint256 price = this.getSalesPrice(_tokenId, _nftAddress);
        uint256 tipsFee = price.mul(feeRate).div(1000);
        uint256 purchase = price.sub(tipsFee);

        if (obj.currency == address(0x0)) {
            require (msg.value >= price, "your price is too low");
            uint256 returnBack = msg.value.sub(price);
            if (returnBack > 0)
                msg.sender.transfer(returnBack);
            if (tipsFee > 0)
                feeReceiver.transfer(tipsFee);
            obj.seller.transfer(purchase);
        } else {
            IERC20(obj.currency).safeTransferFrom(msg.sender, feeReceiver, tipsFee);
            IERC20(obj.currency).safeTransferFrom(msg.sender, obj.seller, purchase);
        }

        IERC721 nft = IERC721(obj.nft);
        nft.safeTransferFrom(address(this), msg.sender, obj.tokenId);
        obj.buyer = msg.sender;

        obj.status = 1;
        emit Buy(obj.id, obj.tokenId, msg.sender, price, tipsFee, obj.currency);
    }

    /// @dev fetch sale object at nftId and nftAddress
    /// @param _tokenId unique nft ID
    /// @param _nftAddress nft token address
    /// @return SalesObject at given index
    function getSales(uint _tokenId, address _nftAddress)
        public
        view
        returns(SalesObject memory)
    {
        return salesObjects[_nftAddress][_tokenId];
    }

    /// @dev returns the price of sale
    /// @param _tokenId nft unique ID
    /// @param _nftAddress nft token address
    /// @return obj.price price of corresponding sale
    function getSalesPrice(uint _tokenId, address _nftAddress) public view returns (uint256) {
        SalesObject storage obj = salesObjects[_nftAddress][_tokenId];
        return obj.price;
    }

}

File 2 of 21 : ReentrancyGuard.sol
// File: contracts/library/ReentrancyGuard.sol

pragma solidity ^0.6.7;

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

    function initReentrancyStatus() internal {
        _status = _NOT_ENTERED;
    }
}

File 3 of 21 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.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 4 of 21 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "../GSN/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.
 */
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 returns (address) {
        return _owner;
    }

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

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

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

File 5 of 21 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts may inherit from this and call {_registerInterface} to declare
 * their support of an interface.
 */
contract ERC165 is IERC165 {
    /*
     * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
     */
    bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;

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

    constructor () internal {
        // Derived contracts need only register support for their own interfaces,
        // we register support for ERC165 itself here
        _registerInterface(_INTERFACE_ID_ERC165);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     *
     * Time complexity O(1), guaranteed to always use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) public view override returns (bool) {
        return _supportedInterfaces[interfaceId];
    }

    /**
     * @dev Registers the contract as an implementer of the interface defined by
     * `interfaceId`. Support of the actual ERC165 interface is automatic and
     * registering its interface id is not required.
     *
     * See {IERC165-supportsInterface}.
     *
     * Requirements:
     *
     * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
     */
    function _registerInterface(bytes4 interfaceId) internal virtual {
        require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
        _supportedInterfaces[interfaceId] = true;
    }
}

File 6 of 21 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.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 7 of 21 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.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, 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) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * 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);
        uint256 c = a - b;

        return c;
    }

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

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts 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) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts 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) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

File 8 of 21 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.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 9 of 21 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.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 10 of 21 : ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "../../GSN/Context.sol";
import "./IERC721.sol";
import "./IERC721Metadata.sol";
import "./IERC721Enumerable.sol";
import "./IERC721Receiver.sol";
import "../../introspection/ERC165.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";
import "../../utils/EnumerableSet.sol";
import "../../utils/EnumerableMap.sol";
import "../../utils/Strings.sol";

/**
 * @title ERC721 Non-Fungible Token Standard basic implementation
 * @dev see https://eips.ethereum.org/EIPS/eip-721
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
    using SafeMath for uint256;
    using Address for address;
    using EnumerableSet for EnumerableSet.UintSet;
    using EnumerableMap for EnumerableMap.UintToAddressMap;
    using Strings for uint256;

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

    // Mapping from holder address to their (enumerable) set of owned tokens
    mapping (address => EnumerableSet.UintSet) private _holderTokens;

    // Enumerable mapping from token ids to their owners
    EnumerableMap.UintToAddressMap private _tokenOwners;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Optional mapping for token URIs
    mapping(uint256 => string) private _tokenURIs;

    // Base URI
    string private _baseURI;

    /*
     *     bytes4(keccak256('balanceOf(address)')) == 0x70a08231
     *     bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e
     *     bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3
     *     bytes4(keccak256('getApproved(uint256)')) == 0x081812fc
     *     bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
     *     bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5
     *     bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde
     *
     *     => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^
     *        0xa22cb465 ^ 0xe985e9c ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd
     */
    bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;

    /*
     *     bytes4(keccak256('name()')) == 0x06fdde03
     *     bytes4(keccak256('symbol()')) == 0x95d89b41
     *     bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd
     *
     *     => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f
     */
    bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;

    /*
     *     bytes4(keccak256('totalSupply()')) == 0x18160ddd
     *     bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) == 0x2f745c59
     *     bytes4(keccak256('tokenByIndex(uint256)')) == 0x4f6ccce7
     *
     *     => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63
     */
    bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63;

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

        // register the supported interfaces to conform to ERC721 via ERC165
        _registerInterface(_INTERFACE_ID_ERC721);
        _registerInterface(_INTERFACE_ID_ERC721_METADATA);
        _registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");

        return _holderTokens[owner].length();
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view override returns (address) {
        return _tokenOwners.get(tokenId, "ERC721: owner query for nonexistent token");
    }

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

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

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        string memory _tokenURI = _tokenURIs[tokenId];

        // If there is no base URI, return the token URI.
        if (bytes(_baseURI).length == 0) {
            return _tokenURI;
        }
        // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
        if (bytes(_tokenURI).length > 0) {
            return string(abi.encodePacked(_baseURI, _tokenURI));
        }
        // If there is a baseURI but no tokenURI, concatenate the tokenID to the baseURI.
        return string(abi.encodePacked(_baseURI, tokenId.toString()));
    }

    /**
    * @dev Returns the base URI set via {_setBaseURI}. This will be
    * automatically added as a prefix in {tokenURI} to each token's URI, or
    * to the token ID if no specific URI is set for that token ID.
    */
    function baseURI() public view returns (string memory) {
        return _baseURI;
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) {
        return _holderTokens[owner].at(index);
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view override returns (uint256) {
        // _tokenOwners are indexed by tokenIds, so .length() returns the number of tokenIds
        return _tokenOwners.length();
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view override returns (uint256) {
        (uint256 tokenId, ) = _tokenOwners.at(index);
        return tokenId;
    }

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

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

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

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

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

        _transfer(from, to, tokenId);
    }

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mecanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

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

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

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

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

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

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

        _holderTokens[to].add(tokenId);

        _tokenOwners.set(tokenId, to);

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

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

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

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

        // Clear metadata (if any)
        if (bytes(_tokenURIs[tokenId]).length != 0) {
            delete _tokenURIs[tokenId];
        }

        _holderTokens[owner].remove(tokenId);

        _tokenOwners.remove(tokenId);

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

        _holderTokens[from].remove(tokenId);
        _holderTokens[to].add(tokenId);

        _tokenOwners.set(tokenId, to);

        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {
        require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token");
        _tokenURIs[tokenId] = _tokenURI;
    }

    /**
     * @dev Internal function to set the base URI for all token IDs. It is
     * automatically added as a prefix to the value returned in {tokenURI},
     * or to the token ID if {tokenURI} is empty.
     */
    function _setBaseURI(string memory baseURI_) internal virtual {
        _baseURI = baseURI_;
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
        private returns (bool)
    {
        if (!to.isContract()) {
            return true;
        }
        bytes memory returndata = to.functionCall(abi.encodeWithSelector(
            IERC721Receiver(to).onERC721Received.selector,
            _msgSender(),
            from,
            tokenId,
            _data
        ), "ERC721: transfer to non ERC721Receiver implementer");
        bytes4 retval = abi.decode(returndata, (bytes4));
        return (retval == _ERC721_RECEIVED);
    }

    function _approve(address to, uint256 tokenId) private {
        _tokenApprovals[tokenId] = to;
        emit Approval(ownerOf(tokenId), to, tokenId);
    }

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

File 11 of 21 : ERC721Burnable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "../../GSN/Context.sol";
import "./ERC721.sol";

/**
 * @title ERC721 Burnable Token
 * @dev ERC721 Token that can be irreversibly burned (destroyed).
 */
abstract contract ERC721Burnable is Context, ERC721 {
    /**
     * @dev Burns `tokenId`. See {ERC721-_burn}.
     *
     * Requirements:
     *
     * - The caller must own `tokenId` or be an approved operator.
     */
    function burn(uint256 tokenId) public virtual {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved");
        _burn(tokenId);
    }
}

File 12 of 21 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

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

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transfered 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 13 of 21 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

import "./IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {

    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

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

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

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

pragma solidity ^0.6.2;

import "./IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {

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

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

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

File 15 of 21 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.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 16 of 21 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

/**
 * @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) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @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");
        return _functionCallWithValue(target, data, value, errorMessage);
    }

    function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
        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 17 of 21 : Counters.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "../math/SafeMath.sol";

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 * Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the {SafeMath}
 * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never
 * directly accessed.
 */
library Counters {
    using SafeMath for uint256;

    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        // The {SafeMath} overflow check can be skipped here, see the comment at the top
        counter._value += 1;
    }

    function decrement(Counter storage counter) internal {
        counter._value = counter._value.sub(1);
    }
}

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

pragma solidity ^0.6.0;

/**
 * @dev Library for managing an enumerable variant of Solidity's
 * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
 * type.
 *
 * Maps have the following properties:
 *
 * - Entries are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Entries are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableMap for EnumerableMap.UintToAddressMap;
 *
 *     // Declare a set state variable
 *     EnumerableMap.UintToAddressMap private myMap;
 * }
 * ```
 *
 * As of v3.0.0, only maps of type `uint256 -> address` (`UintToAddressMap`) are
 * supported.
 */
library EnumerableMap {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Map type with
    // bytes32 keys and values.
    // The Map implementation uses private functions, and user-facing
    // implementations (such as Uint256ToAddressMap) are just wrappers around
    // the underlying Map.
    // This means that we can only create new EnumerableMaps for types that fit
    // in bytes32.

    struct MapEntry {
        bytes32 _key;
        bytes32 _value;
    }

    struct Map {
        // Storage of map keys and values
        MapEntry[] _entries;

        // Position of the entry defined by a key in the `entries` array, plus 1
        // because index 0 means a key is not in the map.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function _set(Map storage map, bytes32 key, bytes32 value) private returns (bool) {
        // We read and store the key's index to prevent multiple reads from the same storage slot
        uint256 keyIndex = map._indexes[key];

        if (keyIndex == 0) { // Equivalent to !contains(map, key)
            map._entries.push(MapEntry({ _key: key, _value: value }));
            // The entry is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            map._indexes[key] = map._entries.length;
            return true;
        } else {
            map._entries[keyIndex - 1]._value = value;
            return false;
        }
    }

    /**
     * @dev Removes a key-value pair from a map. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function _remove(Map storage map, bytes32 key) private returns (bool) {
        // We read and store the key's index to prevent multiple reads from the same storage slot
        uint256 keyIndex = map._indexes[key];

        if (keyIndex != 0) { // Equivalent to contains(map, key)
            // To delete a key-value pair from the _entries array in O(1), we swap the entry to delete with the last one
            // in the array, and then remove the last entry (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = keyIndex - 1;
            uint256 lastIndex = map._entries.length - 1;

            // When the entry to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            MapEntry storage lastEntry = map._entries[lastIndex];

            // Move the last entry to the index where the entry to delete is
            map._entries[toDeleteIndex] = lastEntry;
            // Update the index for the moved entry
            map._indexes[lastEntry._key] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved entry was stored
            map._entries.pop();

            // Delete the index for the deleted slot
            delete map._indexes[key];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function _contains(Map storage map, bytes32 key) private view returns (bool) {
        return map._indexes[key] != 0;
    }

    /**
     * @dev Returns the number of key-value pairs in the map. O(1).
     */
    function _length(Map storage map) private view returns (uint256) {
        return map._entries.length;
    }

   /**
    * @dev Returns the key-value pair stored at position `index` in the map. O(1).
    *
    * Note that there are no guarantees on the ordering of entries inside the
    * array, and it may change when more entries are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Map storage map, uint256 index) private view returns (bytes32, bytes32) {
        require(map._entries.length > index, "EnumerableMap: index out of bounds");

        MapEntry storage entry = map._entries[index];
        return (entry._key, entry._value);
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function _get(Map storage map, bytes32 key) private view returns (bytes32) {
        return _get(map, key, "EnumerableMap: nonexistent key");
    }

    /**
     * @dev Same as {_get}, with a custom error message when `key` is not in the map.
     */
    function _get(Map storage map, bytes32 key, string memory errorMessage) private view returns (bytes32) {
        uint256 keyIndex = map._indexes[key];
        require(keyIndex != 0, errorMessage); // Equivalent to contains(map, key)
        return map._entries[keyIndex - 1]._value; // All indexes are 1-based
    }

    // UintToAddressMap

    struct UintToAddressMap {
        Map _inner;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) {
        return _set(map._inner, bytes32(key), bytes32(uint256(value)));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) {
        return _remove(map._inner, bytes32(key));
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) {
        return _contains(map._inner, bytes32(key));
    }

    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(UintToAddressMap storage map) internal view returns (uint256) {
        return _length(map._inner);
    }

   /**
    * @dev Returns the element stored at position `index` in the set. O(1).
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {
        (bytes32 key, bytes32 value) = _at(map._inner, index);
        return (uint256(key), address(uint256(value)));
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {
        return address(uint256(_get(map._inner, bytes32(key))));
    }

    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     */
    function get(UintToAddressMap storage map, uint256 key, string memory errorMessage) internal view returns (address) {
        return address(uint256(_get(map._inner, bytes32(key), errorMessage)));
    }
}

File 19 of 21 : EnumerableSet.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
 * (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) { // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        require(set._values.length > index, "EnumerableSet: index out of bounds");
        return set._values[index];
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint256(_at(set._inner, index)));
    }


    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }
}

File 20 of 21 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

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

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

File 21 of 21 : SeascapeNft.sol
// Seascape NFT
// SPDX-License-Identifier: MIT
pragma solidity 0.6.7;

import "./../openzeppelin/contracts/access/Ownable.sol";
import "./../openzeppelin/contracts/utils/Counters.sol";
import "./../openzeppelin/contracts/token/ERC721/ERC721.sol";
import "./../openzeppelin/contracts/token/ERC721/ERC721Burnable.sol";

/// @title Seascape NFT based on ERC721 standard.
/// @notice Seascape NFT is the NFT used in Seascape Network platform.
/// Nothing special about it except that it has two more additional parameters to
/// for quality and generation to use in Seascape Platform.
/// @author Medet Ahmetson
contract SeascapeNft is ERC721, ERC721Burnable, Ownable {
    using Counters for Counters.Counter;

    Counters.Counter private tokenId;

    struct Params {
	    uint256 quality;   // seascape points
	    uint8 generation;	
    }

    /// @dev minting of seascape nfts are done by factory contract only.
    address private factory;

    /// @dev returns parameters of Seascape NFT by token id.
    mapping(uint256 => Params) public paramsOf;

    event Minted(address indexed owner, uint256 indexed id, uint256 generation, uint8 quality);
    
    /**
     * @dev Sets the {name} and {symbol} of token.
     * Initializes {decimals} with a default value of 18.
     * Mints all tokens.
     * Transfers ownership to another account. So, the token creator will not be counted as an owner.
     */
    constructor() public ERC721("Seascape NFT", "SCAPES") {
	tokenId.increment(); // set to 1 the incrementor, so first token will be with id 1.
    }

    modifier onlyFactory() {
        require(factory == _msgSender(), "Seascape NFT: Only NFT Factory can call the method");
        _;
    }

    function mint(address _to, uint256 _generation, uint8 _quality) public onlyFactory returns(uint256) {
	    uint256 _tokenId = tokenId.current();

        _safeMint(_to, _tokenId);

        paramsOf[_tokenId] = Params(_generation, _quality);

        tokenId.increment();

        emit Minted(_to, _tokenId, _generation, _quality);
        return _tokenId;
    }

    function setOwner(address _owner) public onlyOwner {
	    transferOwnership(_owner);
    }

    function setFactory(address _factory) public onlyOwner {
	    factory = _factory;
    }

    function setBaseUri(string memory _uri) public onlyOwner {
	    _setBaseURI(_uri);
    }
}

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "evmVersion": "istanbul",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract ABI

[{"inputs":[{"internalType":"address payable","name":"_feeReceiver","type":"address"},{"internalType":"uint256","name":"_feeRate","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tipsFee","type":"uint256"},{"indexed":false,"internalType":"address","name":"currency","type":"address"}],"name":"Buy","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"NftReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"SaleCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"nft","type":"address"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"address","name":"seller","type":"address"},{"indexed":false,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"Sell","type":"event"},{"inputs":[{"internalType":"address","name":"_currencyAddress","type":"address"}],"name":"addSupportedCurrency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftAddress","type":"address"}],"name":"addSupportedNft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_nftAddress","type":"address"},{"internalType":"address","name":"_currency","type":"address"}],"name":"buy","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_nftAddress","type":"address"}],"name":"cancelSell","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_salesEnabled","type":"bool"}],"name":"enableSales","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_nftAddress","type":"address"}],"name":"getSales","outputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"nft","type":"address"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"address payable","name":"seller","type":"address"},{"internalType":"address payable","name":"buyer","type":"address"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint8","name":"status","type":"uint8"}],"internalType":"struct NftMarket.SalesObject","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSalesAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_nftAddress","type":"address"}],"name":"getSalesPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_currencyAddress","type":"address"}],"name":"removeSupportedCurrency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftAddress","type":"address"}],"name":"removeSupportedNft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"salesAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"salesEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"address","name":"_nftAddress","type":"address"},{"internalType":"address","name":"_currency","type":"address"}],"name":"sell","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rate","type":"uint256"}],"name":"setFeeRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_walletAddress","type":"address"}],"name":"setFeeReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"supportedCurrency","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"supportedNft","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b5060405162003f6138038062003f61833981810160405281019062000037919062000190565b60016000819055506000620000516200015060201b60201c565b905080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600781905550620001486200015860201b60201c565b505062000243565b600033905090565b6001600081905550565b60008151905062000173816200020f565b92915050565b6000815190506200018a8162000229565b92915050565b60008060408385031215620001a457600080fd5b6000620001b48582860162000162565b9250506020620001c78582860162000179565b9150509250929050565b6000620001de82620001e5565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6200021a81620001d1565b81146200022657600080fd5b50565b620002348162000205565b81146200024057600080fd5b50565b613d0e80620002536000396000f3fe6080604052600436106101355760003560e01c80638b4c3d79116100ab578063e753858a1161006f578063e753858a14610412578063efdcd9741461042e578063f2fde38b14610457578063f8f2d60e14610480578063ff2a047a146104a9578063ffa1a44b146104e657610135565b80638b4c3d791461033f5780638da5cb5b14610368578063978bbdb914610393578063adbfdd70146103be578063c84ad9a5146103e757610135565b80633d0cc799116100fd5780633d0cc7991461021d5780633fe893d61461025a57806345596e2e146102975780634f8f0218146102c05780635748966c146102fd578063715018a61461032857610135565b8063044cc4261461013a5780630b3cbb44146101635780630d9262e11461018c578063150b7a02146101b75780632eab0374146101f4575b600080fd5b34801561014657600080fd5b50610161600480360381019061015c9190612b0f565b610523565b005b34801561016f57600080fd5b5061018a60048036038101906101859190612bdc565b6106a2565b005b34801561019857600080fd5b506101a1610756565b6040516101ae91906139b3565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d99190612b61565b610760565b6040516101eb91906136ba565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612b0f565b6107fd565b005b34801561022957600080fd5b50610244600480360381019061023f9190612b0f565b61095f565b604051610251919061369f565b60405180910390f35b34801561026657600080fd5b50610281600480360381019061027c9190612c80565b61097f565b60405161028e91906139b3565b60405180910390f35b3480156102a357600080fd5b506102be60048036038101906102b99190612c2e565b6109e2565b005b3480156102cc57600080fd5b506102e760048036038101906102e29190612d0b565b610ac7565b6040516102f491906139b3565b60405180910390f35b34801561030957600080fd5b50610312611067565b60405161031f91906139b3565b60405180910390f35b34801561033457600080fd5b5061033d61106d565b005b34801561034b57600080fd5b5061036660048036038101906103619190612b0f565b6111c5565b005b34801561037457600080fd5b5061037d611327565b60405161038a9190613593565b60405180910390f35b34801561039f57600080fd5b506103a8611351565b6040516103b591906139b3565b60405180910390f35b3480156103ca57600080fd5b506103e560048036038101906103e09190612c80565b611357565b005b3480156103f357600080fd5b506103fc611659565b604051610409919061369f565b60405180910390f35b61042c60048036038101906104279190612cbc565b61166c565b005b34801561043a57600080fd5b5061045560048036038101906104509190612b38565b611e3f565b005b34801561046357600080fd5b5061047e60048036038101906104799190612b0f565b611f8a565b005b34801561048c57600080fd5b506104a760048036038101906104a29190612b0f565b612151565b005b3480156104b557600080fd5b506104d060048036038101906104cb9190612b0f565b6122cf565b6040516104dd919061369f565b60405180910390f35b3480156104f257600080fd5b5061050d60048036038101906105089190612c80565b6122ef565b60405161051a9190613997565b60405180910390f35b61052b6124f8565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b190613877565b60405180910390fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063e906137f7565b60405180910390fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6106aa6124f8565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610739576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073090613877565b60405180910390fd5b80600660006101000a81548160ff02191690831515021790555050565b6000600254905090565b60008473ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff16146107a157600060e01b90506107f5565b7f0895c277367ff99b8c0dec875f3149fc2c82df592f63ca6f0747ac2095169087858585856040516107d69493929190613653565b60405180910390a16040516107ea9061357e565b604051809103902090505b949350505050565b6108056124f8565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610894576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161088b90613877565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610904576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fb906137d7565b60405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60056020528060005260406000206000915054906101000a900460ff1681565b600080600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008581526020019081526020016000209050806007015491505092915050565b6109ea6124f8565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7090613877565b60405180910390fd5b6064811115610abd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab490613777565b60405180910390fd5b8060078190555050565b600060026000541415610b0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0690613957565b60405180910390fd5b6002600081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7e90613717565b60405180910390fd5b6000851415610bcb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc290613917565b60405180910390fd5b600660009054906101000a900460ff16610c1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c11906137b7565b60405180910390fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610ca6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9d90613837565b60405180910390fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610d32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d29906138b7565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff166342842e0e3330886040518463ffffffff1660e01b8152600401610d6f939291906135ae565b600060405180830381600087803b158015610d8957600080fd5b505af1158015610d9d573d6000803e3d6000fd5b5050505060026000815480929190600101919050555060405180610120016040528060025481526020018681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001428152602001858152602001600060ff16815250600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000878152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060608201518160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060808201518160040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060a08201518160050160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060c0820151816006015560e082015181600701556101008201518160080160006101000a81548160ff021916908360ff1602179055509050506002547f478275d8b67a791d16edb57e0de694972e1bc0bf837e363b432bd73fa1cfcee9868585336000428b60405161104a9796959493929190613a4a565b60405180910390a260025490506001600081905550949350505050565b60025481565b6110756124f8565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611104576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fb90613877565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6111cd6124f8565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461125c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125390613877565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156112cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c3906137d7565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60075481565b6002600054141561139d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139490613957565b60405180910390fd5b60026000819055506000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020905060008160080160009054906101000a900460ff1660ff1614611450576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144790613897565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff168160040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d990613797565b60405180910390fd5b600660009054906101000a900460ff16611531576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611528906137b7565b60405180910390fd5b60028160080160006101000a81548160ff021916908360ff16021790555060008160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166342842e0e308460040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685600101546040518463ffffffff1660e01b81526004016115dd939291906135e5565b600060405180830381600087803b1580156115f757600080fd5b505af115801561160b573d6000803e3d6000fd5b50505050837ff47bd6ad197977120284fd5ccd8b99b59816009cd45e58894d3644a66c3fdb11836001015460405161164391906139b3565b60405180910390a2505060016000819055505050565b600660009054906101000a900460ff1681565b600260005414156116b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a990613957565b60405180910390fd5b60026000819055506000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858152602001908152602001600020905060008160080160009054906101000a900460ff1660ff1614611765576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161175c90613897565b60405180910390fd5b42816006015411156117ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117a390613977565b60405180910390fd5b600660009054906101000a900460ff166117fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f2906137b7565b60405180910390fd5b8060040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561188e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611885906138d7565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff168160030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611920576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191790613817565b60405180910390fd5b60003073ffffffffffffffffffffffffffffffffffffffff16633fe893d686866040518363ffffffff1660e01b815260040161195d9291906139ce565b60206040518083038186803b15801561197557600080fd5b505afa158015611989573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119ad9190612c57565b905060006119da6103e86119cc6007548561250090919063ffffffff16565b61257090919063ffffffff16565b905060006119f182846125ba90919063ffffffff16565b9050600073ffffffffffffffffffffffffffffffffffffffff168460030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611bdb5782341015611a8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8690613757565b60405180910390fd5b6000611aa484346125ba90919063ffffffff16565b90506000811115611af7573373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611af5573d6000803e3d6000fd5b505b6000831115611b6a57600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f19350505050158015611b68573d6000803e3d6000fd5b505b8460040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015611bd4573d6000803e3d6000fd5b5050611cc4565b611c4e33600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16848760030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612604909392919063ffffffff16565b611cc3338560040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838760030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612604909392919063ffffffff16565b5b60008460020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166342842e0e303388600101546040518463ffffffff1660e01b8152600401611d2e939291906135e5565b600060405180830381600087803b158015611d4857600080fd5b505af1158015611d5c573d6000803e3d6000fd5b50505050338560050160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018560080160006101000a81548160ff021916908360ff16021790555084600001547f34b043e0e9e31d679baae1d9bb0ef92f0306c1b72cceef34737a29742f22609d86600101543387878a60030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051611e259594939291906139f7565b60405180910390a250505050506001600081905550505050565b611e476124f8565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611ed6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ecd90613877565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f3d906137d7565b60405180910390fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611f926124f8565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612021576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161201890613877565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612091576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208890613737565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6121596124f8565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146121e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121df90613877565b60405180910390fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16612274576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226b906136f7565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60046020528060005260406000206000915054906101000a900460ff1681565b6122f7612996565b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008481526020019081526020016000206040518061012001604052908160008201548152602001600182015481526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016004820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016005820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160068201548152602001600782015481526020016008820160009054906101000a900460ff1660ff1660ff1681525050905092915050565b600033905090565b600080831415612513576000905061256a565b600082840290508284828161252457fe5b0414612565576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255c90613857565b60405180910390fd5b809150505b92915050565b60006125b283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061268d565b905092915050565b60006125fc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506126ee565b905092915050565b612687846323b872dd60e01b8585856040516024016126259392919061361c565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612749565b50505050565b600080831182906126d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126cb91906136d5565b60405180910390fd5b5060008385816126e057fe5b049050809150509392505050565b6000838311158290612736576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161272d91906136d5565b60405180910390fd5b5060008385039050809150509392505050565b60606127ab826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166128109092919063ffffffff16565b905060008151111561280b57808060200190518101906127cb9190612c05565b61280a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161280190613937565b60405180910390fd5b5b505050565b606061281f8484600085612828565b90509392505050565b60606128338561294b565b612872576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612869906138f7565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161289c9190613567565b60006040518083038185875af1925050503d80600081146128d9576040519150601f19603f3d011682016040523d82523d6000602084013e6128de565b606091505b509150915081156128f3578092505050612943565b6000815111156129065780518082602001fd5b836040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161293a91906136d5565b60405180910390fd5b949350505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f915080821415801561298d57506000801b8214155b92505050919050565b6040518061012001604052806000815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600060ff1681525090565b600081359050612a4c81613c7c565b92915050565b600081359050612a6181613c93565b92915050565b600081359050612a7681613caa565b92915050565b600081519050612a8b81613caa565b92915050565b600082601f830112612aa257600080fd5b8135612ab5612ab082613ae6565b613ab9565b91508082526020830160208301858383011115612ad157600080fd5b612adc838284613c29565b50505092915050565b600081359050612af481613cc1565b92915050565b600081519050612b0981613cc1565b92915050565b600060208284031215612b2157600080fd5b6000612b2f84828501612a3d565b91505092915050565b600060208284031215612b4a57600080fd5b6000612b5884828501612a52565b91505092915050565b60008060008060808587031215612b7757600080fd5b6000612b8587828801612a3d565b9450506020612b9687828801612a3d565b9350506040612ba787828801612ae5565b925050606085013567ffffffffffffffff811115612bc457600080fd5b612bd087828801612a91565b91505092959194509250565b600060208284031215612bee57600080fd5b6000612bfc84828501612a67565b91505092915050565b600060208284031215612c1757600080fd5b6000612c2584828501612a7c565b91505092915050565b600060208284031215612c4057600080fd5b6000612c4e84828501612ae5565b91505092915050565b600060208284031215612c6957600080fd5b6000612c7784828501612afa565b91505092915050565b60008060408385031215612c9357600080fd5b6000612ca185828601612ae5565b9250506020612cb285828601612a3d565b9150509250929050565b600080600060608486031215612cd157600080fd5b6000612cdf86828701612ae5565b9350506020612cf086828701612a3d565b9250506040612d0186828701612a3d565b9150509250925092565b60008060008060808587031215612d2157600080fd5b6000612d2f87828801612ae5565b9450506020612d4087828801612ae5565b9350506040612d5187828801612a3d565b9250506060612d6287828801612a3d565b91505092959194509250565b612d7781613bf3565b82525050565b612d8681613b72565b82525050565b612d9581613b60565b82525050565b612da481613b60565b82525050565b612db381613b84565b82525050565b612dc281613b90565b82525050565b6000612dd382613b12565b612ddd8185613b28565b9350612ded818560208601613c38565b612df681613c6b565b840191505092915050565b6000612e0c82613b12565b612e168185613b39565b9350612e26818560208601613c38565b80840191505092915050565b6000612e3d82613b1d565b612e478185613b44565b9350612e57818560208601613c38565b612e6081613c6b565b840191505092915050565b6000612e78602f83613b55565b91507f6f6e455243373231526563656976656428616464726573732c6164647265737360008301527f2c75696e743235362c62797465732900000000000000000000000000000000006020830152602f82019050919050565b6000612ede601883613b44565b91507f63757272656e637920616c72656164792072656d6f76656400000000000000006000830152602082019050919050565b6000612f1e601383613b44565b91507f696e76616c6964206e66742061646472657373000000000000000000000000006000830152602082019050919050565b6000612f5e602683613b44565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612fc4601583613b44565b91507f796f757220707269636520697320746f6f206c6f7700000000000000000000006000830152602082019050919050565b6000613004601f83613b44565b91507f526174652073686f756c642062652062656c6c6f7720313030202831302529006000830152602082019050919050565b6000613044601483613b44565b91507f73656c6c6572206e6f74206e6674206f776e65720000000000000000000000006000830152602082019050919050565b6000613084601083613b44565b91507f73616c65732061726520636c6f736564000000000000000000000000000000006000830152602082019050919050565b60006130c4600f83613b44565b91507f696e76616c6964206164647265737300000000000000000000000000000000006000830152602082019050919050565b6000613104601a83613b44565b91507f63757272656e637920616c726561647920737570706f727465640000000000006000830152602082019050919050565b6000613144601e83613b44565b91507f6d757374207061792073616d652063757272656e637920617320736f6c6400006000830152602082019050919050565b6000613184601783613b44565b91507f6e6674206164647265737320756e737570706f727465640000000000000000006000830152602082019050919050565b60006131c4602183613b44565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061322a602083613b44565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b600061326a601883613b44565b91507f7374617475733a20736f6c64206f722063616e63656c656400000000000000006000830152602082019050919050565b60006132aa601683613b44565b91507f63757272656e6379206e6f7420737570706f72746564000000000000000000006000830152602082019050919050565b60006132ea601683613b44565b91507f63616e74206275792066726f6d20796f757273656c66000000000000000000006000830152602082019050919050565b600061332a601d83613b44565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b600061336a601183613b44565b91507f696e76616c6964206e667420746f6b656e0000000000000000000000000000006000830152602082019050919050565b60006133aa602a83613b44565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000613410601f83613b44565b91507f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006000830152602082019050919050565b6000613450601083613b44565b91507f6e6f742079657420666f722073616c65000000000000000000000000000000006000830152602082019050919050565b6101208201600082015161349a600085018261353a565b5060208201516134ad602085018261353a565b5060408201516134c06040850182612d8c565b5060608201516134d36060850182612d8c565b5060808201516134e66080850182612d7d565b5060a08201516134f960a0850182612d7d565b5060c082015161350c60c085018261353a565b5060e082015161351f60e085018261353a565b50610100820151613534610100850182613558565b50505050565b61354381613bdc565b82525050565b61355281613bdc565b82525050565b61356181613be6565b82525050565b60006135738284612e01565b915081905092915050565b600061358982612e6b565b9150819050919050565b60006020820190506135a86000830184612d9b565b92915050565b60006060820190506135c36000830186612d6e565b6135d06020830185612d9b565b6135dd6040830184613549565b949350505050565b60006060820190506135fa6000830186612d9b565b6136076020830185612d6e565b6136146040830184613549565b949350505050565b60006060820190506136316000830186612d9b565b61363e6020830185612d9b565b61364b6040830184613549565b949350505050565b60006080820190506136686000830187612d9b565b6136756020830186612d9b565b6136826040830185613549565b81810360608301526136948184612dc8565b905095945050505050565b60006020820190506136b46000830184612daa565b92915050565b60006020820190506136cf6000830184612db9565b92915050565b600060208201905081810360008301526136ef8184612e32565b905092915050565b6000602082019050818103600083015261371081612ed1565b9050919050565b6000602082019050818103600083015261373081612f11565b9050919050565b6000602082019050818103600083015261375081612f51565b9050919050565b6000602082019050818103600083015261377081612fb7565b9050919050565b6000602082019050818103600083015261379081612ff7565b9050919050565b600060208201905081810360008301526137b081613037565b9050919050565b600060208201905081810360008301526137d081613077565b9050919050565b600060208201905081810360008301526137f0816130b7565b9050919050565b60006020820190508181036000830152613810816130f7565b9050919050565b6000602082019050818103600083015261383081613137565b9050919050565b6000602082019050818103600083015261385081613177565b9050919050565b60006020820190508181036000830152613870816131b7565b9050919050565b600060208201905081810360008301526138908161321d565b9050919050565b600060208201905081810360008301526138b08161325d565b9050919050565b600060208201905081810360008301526138d08161329d565b9050919050565b600060208201905081810360008301526138f0816132dd565b9050919050565b600060208201905081810360008301526139108161331d565b9050919050565b600060208201905081810360008301526139308161335d565b9050919050565b600060208201905081810360008301526139508161339d565b9050919050565b6000602082019050818103600083015261397081613403565b9050919050565b6000602082019050818103600083015261399081613443565b9050919050565b6000610120820190506139ad6000830184613483565b92915050565b60006020820190506139c86000830184613549565b92915050565b60006040820190506139e36000830185613549565b6139f06020830184612d9b565b9392505050565b600060a082019050613a0c6000830188613549565b613a196020830187612d6e565b613a266040830186613549565b613a336060830185613549565b613a406080830184612d9b565b9695505050505050565b600060e082019050613a5f600083018a613549565b613a6c6020830189612d9b565b613a796040830188612d9b565b613a866060830187612d6e565b613a936080830186612d6e565b613aa060a0830185613549565b613aad60c0830184613549565b98975050505050505050565b6000604051905081810181811067ffffffffffffffff82111715613adc57600080fd5b8060405250919050565b600067ffffffffffffffff821115613afd57600080fd5b601f19601f8301169050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b6000613b6b82613bbc565b9050919050565b6000613b7d82613bbc565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613bfe82613c05565b9050919050565b6000613c1082613c17565b9050919050565b6000613c2282613bbc565b9050919050565b82818337600083830152505050565b60005b83811015613c56578082015181840152602081019050613c3b565b83811115613c65576000848401525b50505050565b6000601f19601f8301169050919050565b613c8581613b60565b8114613c9057600080fd5b50565b613c9c81613b72565b8114613ca757600080fd5b50565b613cb381613b84565b8114613cbe57600080fd5b50565b613cca81613bdc565b8114613cd557600080fd5b5056fea264697066735822122031f120fccb7389b54ef32df18cc02b0c8e6ade4f13e1b66af92e6334131a6eb564736f6c634300060700330000000000000000000000005bded8f6bdae766c361edae25c5dc966bcaf8f430000000000000000000000000000000000000000000000000000000000000064

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

0000000000000000000000005bded8f6bdae766c361edae25c5dc966bcaf8f430000000000000000000000000000000000000000000000000000000000000064

-----Decoded View---------------
Arg [0] : _feeReceiver (address): 0x5bDed8f6BdAE766C361EDaE25c5DC966BCaF8f43
Arg [1] : _feeRate (uint256): 100

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000005bded8f6bdae766c361edae25c5dc966bcaf8f43
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000064


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading

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.