Contract 0x88c44b49638ec0fb24c850a5ef07fad65cca0d07

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x11f35d9f6e613e7282a6df1f09bfe08c63cd19e698b606901901b30e0c60dfd8Collect Emission...340325942022-10-07 5:43:371 hr ago0x8f22f2d7562dc492538ae1000a1d98b84a43a6da IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.003074053501 34.500000019
0x1b909ed266df2749673222bb139e09bda056d31480031402c6bd418ceae299b9Collect Emission...340149182022-10-06 19:20:0411 hrs 23 mins ago0x91d552c403b819f7ba64e7c34db60a6fda5c87d2 IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.003074053501 34.500000016
0x5bb2c9db419c0d579a363bc7287eb8d11c95d3ecf470653d29aa7f0203dc02faCollect Emission...340068392022-10-06 14:41:5516 hrs 1 min ago0x2ed6a123228b9ead7ab4b03972def9ac46bb489e IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.008969457163 84.455779623
0xa94ab6039d2d21b61a421126faa8bea21d2974c721837d5506268545be19b606Collect Emission...340022642022-10-06 12:04:3818 hrs 39 mins ago0x3e7be85e78cb5b5b0bd5cb50a09fd921337d36cb IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.003074053506 34.500000075
0x0a37163e5401bb8639241b8cdf62e55698ba18411134d37ddb2e340a7dd0d5baCollect Emission...340016422022-10-06 11:43:1419 hrs ago0xa6556ff91b539c4c0160d10b97c31595b54a6e64 IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.004253953503 34.500000027
0x63305a548bef68a59cb8798cbbd5be588115dbda59968992148d3aa662d0e2a2Collect Emission...339994002022-10-06 10:24:0120 hrs 19 mins ago0x6bb106e2fb7da9eb1f9ef4151846bb103b86dfa0 IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.003664003501 34.500000014
0x1e336d15e9a665fa635102e6a1e0137319efe0c768612d1fa4bf950758e2a900Collect Emission...339983762022-10-06 9:48:4620 hrs 55 mins ago0x153669f84564c2db2e9831c6748af2c35caa80ad IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.003664003501 34.500000014
0xbf50fd56e3039d3e7887f12be470b928859945d9fb0e64c2c678a68b8003605fCollect Emission...339980822022-10-06 9:38:4221 hrs 5 mins ago0x101ef244ea26bd0d3fdd706521b05da1f4f15799 IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.003186090001 30.000000016
0xda90d3f080d73911512b4f48a9b9ef825702b0d599fc5e79de0ec5244bada07aCollect Emission...339866892022-10-06 3:05:481 day 3 hrs ago0xff1153a6809fc384983963721b751b0df822e246 IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.003664003501 34.500000013
0x317e96c221ee6a0dc20412690d81a95cd8989bb3ab635a61fb4e1d759e83e1faCollect Emission...339845862022-10-06 1:53:251 day 4 hrs ago0x51bd80d951b94aadef7be51626a20a7615468558 IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.003664003501 34.500000018
0x5d7a15031f84ebc47cc95634ac205951ca592716770bd0e41a0ed178bc28010fCollect Emission...339822892022-10-06 0:32:121 day 6 hrs ago0x8fdcce46094f3da1571823134d4ae8600ae4a0c0 IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.003664003501 34.500000014
0xa2c5686c25d808387cc91f2f3c4bc516e269bb7629cf47ee26ae84f1b66ab4cfCollect Emission...339802612022-10-05 23:20:151 day 7 hrs ago0x4de0b3d26d667cd611b5a5169c0a3a47ec6a0931 IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.004030403849 37.949999998
0xeecf8bef85ff1095f74238fdd097ab935504ab3e1599a7c216bb64cc9a4749b0Collect Emission...339777872022-10-05 21:50:471 day 8 hrs ago0x2279633aaaaeb56f5af9ca6aea2c9ede829866e7 IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.003907122345 36.789189997
0x2c8ad2064145a8f8d840eeac9f47dd2e15bfbd09a4bde6133fdf9efe2afa2ed0Collect Emission...339725672022-10-05 18:49:111 day 11 hrs ago0x4375fceafc89d361c76916deda657e156b2872a1 IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.003664003501 34.500000017
0x76e89ad1449898f71703cc47d8feece5e4156b4d65bb201458dcadd7a620fa15Collect Emission...339723162022-10-05 18:40:331 day 12 hrs ago0x6461b6075bcc993f03fe58ff8355da31171eb3f0 IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.003664003501 34.500000017
0x90611abdab7be6960953c7fc87af35e9b4253694daed826cf2b4dca182e3d9f0Collect Emission...339719802022-10-05 18:29:011 day 12 hrs ago0x2ed6a123228b9ead7ab4b03972def9ac46bb489e IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.003125287724 35.074999991
0x9f9b3e8dd86c61a862618990344b76f9496b9529d6122ef1ab4e603fd3da5597Collect Emission...339719792022-10-05 18:28:591 day 12 hrs ago0x2ed6a123228b9ead7ab4b03972def9ac46bb489e IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.003125287724 35.074999991
0x0c90a92201d8b04a3edf39ce5a93d78448647057684ef54e3e8dc19b75f41e15Set Approval For...339660292022-10-05 15:04:151 day 15 hrs ago0x9586368ab35461f5a1ccc0cb44b43b14937c3eaa IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.001441001126 31.066101676
0x1f32bd06487fbd98717f6ac239ad654e63c6907620ee7236bb3b1ad198b707cdCollect Emission...339656042022-10-05 14:49:361 day 15 hrs ago0x9586368ab35461f5a1ccc0cb44b43b14937c3eaa IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.004259972631 34.548815779
0xbc1a848f76d622489187959bcd23bc41036d8216516e9f15c0e1f66e65085a00Collect Emission...339640282022-10-05 13:55:191 day 16 hrs ago0x9002bbf529037fd1ca303e374eb3b70ccd5057a1 IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.003081222355 34.580455829
0xee9332a8f1e65e45763e1f08b6bb86b924f465e57e8fcaac1d48e15b4484eccdCollect Emission...339637962022-10-05 13:47:231 day 16 hrs ago0xae3d744bb9a615873c23f36b15ef15f2d5540824 IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.003595004088 34.500005644
0xbf296585888aeb9394a5836f692c192fed008fd248bde12a6c3c70350a355e95Collect Emission...339566872022-10-05 9:40:461 day 21 hrs ago0x6bb106e2fb7da9eb1f9ef4151846bb103b86dfa0 IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.003664003502 34.500000021
0x6de9229ff921c282c9c9edddc742ec7366e0131f7736045c981473ed53ce1804Collect Emission...339537482022-10-05 7:57:171 day 22 hrs ago0x9c2c3a2cc8fc5cde5d47902ef40b05604d49d7c3 IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.003074053502 34.500000024
0x30302c670fc7978d76cf839f2db1c54dae2b3e9a1a7784d4d06f3ea6a4366e72Collect Emission...339510752022-10-05 6:23:102 days 20 mins ago0x55068af65edcec1f9f729f0d51042e8ac80fb97b IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.004253953501 34.500000016
0x9eae94bbce26325aab32a2dd8efe0e7869607050b690045ed41dccfb0aa6c083Collect Emission...339509352022-10-05 6:18:222 days 25 mins ago0xdd2c4468fec725166a7813b626e2831bb2c12893 IN  0x88c44b49638ec0fb24c850a5ef07fad65cca0d070 MATIC0.003084300345 34.615
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x23eacbd32d5e729cf36071d95cb4f17418ddc9679ceda72bb6a96a297b0d47bb334508742022-09-23 3:36:5314 days 3 hrs ago 0x88c44b49638ec0fb24c850a5ef07fad65cca0d07 QuickSwap: Router19.52 MATIC
0x23eacbd32d5e729cf36071d95cb4f17418ddc9679ceda72bb6a96a297b0d47bb334508742022-09-23 3:36:5314 days 3 hrs ago 0x0665013b737d8327f44408adc49c797b7bd2b5d3 0x88c44b49638ec0fb24c850a5ef07fad65cca0d0719.52 MATIC
0xd78d5ae14884ed65ba53d3c0ebb6620578c72b352de99bf18e9058776f1b3e37334456962022-09-23 0:38:5314 days 6 hrs ago 0x88c44b49638ec0fb24c850a5ef07fad65cca0d07 QuickSwap: Router21.22 MATIC
0xd78d5ae14884ed65ba53d3c0ebb6620578c72b352de99bf18e9058776f1b3e37334456962022-09-23 0:38:5314 days 6 hrs ago 0x0665013b737d8327f44408adc49c797b7bd2b5d3 0x88c44b49638ec0fb24c850a5ef07fad65cca0d0721.22 MATIC
0x6f54af0a5f76392c76b7611859248677e505eaf53796faa0bbe0433ca89049ae334456612022-09-23 0:37:3914 days 6 hrs ago 0x88c44b49638ec0fb24c850a5ef07fad65cca0d07 QuickSwap: Router41.63 MATIC
0x6f54af0a5f76392c76b7611859248677e505eaf53796faa0bbe0433ca89049ae334456612022-09-23 0:37:3914 days 6 hrs ago 0x0665013b737d8327f44408adc49c797b7bd2b5d3 0x88c44b49638ec0fb24c850a5ef07fad65cca0d0741.63 MATIC
0xa3dc33dcc21caa1790465fbd2b857094738cf087ba9bb7eb353bae5899224d55330009072022-09-12 6:17:3425 days 26 mins ago 0x88c44b49638ec0fb24c850a5ef07fad65cca0d07 QuickSwap: Router12.56 MATIC
0xa3dc33dcc21caa1790465fbd2b857094738cf087ba9bb7eb353bae5899224d55330009072022-09-12 6:17:3425 days 26 mins ago 0x0665013b737d8327f44408adc49c797b7bd2b5d3 0x88c44b49638ec0fb24c850a5ef07fad65cca0d0712.56 MATIC
0xb4675bdaed43d8ec7cb75bbee7ddde50a0f2e89d5a7e0492eb503d4374c3d22f330008242022-09-12 6:14:4025 days 29 mins ago 0x88c44b49638ec0fb24c850a5ef07fad65cca0d07 QuickSwap: Router16.18 MATIC
0xb4675bdaed43d8ec7cb75bbee7ddde50a0f2e89d5a7e0492eb503d4374c3d22f330008242022-09-12 6:14:4025 days 29 mins ago 0x0665013b737d8327f44408adc49c797b7bd2b5d3 0x88c44b49638ec0fb24c850a5ef07fad65cca0d0716.18 MATIC
0xe42b7d6bd8cb62d2eecab6cfac4895110a488822730afc11c9af042ae2e65c47330007992022-09-12 6:13:5025 days 30 mins ago 0x88c44b49638ec0fb24c850a5ef07fad65cca0d07 QuickSwap: Router19.82 MATIC
0xe42b7d6bd8cb62d2eecab6cfac4895110a488822730afc11c9af042ae2e65c47330007992022-09-12 6:13:5025 days 30 mins ago 0x0665013b737d8327f44408adc49c797b7bd2b5d3 0x88c44b49638ec0fb24c850a5ef07fad65cca0d0719.82 MATIC
0x64faa773a8ca684a3f502e1eec7b09817ad81850b4e962beee68da9c65ba4d8c330007792022-09-12 6:13:1025 days 30 mins ago 0x88c44b49638ec0fb24c850a5ef07fad65cca0d07 QuickSwap: Router19.82 MATIC
0x64faa773a8ca684a3f502e1eec7b09817ad81850b4e962beee68da9c65ba4d8c330007792022-09-12 6:13:1025 days 30 mins ago 0x0665013b737d8327f44408adc49c797b7bd2b5d3 0x88c44b49638ec0fb24c850a5ef07fad65cca0d0719.82 MATIC
0x9329a8685d9567807a366d47f8edcac3d1e6ab6d5e4b13879bd8f8ec57ec673f330007592022-09-12 6:12:2625 days 31 mins ago 0x88c44b49638ec0fb24c850a5ef07fad65cca0d07 QuickSwap: Router19.82 MATIC
0x9329a8685d9567807a366d47f8edcac3d1e6ab6d5e4b13879bd8f8ec57ec673f330007592022-09-12 6:12:2625 days 31 mins ago 0x0665013b737d8327f44408adc49c797b7bd2b5d3 0x88c44b49638ec0fb24c850a5ef07fad65cca0d0719.82 MATIC
0xb71f30da63c6401e390c4d7c0ed78a26d8f3f0c101cbfe0eaa6a604c7352794c325729452022-09-01 22:24:2035 days 8 hrs ago 0x88c44b49638ec0fb24c850a5ef07fad65cca0d07 QuickSwap: Router12.93 MATIC
0xb71f30da63c6401e390c4d7c0ed78a26d8f3f0c101cbfe0eaa6a604c7352794c325729452022-09-01 22:24:2035 days 8 hrs ago 0x0665013b737d8327f44408adc49c797b7bd2b5d3 0x88c44b49638ec0fb24c850a5ef07fad65cca0d0712.93 MATIC
0x15549864607640aca2b0521c296ea1c22ac5fd04b39fd14fb307161167d9594b325729122022-09-01 22:23:1035 days 8 hrs ago 0x88c44b49638ec0fb24c850a5ef07fad65cca0d07 QuickSwap: Router22.27 MATIC
0x15549864607640aca2b0521c296ea1c22ac5fd04b39fd14fb307161167d9594b325729122022-09-01 22:23:1035 days 8 hrs ago 0x0665013b737d8327f44408adc49c797b7bd2b5d3 0x88c44b49638ec0fb24c850a5ef07fad65cca0d0722.27 MATIC
0x7e2aad9c507f1798303d49f030e1ade8fe5b024f3acf7ebc7dae857e190fd7f7325728872022-09-01 22:22:2035 days 8 hrs ago 0x88c44b49638ec0fb24c850a5ef07fad65cca0d07 QuickSwap: Router12.93 MATIC
0x7e2aad9c507f1798303d49f030e1ade8fe5b024f3acf7ebc7dae857e190fd7f7325728872022-09-01 22:22:2035 days 8 hrs ago 0x0665013b737d8327f44408adc49c797b7bd2b5d3 0x88c44b49638ec0fb24c850a5ef07fad65cca0d0712.93 MATIC
0x8ad855f71faf57d7a39a231829fc249ac0edc23d426045d9275a924e622b6226325728692022-09-01 22:21:4435 days 8 hrs ago 0x88c44b49638ec0fb24c850a5ef07fad65cca0d07 QuickSwap: Router12.93 MATIC
0x8ad855f71faf57d7a39a231829fc249ac0edc23d426045d9275a924e622b6226325728692022-09-01 22:21:4435 days 8 hrs ago 0x0665013b737d8327f44408adc49c797b7bd2b5d3 0x88c44b49638ec0fb24c850a5ef07fad65cca0d0712.93 MATIC
0x033e77f602ec555057c57ca6e0c7846e00e500953b4ebc7d9ffb362e6b36c25a324894902022-08-30 17:36:2937 days 13 hrs ago 0x88c44b49638ec0fb24c850a5ef07fad65cca0d07 QuickSwap: Router45.35 MATIC
[ Download CSV Export 
Loading

Similar Match Source Code
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0x2241E422C9Ef37Ea056135Faf16D01e4075F863C

Contract Name:
WORLD

Compiler Version
v0.7.3+commit.9bfce1f6

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 22 : WORLD.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "./interfaces/IGAME_ERC20.sol";
import "./interfaces/IGAME_Game.sol";
import "./interfaces/IUniswapV2Router02.sol";
import "./interfaces/IGenesis.sol";
import "./interfaces/ILocalContract.sol";
import "./common/NFTbase.sol";

/// @title ERC-1155 bonded NFTs
/// @author Paul Barclay, Daniel Lee
/// @notice You can use this contract for bonded NFT sales
/// @dev All function calls are currently implemented without side effects
contract WORLD is NFTbase, ReentrancyGuard, ILocalContract {
    using SafeMath for uint256;

    bool public burningActive;
    bool public mintingActive;

    IGAME_ERC20 public gameToken;
    IUniswapV2Router02 public uniswapRouter;

    address public feeReceiver;
    address public foundationAddress;
    address public governanceAddress;
    IGENESIS public genesis;

    mapping(uint256 => uint256) public saleStarts;
    mapping(uint256 => uint256) public tokenSupply;
    mapping(address => uint256) public userUpdateTimes;
    mapping(address => uint256) public userEmissions;
    mapping(address => uint256) public userTotals;
    uint256 public systemUpdateTime;
    uint256 public systemTotal;
    uint256 public startTime;
    uint256 public maxBuyAmount = 10;

    uint256 public constant twoYears = 63113904;
    uint256 public constant sevenDays = 604800;
    uint256 public constant twentyTwoDecimals = 10**22;

    uint256 public minimumPrice = 500 * 10**18; // << stored in GAME (so 500*10^18)
    uint256 public dutchStartPrice = 500 * 10**18;
    uint256 public dutchDuration = 4000;
    uint256 public priceDivisor = 25;
    address public deadAddress = 0x000000000000000000000000000000000000dEaD;

    event MinimumPriceUpdated(uint256 minimumPrice);
    event DutchStartPriceUpdated(uint256 dutchStartPrice);
    event DutchDurationUpdated(uint256 dutchDuration);

    event TokenData(uint256 tokenId, uint256 onSaleDate);

    event TokenBought(
        address indexed to,
        uint256 id,
        uint256 pricePaid,
        uint256 amount,
        uint256 nextPrintPrice,
        uint256 nextBurnPrice,
        uint256 tokenSupply,
        uint256 reserve
    );

    event TokenBurned(
        address indexed to,
        uint256 id,
        uint256 priceReceived,
        uint256 nextPrintPrice,
        uint256 nextBurnPrice,
        uint256 printsSupply,
        uint256 reserve
    );

    event EmissionUpdated(
        address user,
        uint256 amount
    );

    event EmissionCollected(
        address user,
        uint256 amount
    );

    modifier beforeBuy(uint256 tokenId) {
        require(mintingActive, "minting is not active");
        require(block.timestamp >= saleStarts[tokenId] && saleStarts[tokenId] > 0, "sale has not started yet");
        _;
    }

    constructor(
        address foundation_,
        address governance_,
        address genesisERC20_,
        address gameToken_,
        address feeReceiver_
    ) payable NFTbase("no_url_set") {
        // constructor arguments
        foundationAddress = foundation_;
        governanceAddress = governance_;
        genesis = IGENESIS(genesisERC20_);
        gameToken = IGAME_ERC20(gameToken_);
        feeReceiver = feeReceiver_;

        systemUpdateTime = block.timestamp;
    }

    function setUniswapRouter(address uniswapRouter_) public isGlobalAdmin {
        uniswapRouter = IUniswapV2Router02(uniswapRouter_);
    }

    function setMinimumPrice(uint256 minimumPrice_) public isGlobalAdmin {
        minimumPrice = minimumPrice_;
        emit MinimumPriceUpdated(minimumPrice_);
    }

    function setDutchStartPrice(uint256 dutchStartPrice_) public isGlobalAdmin {
        dutchStartPrice = dutchStartPrice_;
        emit DutchStartPriceUpdated(dutchStartPrice_);
    }

    function setDutchDuration(uint256 dutchDuration_) public isGlobalAdmin {
        dutchDuration = dutchDuration_;
        emit DutchDurationUpdated(dutchDuration_);
    }

    function setFeeReceiver(address account) public isGlobalAdmin {
        feeReceiver = account;
    }

    function setFoundationAddress(address account) public isGlobalAdmin {
        foundationAddress = account;
    }

    function setGenesisAddress(address account) public isGlobalAdmin {
        genesis = IGENESIS(account);
    }

    function setTokenMintingActive(bool active) public isGlobalAdmin {
        mintingActive = active;
    }

    function setTokenBurningActive(bool active) public isGlobalAdmin {
        burningActive = active;
    }

    function setMaxBuyAmount(uint256 amount) public isGlobalAdmin {
        maxBuyAmount = amount;
    }

    function setPriceDivisor(uint256 newDivisor) public isGlobalAdmin {
        require(block.timestamp < saleStarts[1], "must before first token sale");
        priceDivisor = newDivisor;
    }

    function getMinimumPrice(uint256 tokenId) public view returns (uint256) {
        uint256 saleStartTime = saleStarts[tokenId];
        uint256 dutchEnd = saleStartTime.add(dutchDuration);
        uint256 timeNow = block.timestamp;

        if (timeNow >= dutchEnd)
            return minimumPrice;

        if(timeNow <= saleStartTime)
            return dutchStartPrice > minimumPrice ? dutchStartPrice : minimumPrice;

        uint256 dutchPrice = dutchStartPrice.mul(dutchEnd.sub(timeNow)).div(dutchDuration);
        return dutchPrice > minimumPrice ? dutchPrice : minimumPrice;
    }

    function getBuyPrice(uint256 tokenId, uint256 buyAmount) public view returns (uint256 buyPrice) {
        uint256 supply = tokenSupply[tokenId];
        uint256 minPrice = getMinimumPrice(tokenId);
        for(uint256 i = 1; i <= buyAmount; i++) {
          uint256 printPrice = getPrintPrice(supply + i);
          buyPrice = buyPrice.add(printPrice > minPrice ? printPrice : minPrice);
        }
        return buyPrice;
    }

    function getSellPrice(uint256 tokenId) public view returns (uint256) {
        return getPrintPrice(tokenSupply[tokenId]).mul(95).div(100);
    }

    function getPrintPrice(uint256 printNumber) public view returns (uint256) {
        uint256 price = (printNumber**3).mul(1000).div(9**8);
        price = price.add(printNumber.mul(125));
        price = price.add(50000);
        price = price.div(priceDivisor).mul(10**17);
        return price;
    }

    function updateTokenData(
        uint256 tokenId,
        uint256 onSaleDate
    ) public isTokenDataManager {
        require(tokenId > 0, "token Ids start at 1");
        require(saleStarts[tokenId] == 0 || saleStarts[tokenId] >= block.timestamp, "token sale must not have started");
        require(onSaleDate > block.timestamp, "sale date must be in the future");

        if (tokenId == 1) {
            startTime = onSaleDate.add(sevenDays);
            for (uint256 i = 2; i <= 24; i++) {
                require(saleStarts[i] == 0 || saleStarts[i] >= onSaleDate, "token 1 can't go on sale after other tokens");
            }
        } else {
            uint256 minOnSaleDate = saleStarts[1];
            require(minOnSaleDate > 0, "can't define this token until token 1 is defined");
            if (tokenId > 24) {
                require(block.timestamp >= minOnSaleDate, "can't update this token until token 1 goes on sale");
                // This enforces 24 tokens + 1 per 28 days.
                minOnSaleDate = minOnSaleDate.add(tokenId.sub(24).mul(sevenDays * 4));
            }
            require(onSaleDate >= minOnSaleDate, "can't sell this token before its minimum on sale date");
        }

        saleStarts[tokenId] = onSaleDate;

        emit TokenData(tokenId, onSaleDate);
    }

    function buyNFTwithGAME(
      uint256 tokenId, 
      uint256 pricePaid, 
      uint256 buyAmount
    ) public beforeBuy(tokenId) {
        address sender = _msgSender();
        uint256 price = getBuyPrice(tokenId, buyAmount);

        gameToken.transferByContract(sender, address(this), pricePaid);

        _buyNFT(tokenId, price, pricePaid, sender, buyAmount);
    }

    function buyNFTwithMatic(
      uint256 tokenId, 
      address[] calldata path, 
      uint256 buyAmount
    ) public payable nonReentrant beforeBuy(tokenId) {
        require(path.length > 1 && path[path.length - 1] == address(gameToken), "invalid path");

        address sender = _msgSender();
        uint256 price = getBuyPrice(tokenId, buyAmount);

        uint256[] memory amounts = uniswapRouter.swapExactETHForTokens{value: msg.value}(
            price,
            path,
            address(this),
            block.timestamp + 100
        );

        uint256 pricePaid = amounts[amounts.length - 1];
        _buyNFT(tokenId, price, pricePaid, sender, buyAmount);
    }

    function buyNFTwithERC20(
        uint256 tokenId,
        uint256 erc20amount,
        address[] calldata path,
        uint256 buyAmount
    ) public nonReentrant beforeBuy(tokenId) {
        require(path.length > 1 && path[path.length - 1] == address(gameToken), "invalid path");

        address sender = _msgSender();
        uint256 price = getBuyPrice(tokenId, buyAmount);
        address pathStart = path[0];

        require(IERC20(pathStart).transferFrom(sender, address(this), erc20amount));
        require(IERC20(pathStart).approve(address(uniswapRouter), erc20amount));

        uint256[] memory amounts = uniswapRouter.swapExactTokensForTokens(
            erc20amount,
            price,
            path,
            address(this),
            block.timestamp + 100
        );

        uint256 pricePaid = amounts[amounts.length - 1];
        _buyNFT(tokenId, price, pricePaid, sender, buyAmount);
    }

    function burn(uint256 tokenId) public {
        require(burningActive, "burning is not active");
        require(balanceOf(_msgSender(), tokenId) >= 1, "sender must have at least one token");
        uint256 price = getSellPrice(tokenId);
        tokenSupply[tokenId] -= 1;
        _burn(_msgSender(), tokenId, 1);
        emit TokenBurned(
            _msgSender(),
            tokenId,
            price,
            getBuyPrice(tokenId, 1),
            getSellPrice(tokenId),
            tokenSupply[tokenId],
            gameToken.balanceOf(address(this))
        );
        gameToken.transferByContract(address(this), _msgSender(), price);
    }

    function getCurrentEmissions(address user) public view returns(uint256) {
        uint256 prevTime = userUpdateTimes[user];
        uint256 claimBalance = userTotals[user];
        uint256 currentTime = block.timestamp;
        uint256 emission = _calculateEmission(prevTime, currentTime, claimBalance);
        return emission + userEmissions[user];
    }

    function collectEmissions() public {
        // This can be called to collect the emissions for the caller's account
        //   and update the foundation and governance emissions.
        address user = _msgSender();
        _updateUserBalance(user, userTotals[user]);
        _updateSystemBalances(systemTotal);

        uint256 emission = userEmissions[user];
        userEmissions[user] = 0;
        genesis.mintToAddress(user, emission);
        emit EmissionCollected(user, emission);
    }

    function _updateSystemBalances(uint prevSysTotal) internal {
        uint256 prevTime = systemUpdateTime;
        uint256 currentTime = block.timestamp;
        systemUpdateTime = currentTime;
        uint256 foundationEmission = _calculateEmission(prevTime, currentTime, prevSysTotal);
        // governance emission starts 28 days after other rewards / 35 days after first token purchase;
        uint256 governanceEmission = _calculateEmission(prevTime.sub(2419200), currentTime.sub(2419200), prevSysTotal);

        if (foundationEmission > 0) genesis.mintToAddress(foundationAddress, foundationEmission);
        if (governanceEmission > 0) {
            // We divide the governance emission by 2 here rather than above, because it's slightly more gas efficient
            genesis.mintToAddress(governanceAddress, governanceEmission.div(2));
        }
    }

    function _calculateEmission(
        uint prevTime,
        uint currentTime,
        uint stakes
    ) internal view returns (uint256) {
        if (prevTime == currentTime || currentTime <= startTime || stakes == 0) return 0;
        uint time1 = prevTime <= startTime ? 0 : prevTime.sub(startTime);
        uint time2 = currentTime.sub(startTime);
        uint256 existingEmissionLevel = twentyTwoDecimals.mul(time1).div(time1.add(twoYears));
        uint256 newEmissionLevel = twentyTwoDecimals.mul(time2).div(time2.add(twoYears));
        return newEmissionLevel.sub(existingEmissionLevel).mul(stakes);
    }

    function _updateUserBalance(address user, uint prevTotal) internal {
        uint256 prevTime = userUpdateTimes[user];
        uint256 currentTime = block.timestamp;
        userUpdateTimes[user] = currentTime;
        uint256 emission = _calculateEmission(prevTime, currentTime, prevTotal);
        if (emission > 0) {
            userEmissions[user] += emission;
            emit EmissionUpdated(user, emission);
        }
    }

    function _buyNFT(
        uint256 tokenId,
        uint256 price,
        uint256 pricePaid,
        address sender,
        uint256 buyAmount
    ) internal {
        require(pricePaid >= price, "must pay at least the base price");
        require(buyAmount <= maxBuyAmount, "can't buy more than max #");

        uint256 basePrice = 0;
        uint256 newSupply = tokenSupply[tokenId];

        for(uint256 i = 1; i <= buyAmount; i++) {
          newSupply = newSupply.add(1);
          uint256 printPrice = getPrintPrice(newSupply);
          basePrice = basePrice.add(printPrice.mul(95).div(100));
        }
        uint256 fee = pricePaid.sub(basePrice);
        
        emit TokenBought(
            sender,
            tokenId,
            buyAmount,
            price,
            getBuyPrice(tokenId, 1),
            getSellPrice(tokenId),
            newSupply,
            gameToken.balanceOf(address(this))
        );

        tokenSupply[tokenId] = newSupply;
        _mint(sender, tokenId, buyAmount, "");

        if (fee > 0) {
            gameToken.transferByContract(address(this), feeReceiver, fee);
        }
    }

    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal override {
        uint256 totalChange = 0;
        for (uint256 i = 0; i < amounts.length; i++) {
            totalChange = totalChange.add(amounts[i]);
        }
        if (from == address(0) && to != address(0)) {
            uint256 prevSysTotal = systemTotal;
            _updateSystemBalances(prevSysTotal);
            systemTotal = prevSysTotal.add(totalChange);
        }
        if (to == address(0) && from != address(0)) {
            uint256 prevSysTotal = systemTotal;
            _updateSystemBalances(prevSysTotal);
            systemTotal = prevSysTotal.sub(totalChange);
        }
        if (to != address(0) && to != deadAddress) {
            uint256 prevToTotal = userTotals[to];
            _updateUserBalance(to, prevToTotal);
            userTotals[to] = prevToTotal.add(totalChange);
        }
        if (from != address(0) && to != deadAddress) {
            uint256 prevFromTotal = userTotals[from];
            _updateUserBalance(from, prevFromTotal);
            userTotals[from] = prevFromTotal.sub(totalChange);
        }
    }
}

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

pragma solidity ^0.7.0;

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

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

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

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

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

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

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

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

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

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

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

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

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

File 3 of 22 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

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

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

    uint256 private _status;

    constructor () {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 4 of 22 : IGAME_ERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;

import '@openzeppelin/contracts/token/ERC20/IERC20.sol';


// @title IGAME_ERC20
// @dev The interface for the Auction & ERC-20 contract
//  Only methods required for calling by sibling contracts are required here
// @author GAME Credits (gamecredits.org)
abstract contract IGAME_ERC20 is IERC20 {
    function cancelAuctionByManager(uint256 tokenId_) external virtual;

    function transferByContract(
        address from_,
        address to_,
        uint256 value_
    ) external virtual;

    function linkContracts(address gameContract_, address erc721Contract_)
        external
        virtual;

    function getGameBalance(uint256 game_)
        public
        view
        virtual
        returns (uint256 balance);

    function getLoyaltyPointsGranted(uint256 game_, address account_)
        public
        view
        virtual
        returns (uint256 currentPoints);

    function getLoyaltyPointSpends(uint256 game_, address account_)
        public
        view
        virtual
        returns (uint256 currentPoints);

    function getLoyaltyPointsTotal(uint256 game_, address account_)
        public
        view
        virtual
        returns (uint256 currentPoints);

    function thirdPartySpendLoyaltyPoints(
        uint256 game_,
        address account_,
        uint256 pointsToSpend_
    ) external virtual;
}

File 5 of 22 : IGAME_Game.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;


// @title IGAME_Game
// @dev The interface for the GAME Credits Game Data contract
//  Only methods required for calling by sibling contracts are required here
// @author GAME Credits (gamecredits.org)
abstract contract IGAME_Game {
  mapping(uint => mapping(address => bool)) public gameAdmins;
  mapping(uint => mapping(address => bool)) public gameOperators;

  function getCardPrice(uint game_, uint set_, uint card_) virtual external view returns(uint256);
  function getCardLoyaltyPrice(uint game_, uint set_, uint card_) virtual external view returns(uint256);
  function isGameAdmin(uint game_, address admin_) virtual external view returns(bool);
  function linkContracts(address erc721Contract_, address erc20Contract_) virtual external;
  function isOperatorOrMinion(uint game_, address sender_) virtual external returns(bool);
  function isValidCaller(address account_, bool isMinion_, uint game_) virtual external view returns(bool isValid);
  function burnToken(uint tokenId_) virtual external;
  function createTokenFromCard(uint game_, uint set_, uint card_) virtual external returns(uint tokenId, uint tradeLockTime, uint fixedXp);
}

File 6 of 22 : IUniswapV2Router02.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2;

import './IUniswapV2Router01.sol';

interface IUniswapV2Router02 is IUniswapV2Router01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountETH);
    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}

File 7 of 22 : IGenesis.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IGENESIS is IERC20 {
    function mintToAddress(address user, uint256 amount) external;

    function governanceTransfer(
        address from,
        address to,
        uint256 amount
    ) external;
}

File 8 of 22 : ILocalContract.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;


// @title iLocalContract
// @author GAME Credits (gamecredits.org)
abstract contract ILocalContract {

  function updateLocalContract(address contract_, bool isLocal_) external virtual {}

  function isLocalContract()
    external
    virtual
    pure
  returns(bool) {
    return true;
  }
}

File 9 of 22 : NFTbase.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;

import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";

/**
 * @title ERC1155Mock
 * This mock just publicizes internal functions for testing purposes
 */
contract NFTbase is ERC1155, AccessControl {
    using Strings for uint256;

    bytes32 public constant TOKENDATA_MANAGER_ROLE = keccak256("TOKENDATA_MANAGER_ROLE");

    string _baseURI;

    modifier isGlobalAdmin() {
        require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()));
        _;
    }

    modifier isTokenDataManager() {
        require(hasRole(TOKENDATA_MANAGER_ROLE, _msgSender()));
        _;
    }

    constructor(string memory uri) ERC1155(uri) {
        _baseURI = uri;
        _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
        _setupRole(TOKENDATA_MANAGER_ROLE, _msgSender());
        _setRoleAdmin(TOKENDATA_MANAGER_ROLE, DEFAULT_ADMIN_ROLE);
    }

    mapping(uint256 => string) public _tokenURIs;

    function setURI(string memory newuri, uint256 id) public isGlobalAdmin() {
        _tokenURIs[id] = newuri;
    }

    function setBaseURI(string memory newuri) public isGlobalAdmin() {
        _baseURI = newuri;
    }

    function uri(uint256 tokenid) public view override returns (string memory) {
        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()));
    }
}

File 10 of 22 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.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 11 of 22 : IUniswapV2Router01.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2;

interface IUniswapV2Router01 {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountToken, uint amountETH);
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}

File 12 of 22 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.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--] = bytes1(uint8(48 + temp % 10));
            temp /= 10;
        }
        return string(buffer);
    }
}

File 13 of 22 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

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

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context {
    using EnumerableSet for EnumerableSet.AddressSet;
    using Address for address;

    struct RoleData {
        EnumerableSet.AddressSet members;
        bytes32 adminRole;
    }

    mapping (bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view returns (bool) {
        return _roles[role].members.contains(account);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view returns (uint256) {
        return _roles[role].members.length();
    }

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view returns (address) {
        return _roles[role].members.at(index);
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant");

        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke");

        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        emit RoleAdminChanged(role, _roles[role].adminRole, adminRole);
        _roles[role].adminRole = adminRole;
    }

    function _grantRole(bytes32 role, address account) private {
        if (_roles[role].members.add(account)) {
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (_roles[role].members.remove(account)) {
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

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

pragma solidity ^0.7.0;

import "./IERC1155.sol";
import "./IERC1155MetadataURI.sol";
import "./IERC1155Receiver.sol";
import "../../utils/Context.sol";
import "../../introspection/ERC165.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";

/**
 *
 * @dev Implementation of the basic standard multi-token.
 * See https://eips.ethereum.org/EIPS/eip-1155
 * Originally based on code by Enjin: https://github.com/enjin/erc-1155
 *
 * _Available since v3.1._
 */
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
    using SafeMath for uint256;
    using Address for address;

    // Mapping from token ID to account balances
    mapping (uint256 => mapping(address => uint256)) private _balances;

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

    // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
    string private _uri;

    /*
     *     bytes4(keccak256('balanceOf(address,uint256)')) == 0x00fdd58e
     *     bytes4(keccak256('balanceOfBatch(address[],uint256[])')) == 0x4e1273f4
     *     bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
     *     bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256,uint256,bytes)')) == 0xf242432a
     *     bytes4(keccak256('safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)')) == 0x2eb2c2d6
     *
     *     => 0x00fdd58e ^ 0x4e1273f4 ^ 0xa22cb465 ^
     *        0xe985e9c5 ^ 0xf242432a ^ 0x2eb2c2d6 == 0xd9b67a26
     */
    bytes4 private constant _INTERFACE_ID_ERC1155 = 0xd9b67a26;

    /*
     *     bytes4(keccak256('uri(uint256)')) == 0x0e89341c
     */
    bytes4 private constant _INTERFACE_ID_ERC1155_METADATA_URI = 0x0e89341c;

    /**
     * @dev See {_setURI}.
     */
    constructor (string memory uri_) {
        _setURI(uri_);

        // register the supported interfaces to conform to ERC1155 via ERC165
        _registerInterface(_INTERFACE_ID_ERC1155);

        // register the supported interfaces to conform to ERC1155MetadataURI via ERC165
        _registerInterface(_INTERFACE_ID_ERC1155_METADATA_URI);
    }

    /**
     * @dev See {IERC1155MetadataURI-uri}.
     *
     * This implementation returns the same URI for *all* token types. It relies
     * on the token type ID substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * Clients calling this function must replace the `\{id\}` substring with the
     * actual token type ID.
     */
    function uri(uint256) external view virtual override returns (string memory) {
        return _uri;
    }

    /**
     * @dev See {IERC1155-balanceOf}.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
        require(account != address(0), "ERC1155: balance query for the zero address");
        return _balances[id][account];
    }

    /**
     * @dev See {IERC1155-balanceOfBatch}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(
        address[] memory accounts,
        uint256[] memory ids
    )
        public
        view
        virtual
        override
        returns (uint256[] memory)
    {
        require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");

        uint256[] memory batchBalances = new uint256[](accounts.length);

        for (uint256 i = 0; i < accounts.length; ++i) {
            batchBalances[i] = balanceOf(accounts[i], ids[i]);
        }

        return batchBalances;
    }

    /**
     * @dev See {IERC1155-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(_msgSender() != operator, "ERC1155: setting approval status for self");

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

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

    /**
     * @dev See {IERC1155-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    )
        public
        virtual
        override
    {
        require(to != address(0), "ERC1155: transfer to the zero address");
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: caller is not owner nor approved"
        );

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);

        _balances[id][from] = _balances[id][from].sub(amount, "ERC1155: insufficient balance for transfer");
        _balances[id][to] = _balances[id][to].add(amount);

        emit TransferSingle(operator, from, to, id, amount);

        _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
    }

    /**
     * @dev See {IERC1155-safeBatchTransferFrom}.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    )
        public
        virtual
        override
    {
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
        require(to != address(0), "ERC1155: transfer to the zero address");
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: transfer caller is not owner nor approved"
        );

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; ++i) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            _balances[id][from] = _balances[id][from].sub(
                amount,
                "ERC1155: insufficient balance for transfer"
            );
            _balances[id][to] = _balances[id][to].add(amount);
        }

        emit TransferBatch(operator, from, to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
    }

    /**
     * @dev Sets a new URI for all token types, by relying on the token type ID
     * substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * By this mechanism, any occurrence of the `\{id\}` substring in either the
     * URI or any of the amounts in the JSON file at said URI will be replaced by
     * clients with the token type ID.
     *
     * For example, the `https://token-cdn-domain/\{id\}.json` URI would be
     * interpreted by clients as
     * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
     * for token type ID 0x4cce0.
     *
     * See {uri}.
     *
     * Because these URIs cannot be meaningfully represented by the {URI} event,
     * this function emits no events.
     */
    function _setURI(string memory newuri) internal virtual {
        _uri = newuri;
    }

    /**
     * @dev Creates `amount` tokens of token type `id`, and assigns them to `account`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - If `account` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _mint(address account, uint256 id, uint256 amount, bytes memory data) internal virtual {
        require(account != address(0), "ERC1155: mint to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), account, _asSingletonArray(id), _asSingletonArray(amount), data);

        _balances[id][account] = _balances[id][account].add(amount);
        emit TransferSingle(operator, address(0), account, id, amount);

        _doSafeTransferAcceptanceCheck(operator, address(0), account, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        for (uint i = 0; i < ids.length; i++) {
            _balances[ids[i]][to] = amounts[i].add(_balances[ids[i]][to]);
        }

        emit TransferBatch(operator, address(0), to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
    }

    /**
     * @dev Destroys `amount` tokens of token type `id` from `account`
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens of token type `id`.
     */
    function _burn(address account, uint256 id, uint256 amount) internal virtual {
        require(account != address(0), "ERC1155: burn from the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, account, address(0), _asSingletonArray(id), _asSingletonArray(amount), "");

        _balances[id][account] = _balances[id][account].sub(
            amount,
            "ERC1155: burn amount exceeds balance"
        );

        emit TransferSingle(operator, account, address(0), id, amount);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     */
    function _burnBatch(address account, uint256[] memory ids, uint256[] memory amounts) internal virtual {
        require(account != address(0), "ERC1155: burn from the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, account, address(0), ids, amounts, "");

        for (uint i = 0; i < ids.length; i++) {
            _balances[ids[i]][account] = _balances[ids[i]][account].sub(
                amounts[i],
                "ERC1155: burn amount exceeds balance"
            );
        }

        emit TransferBatch(operator, account, address(0), ids, amounts);
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `id` and `amount` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    )
        internal
        virtual
    { }

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    )
        private
    {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                if (response != IERC1155Receiver(to).onERC1155Received.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    )
        private
    {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (bytes4 response) {
                if (response != IERC1155Receiver(to).onERC1155BatchReceived.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
        uint256[] memory array = new uint256[](1);
        array[0] = element;

        return array;
    }
}

File 15 of 22 : EnumerableSet.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.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.3.0, sets of type `bytes32` (`Bytes32Set`), `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];
    }

    // Bytes32Set

    struct Bytes32Set {
        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(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, 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(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

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

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set 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(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, 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(uint160(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(uint160(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(uint160(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(uint160(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 16 of 22 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 17 of 22 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

pragma solidity ^0.7.0;

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

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

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

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

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

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

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

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

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

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

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

File 19 of 22 : IERC1155MetadataURI.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

import "./IERC1155.sol";

/**
 * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
 * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155MetadataURI is IERC1155 {
    /**
     * @dev Returns the URI for token type `id`.
     *
     * If the `\{id\}` substring is present in the URI, it must be replaced by
     * clients with the actual token type ID.
     */
    function uri(uint256 id) external view returns (string memory);
}

File 20 of 22 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

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

/**
 * _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {

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

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

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

pragma solidity ^0.7.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.
 */
abstract 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 () {
        // 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 virtual 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 22 of 22 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.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);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"foundation_","type":"address"},{"internalType":"address","name":"governance_","type":"address"},{"internalType":"address","name":"genesisERC20_","type":"address"},{"internalType":"address","name":"gameToken_","type":"address"},{"internalType":"address","name":"feeReceiver_","type":"address"}],"stateMutability":"payable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"dutchDuration","type":"uint256"}],"name":"DutchDurationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"dutchStartPrice","type":"uint256"}],"name":"DutchStartPriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmissionCollected","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmissionUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"minimumPrice","type":"uint256"}],"name":"MinimumPriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"pricePaid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nextPrintPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nextBurnPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reserve","type":"uint256"}],"name":"TokenBought","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"priceReceived","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nextPrintPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nextBurnPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"printsSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reserve","type":"uint256"}],"name":"TokenBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"onSaleDate","type":"uint256"}],"name":"TokenData","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKENDATA_MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_tokenURIs","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"burningActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"erc20amount","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint256","name":"buyAmount","type":"uint256"}],"name":"buyNFTwithERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"pricePaid","type":"uint256"},{"internalType":"uint256","name":"buyAmount","type":"uint256"}],"name":"buyNFTwithGAME","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint256","name":"buyAmount","type":"uint256"}],"name":"buyNFTwithMatic","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"collectEmissions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deadAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dutchDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dutchStartPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"foundationAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gameToken","outputs":[{"internalType":"contract IGAME_ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"genesis","outputs":[{"internalType":"contract IGENESIS","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"buyAmount","type":"uint256"}],"name":"getBuyPrice","outputs":[{"internalType":"uint256","name":"buyPrice","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getCurrentEmissions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getMinimumPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"printNumber","type":"uint256"}],"name":"getPrintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getSellPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"governanceAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isLocalContract","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"maxBuyAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintingActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceDivisor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"saleStarts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newuri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"dutchDuration_","type":"uint256"}],"name":"setDutchDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"dutchStartPrice_","type":"uint256"}],"name":"setDutchStartPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"setFeeReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"setFoundationAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"setGenesisAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setMaxBuyAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minimumPrice_","type":"uint256"}],"name":"setMinimumPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newDivisor","type":"uint256"}],"name":"setPriceDivisor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"active","type":"bool"}],"name":"setTokenBurningActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"active","type":"bool"}],"name":"setTokenMintingActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newuri","type":"string"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"setURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"uniswapRouter_","type":"address"}],"name":"setUniswapRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sevenDays","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"systemTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"systemUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"twentyTwoDecimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"twoYears","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniswapRouter","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contract_","type":"address"},{"internalType":"bool","name":"isLocal_","type":"bool"}],"name":"updateLocalContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"onSaleDate","type":"uint256"}],"name":"updateTokenData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenid","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userEmissions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userTotals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userUpdateTimes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60806040819052600a601655681b1ae4d6e2ef5000006017819055601855610fa06019908155601a55601b80546001600160a01b03191661dead17905562004f04388190039081908339810160408190526200005b9162000434565b60408051808201909152600a8152691b9bd7dd5c9b17dcd95d60b21b6020820152806200008f6301ffc9a760e01b620001a3565b6200009a81620001fe565b620000ac636cdb3d1360e11b620001a3565b620000be6303a24d0760e21b620001a3565b508051620000d49060059060208401906200037b565b50620000eb6000620000e562000217565b6200021b565b6200010960008051602062004ee4833981519152620000e562000217565b6200012560008051602062004ee4833981519152600062000227565b506001600755600b80546001600160a01b039687166001600160a01b031991821617909155600c805495871695821695909517909455600d80549386169385169390931790925560088054918516620100000262010000600160b01b0319909216919091179055600a805491909316911617905542601355620004da565b6001600160e01b03198082161415620001d95760405162461bcd60e51b8152600401620001d090620004a3565b60405180910390fd5b6001600160e01b0319166000908152602081905260409020805460ff19166001179055565b8051620002139060039060208401906200037b565b5050565b3390565b62000213828262000279565b600082815260046020526040808220600201549051839285917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a460009182526004602052604090912060020155565b6000828152600460209081526040909120620002a09183906200261c620002f4821b17901c565b156200021357620002b062000217565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006200030b836001600160a01b03841662000314565b90505b92915050565b600062000322838362000363565b6200035a575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200030e565b5060006200030e565b60009081526001919091016020526040902054151590565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620003be57805160ff1916838001178555620003ee565b82800160010185558215620003ee579182015b82811115620003ee578251825591602001919060010190620003d1565b50620003fc92915062000400565b5090565b5b80821115620003fc576000815560010162000401565b80516001600160a01b03811681146200042f57600080fd5b919050565b600080600080600060a086880312156200044c578081fd5b620004578662000417565b9450620004676020870162000417565b9350620004776040870162000417565b9250620004876060870162000417565b9150620004976080870162000417565b90509295509295909350565b6020808252601c908201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604082015260600190565b6149fa80620004ea6000396000f3fe6080604052600436106103f95760003560e01c8063795053d311610213578063c157253d11610123578063e985e9c5116100ab578063f03be1311161007a578063f03be13114610b40578063f242432a14610b60578063f34eb0b814610b80578063f41377ca14610ba0578063fcf07c6b14610bc0576103f9565b8063e985e9c514610acb578063ec79825714610aeb578063edb05f9514610b0b578063efdcd97414610b20576103f9565b8063cd702add116100f2578063cd702add14610a41578063cf26ba0614610a61578063cfb65bed14610a81578063d547741f14610a96578063d690a8c314610ab6576103f9565b8063c157253d146109cc578063c3dfdae6146109ec578063ca15c87314610a01578063cacb5d3b14610a21576103f9565b8063a22cb465116101a6578063b3f0067411610175578063b3f0067414610944578063b642bd3914610959578063b6febd2f1461096c578063ba730e531461098c578063bea9849e146109ac576103f9565b8063a22cb465146108cf578063a7f0b3de146108ef578063ab82782c14610904578063b2861e7b14610924576103f9565b80639010d07c116101e25780639010d07c1461085a57806391d148541461087a5780639d76a1711461089a578063a217fddf146108ba576103f9565b8063795053d3146107fb5780637f386b6c146108105780638329837c1461082557806388e765ff14610845576103f9565b8063346434371161030e57806348e99985116102a1578063672a0ab511610270578063672a0ab51461078757806367db3b8f1461079c578063735de9f7146107bc578063765d6cce146107d157806378e97925146107e6576103f9565b806348e99985146107055780634e1273f41461071a57806355f804b3146107475780635958b30114610767576103f9565b806342966c68116102dd57806342966c681461069b578063432dd487146106bb578063463e0318146106d057806348cb4f4f146106f0576103f9565b8063346434371461062657806336568abe1461063b578063385c9e7d1461065b57806340bf05dc1461067b576103f9565b80631da30cab1161039157806327c8f8351161036057806327c8f8351461059a5780632cd11a1d146105bc5780632eb2c2d6146105d15780632f2ff15d146105f157806331f9c91914610611576103f9565b80631da30cab1461051a578063248a9ca31461053a57806325cea9761461055a5780632693ebf21461057a576103f9565b80630e89341c116103cd5780630e89341c146104b05780630f532953146104d057806315b6ff27146104f05780631c7c259814610505576103f9565b8062fdd58e146103fe57806301ffc9a7146104345780630bb78ec1146104615780630df300db1461048e575b600080fd5b34801561040a57600080fd5b5061041e61041936600461384f565b610bd5565b60405161042b9190613e4f565b60405180910390f35b34801561044057600080fd5b5061045461044f366004613a5a565b610c31565b60405161042b9190613e44565b34801561046d57600080fd5b5061048161047c3660046139ff565b610c54565b60405161042b9190613e58565b34801561049a57600080fd5b506104ae6104a93660046139ff565b610cef565b005b3480156104bc57600080fd5b506104816104cb3660046139ff565b610d45565b3480156104dc57600080fd5b506104ae6104eb3660046139ff565b610e6b565b3480156104fc57600080fd5b5061041e610eb6565b34801561051157600080fd5b50610454610ebc565b34801561052657600080fd5b5061041e6105353660046136c6565b610ec5565b34801561054657600080fd5b5061041e6105553660046139ff565b610ed7565b34801561056657600080fd5b506104ae6105753660046139ff565b610eec565b34801561058657600080fd5b5061041e6105953660046139ff565b610f37565b3480156105a657600080fd5b506105af610f49565b60405161042b9190613d1b565b3480156105c857600080fd5b5061041e610f58565b3480156105dd57600080fd5b506104ae6105ec366004613712565b610f60565b3480156105fd57600080fd5b506104ae61060c366004613a17565b61117a565b34801561061d57600080fd5b506104546111c2565b34801561063257600080fd5b5061041e6111d0565b34801561064757600080fd5b506104ae610656366004613a17565b6111f4565b34801561066757600080fd5b5061041e6106763660046136c6565b611236565b34801561068757600080fd5b506104ae610696366004613bce565b611248565b3480156106a757600080fd5b506104ae6106b63660046139ff565b61134a565b3480156106c757600080fd5b5061041e611538565b3480156106dc57600080fd5b5061041e6106eb3660046139ff565b61153e565b3480156106fc57600080fd5b5061041e6115e1565b34801561071157600080fd5b506104ae6115ef565b34801561072657600080fd5b5061073a610735366004613878565b6116e2565b60405161042b9190613e03565b34801561075357600080fd5b506104ae610762366004613a92565b6117ae565b34801561077357600080fd5b506104ae610782366004613819565b6111be565b34801561079357600080fd5b5061041e6117d7565b3480156107a857600080fd5b506104ae6107b7366004613acc565b6117dd565b3480156107c857600080fd5b506105af611817565b3480156107dd57600080fd5b50610454611826565b3480156107f257600080fd5b5061041e61182c565b34801561080757600080fd5b506105af611832565b34801561081c57600080fd5b5061041e611841565b34801561083157600080fd5b506104ae6108403660046139c7565b611847565b34801561085157600080fd5b5061041e611870565b34801561086657600080fd5b506105af610875366004613a39565b611876565b34801561088657600080fd5b50610454610895366004613a17565b611895565b3480156108a657600080fd5b5061041e6108b53660046139ff565b6118ad565b3480156108c657600080fd5b5061041e611915565b3480156108db57600080fd5b506104ae6108ea366004613819565b61191a565b3480156108fb57600080fd5b506105af6119e8565b34801561091057600080fd5b506104ae61091f3660046136c6565b6119f7565b34801561093057600080fd5b506104ae61093f3660046139ff565b611a2f565b34801561095057600080fd5b506105af611a94565b6104ae610967366004613b26565b611aa3565b34801561097857600080fd5b5061041e6109873660046136c6565b611c90565b34801561099857600080fd5b5061041e6109a73660046139ff565b611ca2565b3480156109b857600080fd5b506104ae6109c73660046136c6565b611cca565b3480156109d857600080fd5b5061041e6109e7366004613a39565b611d02565b3480156109f857600080fd5b506105af611d63565b348015610a0d57600080fd5b5061041e610a1c3660046139ff565b611d78565b348015610a2d57600080fd5b506104ae610a3c366004613b76565b611d8f565b348015610a4d57600080fd5b506104ae610a5c3660046139c7565b6120bc565b348015610a6d57600080fd5b506104ae610a7c366004613a39565b6120ec565b348015610a8d57600080fd5b5061041e61230b565b348015610aa257600080fd5b506104ae610ab1366004613a17565b612312565b348015610ac257600080fd5b5061041e61234c565b348015610ad757600080fd5b50610454610ae63660046136e0565b612352565b348015610af757600080fd5b5061041e610b063660046139ff565b612380565b348015610b1757600080fd5b5061041e612392565b348015610b2c57600080fd5b506104ae610b3b3660046136c6565b612398565b348015610b4c57600080fd5b5061041e610b5b3660046136c6565b6123d0565b348015610b6c57600080fd5b506104ae610b7b3660046137b7565b612426565b348015610b8c57600080fd5b506104ae610b9b3660046139ff565b6125ba565b348015610bac57600080fd5b506104ae610bbb3660046136c6565b6125d5565b348015610bcc57600080fd5b506105af61260d565b60006001600160a01b038316610c065760405162461bcd60e51b8152600401610bfd90614024565b60405180910390fd5b5060008181526001602090815260408083206001600160a01b03861684529091529020545b92915050565b6001600160e01b0319811660009081526020819052604090205460ff165b919050565b60066020908152600091825260409182902080548351601f600260001961010060018616150201909316929092049182018490048402810184019094528084529091830182828015610ce75780601f10610cbc57610100808354040283529160200191610ce7565b820191906000526020600020905b815481529060010190602001808311610cca57829003601f168201915b505050505081565b610cfc6000610895612631565b610d0557600080fd5b60188190556040517fe131e6e38a7a72a07ff49ca1c8d8fb2489e37e2945d0fe0d750e29ebeed0600d90610d3a908390613e4f565b60405180910390a150565b6000818152600660209081526040918290208054835160026001831615610100026000190190921691909104601f81018490048402820184019094528381526060938493919291830182828015610ddd5780601f10610db257610100808354040283529160200191610ddd565b820191906000526020600020905b815481529060010190602001808311610dc057829003601f168201915b505060055493945050505060026000196101006001841615020190911604610e06579050610c4f565b805115610e3857600581604051602001610e21929190613c9a565b604051602081830303815290604052915050610c4f565b6005610e4384612635565b604051602001610e54929190613c9a565b604051602081830303815290604052915050919050565b610e786000610895612631565b610e8157600080fd5b60198190556040517f47ad973defd5cfa4bb5680d7143b4f56e41628f05141138863702459c850593d90610d3a908390613e4f565b60195481565b60085460ff1681565b60116020526000908152604090205481565b60009081526004602052604090206002015490565b610ef96000610895612631565b610f0257600080fd5b60178190556040517f6fc84fd10bc65e1b9f0ebaed0289841fa091999bbee543a5d99c280141529c4290610d3a908390613e4f565b600f6020526000908152604090205481565b601b546001600160a01b031681565b6303c30ab081565b8151835114610f815760405162461bcd60e51b8152600401610bfd9061461c565b6001600160a01b038416610fa75760405162461bcd60e51b8152600401610bfd9061431e565b610faf612631565b6001600160a01b0316856001600160a01b03161480610fd55750610fd585610ae6612631565b610ff15760405162461bcd60e51b8152600401610bfd90614363565b6000610ffb612631565b905061100b81878787878761270f565b60005b845181101561110c57600085828151811061102557fe5b60200260200101519050600085838151811061103d57fe5b602002602001015190506110aa816040518060600160405280602a815260200161499b602a91396001600086815260200190815260200160002060008d6001600160a01b03166001600160a01b03168152602001908152602001600020546128ba9092919063ffffffff16565b60008381526001602090815260408083206001600160a01b038e811685529252808320939093558a16815220546110e190826128e6565b60009283526001602081815260408086206001600160a01b038d16875290915290932055500161100e565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161115c929190613e16565b60405180910390a461117281878787878761290b565b505050505050565b60008281526004602052604090206002015461119890610895612631565b6111b45760405162461bcd60e51b8152600401610bfd90613f49565b6111be8282612a19565b5050565b600854610100900460ff1681565b7fd5d5075e961870cd6ae6c021cf8fd5a63f7cffe4692fe4ff2c6c536a647a60f981565b6111fc612631565b6001600160a01b0316816001600160a01b03161461122c5760405162461bcd60e51b8152600401610bfd9061470b565b6111be8282612a82565b60126020526000908152604090205481565b6008548390610100900460ff166112715760405162461bcd60e51b8152600401610bfd906146dc565b6000818152600e6020526040902054421080159061129c57506000818152600e602052604090205415155b6112b85760405162461bcd60e51b8152600401610bfd9061419d565b60006112c2612631565b905060006112d08685611d02565b60085460405163e2b8e7d360e01b81529192506201000090046001600160a01b03169063e2b8e7d39061130b90859030908a90600401613d2f565b600060405180830381600087803b15801561132557600080fd5b505af1158015611339573d6000803e3d6000fd5b505050506111728682878588612aeb565b60085460ff1661136c5760405162461bcd60e51b8152600401610bfd90614242565b600161137f611379612631565b83610bd5565b101561139d5760405162461bcd60e51b8152600401610bfd9061444a565b60006113a882611ca2565b6000838152600f60205260409020805460001901905590506113d36113cb612631565b836001612d26565b6113db612631565b6001600160a01b03167f7f189ad2df0843ce2bba34028497b567ecb15a53dbfb381e8b7a3f1d5ca87d718383611412866001611d02565b61141b87611ca2565b6000888152600f6020526040908190205460085491516370a0823160e01b815290916201000090046001600160a01b0316906370a0823190611461903090600401613d1b565b60206040518083038186803b15801561147957600080fd5b505afa15801561148d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b19190613b0e565b6040516114c3969594939291906147dd565b60405180910390a26008546201000090046001600160a01b031663e2b8e7d3306114eb612631565b846040518463ffffffff1660e01b815260040161150a93929190613d2f565b600060405180830381600087803b15801561152457600080fd5b505af1158015611172573d6000803e3d6000fd5b60145481565b6000818152600e6020526040812054601954829061155d9083906128e6565b905042818110611574576017549350505050610c4f565b82811161159c576017546018541161158e57601754611592565b6018545b9350505050610c4f565b6019546000906115c2906115bc6115b38686612e3c565b60185490612e64565b90612e9e565b905060175481116115d5576017546115d7565b805b9695505050505050565b69021e19e0c9bab240000081565b60006115f9612631565b6001600160a01b038116600090815260126020526040902054909150611620908290612ed0565b61162b601454612f63565b6001600160a01b038082166000908152601160205260408082208054929055600d5490516310e5211b60e11b8152919216906321ca4236906116739085908590600401613dea565b600060405180830381600087803b15801561168d57600080fd5b505af11580156116a1573d6000803e3d6000fd5b505050507fcd73c83750bef60efbbd03eefd7e784d25a7824c766ccef1c5f046d614b7fb6f82826040516116d6929190613dea565b60405180910390a15050565b606081518351146117055760405162461bcd60e51b8152600401610bfd9061459c565b606083516001600160401b038111801561171e57600080fd5b50604051908082528060200260200182016040528015611748578160200160208202803683370190505b50905060005b84518110156117a65761178785828151811061176657fe5b602002602001015185838151811061177a57fe5b6020026020010151610bd5565b82828151811061179357fe5b602090810291909101015260010161174e565b509392505050565b6117bb6000610895612631565b6117c457600080fd5b80516111be906005906020840190613500565b60185481565b6117ea6000610895612631565b6117f357600080fd5b6000818152600660209081526040909120835161181292850190613500565b505050565b6009546001600160a01b031681565b60015b90565b60155481565b600c546001600160a01b031681565b60175481565b6118546000610895612631565b61185d57600080fd5b6008805460ff1916911515919091179055565b60165481565b600082815260046020526040812061188e9083613092565b9392505050565b600082815260046020526040812061188e908361309e565b6000806118c7630290d7416115bc6003860a6103e8612e64565b90506118de6118d784607d612e64565b82906128e6565b90506118ec8161c3506128e6565b905061188e67016345785d8a000061190f601a5484612e9e90919063ffffffff16565b90612e64565b600081565b816001600160a01b031661192c612631565b6001600160a01b031614156119535760405162461bcd60e51b8152600401610bfd90614553565b8060026000611960612631565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff1916921515929092179091556119a4612631565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516119dc9190613e44565b60405180910390a35050565b600d546001600160a01b031681565b611a046000610895612631565b611a0d57600080fd5b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b611a3c6000610895612631565b611a4557600080fd5b6001600052600e6020527fa7c5ba7114a813b50159add3a36832908dc83db71d0b9a24c2ad0f83be958207544210611a8f5760405162461bcd60e51b8152600401610bfd9061420b565b601a55565b600a546001600160a01b031681565b60026007541415611ac65760405162461bcd60e51b8152600401610bfd906146a5565b60026007556008548490610100900460ff16611af45760405162461bcd60e51b8152600401610bfd906146dc565b6000818152600e60205260409020544210801590611b1f57506000818152600e602052604090205415155b611b3b5760405162461bcd60e51b8152600401610bfd9061419d565b600183118015611b8857506008546201000090046001600160a01b031684846000198101818110611b6857fe5b9050602002016020810190611b7d91906136c6565b6001600160a01b0316145b611ba45760405162461bcd60e51b8152600401610bfd906142f8565b6000611bae612631565b90506000611bbc8785611d02565b600954604051637ff36ab560e01b81529192506060916001600160a01b0390911690637ff36ab5903490611bff9086908c908c903090606442019060040161475a565b6000604051808303818588803b158015611c1857600080fd5b505af1158015611c2c573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f19168201604052611c559190810190613938565b9050600081600183510381518110611c6957fe5b60200260200101519050611c80898483878a612aeb565b5050600160075550505050505050565b60106020526000908152604090205481565b6000610c2b60646115bc605f61190f600f6000888152602001908152602001600020546118ad565b611cd76000610895612631565b611ce057600080fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b6000828152600f602052604081205481611d1b8561153e565b905060015b848111611d5a576000611d348285016118ad565b9050611d4f838211611d465783611d48565b815b86906128e6565b945050600101611d20565b50505092915050565b6008546201000090046001600160a01b031681565b6000818152600460205260408120610c2b906130b3565b60026007541415611db25760405162461bcd60e51b8152600401610bfd906146a5565b60026007556008548590610100900460ff16611de05760405162461bcd60e51b8152600401610bfd906146dc565b6000818152600e60205260409020544210801590611e0b57506000818152600e602052604090205415155b611e275760405162461bcd60e51b8152600401610bfd9061419d565b600183118015611e7457506008546201000090046001600160a01b031684846000198101818110611e5457fe5b9050602002016020810190611e6991906136c6565b6001600160a01b0316145b611e905760405162461bcd60e51b8152600401610bfd906142f8565b6000611e9a612631565b90506000611ea88885611d02565b9050600086866000818110611eb957fe5b9050602002016020810190611ece91906136c6565b6040516323b872dd60e01b81529091506001600160a01b038216906323b872dd90611f0190869030908d90600401613d2f565b602060405180830381600087803b158015611f1b57600080fd5b505af1158015611f2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5391906139e3565b611f5c57600080fd5b60095460405163095ea7b360e01b81526001600160a01b038381169263095ea7b392611f9092909116908c90600401613dea565b602060405180830381600087803b158015611faa57600080fd5b505af1158015611fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fe291906139e3565b611feb57600080fd5b6009546040516338ed173960e01b81526060916001600160a01b0316906338ed173990612029908c9087908d908d903090606442019060040161479f565b600060405180830381600087803b15801561204357600080fd5b505af1158015612057573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261207f9190810190613938565b905060008160018351038151811061209357fe5b602002602001015190506120aa8b8583888b612aeb565b50506001600755505050505050505050565b6120c96000610895612631565b6120d257600080fd5b600880549115156101000261ff0019909216919091179055565b6121187fd5d5075e961870cd6ae6c021cf8fd5a63f7cffe4692fe4ff2c6c536a647a60f9610895612631565b61212157600080fd5b600082116121415760405162461bcd60e51b8152600401610bfd9061416f565b6000828152600e6020526040902054158061216a57506000828152600e60205260409020544211155b6121865760405162461bcd60e51b8152600401610bfd9061406f565b4281116121a55760405162461bcd60e51b8152600401610bfd906145e5565b816001141561221c576121bb8162093a806128e6565b60155560025b60188111612216576000818152600e602052604090205415806121f257506000818152600e60205260409020548211155b61220e5760405162461bcd60e51b8152600401610bfd90614124565b6001016121c1565b506122c8565b6001600052600e6020527fa7c5ba7114a813b50159add3a36832908dc83db71d0b9a24c2ad0f83be95820754806122655760405162461bcd60e51b8152600401610bfd906144ce565b60188311156122a6578042101561228e5760405162461bcd60e51b8152600401610bfd906143b5565b6122a36118d76224ea0061190f866018612e3c565b90505b808210156122c65760405162461bcd60e51b8152600401610bfd90613f98565b505b6000828152600e602052604090819020829055517f48a767406fb8beaddd7528779232bf4fbf9ab0bedd2f8f5adb100ab3eb82b5cc906116d69084908490614791565b62093a8081565b60008281526004602052604090206002015461233090610895612631565b61122c5760405162461bcd60e51b8152600401610bfd906142a8565b601a5481565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205460ff1690565b600e6020526000908152604090205481565b60135481565b6123a56000610895612631565b6123ae57600080fd5b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038116600090815260106020908152604080832054601290925282205442836124018483856130be565b6001600160a01b03871660009081526011602052604090205401945050505050919050565b6001600160a01b03841661244c5760405162461bcd60e51b8152600401610bfd9061431e565b612454612631565b6001600160a01b0316856001600160a01b0316148061247a575061247a85610ae6612631565b6124965760405162461bcd60e51b8152600401610bfd906140db565b60006124a0612631565b90506124c08187876124b18861317b565b6124ba8861317b565b8761270f565b612507836040518060600160405280602a815260200161499b602a913960008781526001602090815260408083206001600160a01b038d16845290915290205491906128ba565b60008581526001602090815260408083206001600160a01b038b8116855292528083209390935587168152205461253e90846128e6565b60008581526001602090815260408083206001600160a01b03808b168086529190935292819020939093559151909188811691908416907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62906125a49089908990614791565b60405180910390a46111728187878787876131bf565b6125c76000610895612631565b6125d057600080fd5b601655565b6125e26000610895612631565b6125eb57600080fd5b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b031681565b600061188e836001600160a01b038416613290565b3390565b60608161265a57506040805180820190915260018152600360fc1b6020820152610c4f565b8160005b811561267257600101600a8204915061265e565b6060816001600160401b038111801561268a57600080fd5b506040519080825280601f01601f1916602001820160405280156126b5576020820181803683370190505b50859350905060001982015b831561270657600a840660300160f81b828280600190039350815181106126e457fe5b60200101906001600160f81b031916908160001a905350600a840493506126c1565b50949350505050565b6000805b835181101561274c5761274284828151811061272b57fe5b6020026020010151836128e690919063ffffffff16565b9150600101612713565b506001600160a01b03861615801561276c57506001600160a01b03851615155b1561278c5760145461277d81612f63565b61278781836128e6565b601455505b6001600160a01b0385161580156127ab57506001600160a01b03861615155b156127cb576014546127bc81612f63565b6127c68183612e3c565b601455505b6001600160a01b038516158015906127f15750601b546001600160a01b03868116911614155b1561283e576001600160a01b0385166000908152601260205260409020546128198682612ed0565b61282381836128e6565b6001600160a01b038716600090815260126020526040902055505b6001600160a01b038616158015906128645750601b546001600160a01b03868116911614155b156128b1576001600160a01b03861660009081526012602052604090205461288c8782612ed0565b6128968183612e3c565b6001600160a01b038816600090815260126020526040902055505b50505050505050565b600081848411156128de5760405162461bcd60e51b8152600401610bfd9190613e58565b505050900390565b60008282018381101561188e5760405162461bcd60e51b8152600401610bfd906140a4565b61291d846001600160a01b03166132da565b156111725760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906129569089908990889088908890600401613d53565b602060405180830381600087803b15801561297057600080fd5b505af19250505080156129a0575060408051601f3d908101601f1916820190925261299d91810190613a76565b60015b6129e9576129ac6148ab565b806129b757506129d1565b8060405162461bcd60e51b8152600401610bfd9190613e58565b60405162461bcd60e51b8152600401610bfd90613e6b565b6001600160e01b0319811663bc197c8160e01b146128b15760405162461bcd60e51b8152600401610bfd90613f01565b6000828152600460205260409020612a31908261261c565b156111be57612a3e612631565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152600460205260409020612a9a90826132e0565b156111be57612aa7612631565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b83831015612b0b5760405162461bcd60e51b8152600401610bfd9061451e565b601654811115612b2d5760405162461bcd60e51b8152600401610bfd90613fed565b6000858152600f602052604081205460015b838111612b8557612b518260016128e6565b91506000612b5e836118ad565b9050612b7a612b7360646115bc84605f612e64565b85906128e6565b935050600101612b3f565b506000612b928684612e3c565b9050846001600160a01b03167ff70b276d07553c27d81056c897bc9c4efa6bc012c9a68e7ccd77351fd4b15a5489868a612bcd8d6001611d02565b612bd68e611ca2565b6008546040516370a0823160e01b81528a916201000090046001600160a01b0316906370a0823190612c0c903090600401613d1b565b60206040518083038186803b158015612c2457600080fd5b505afa158015612c38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c5c9190613b0e565b604051612c6f9796959493929190614805565b60405180910390a26000888152600f6020908152604080832085905580519182019052908152612ca49086908a9087906132f5565b8015612d1c57600854600a5460405163e2b8e7d360e01b8152620100009092046001600160a01b039081169263e2b8e7d392612ce99230929116908690600401613d2f565b600060405180830381600087803b158015612d0357600080fd5b505af1158015612d17573d6000803e3d6000fd5b505050505b5050505050505050565b6001600160a01b038316612d4c5760405162461bcd60e51b8152600401610bfd90614407565b6000612d56612631565b9050612d8681856000612d688761317b565b612d718761317b565b6040518060200160405280600081525061270f565b612dcd826040518060600160405280602481526020016149776024913960008681526001602090815260408083206001600160a01b038b16845290915290205491906128ba565b60008481526001602090815260408083206001600160a01b03808a16808652919093528184209490945551919291908416907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6290612e2e9088908890614791565b60405180910390a450505050565b600082821115612e5e5760405162461bcd60e51b8152600401610bfd906141d4565b50900390565b600082612e7357506000610c2b565b82820282848281612e8057fe5b041461188e5760405162461bcd60e51b8152600401610bfd9061448d565b6000808211612ebf5760405162461bcd60e51b8152600401610bfd90614271565b818381612ec857fe5b049392505050565b6001600160a01b03821660009081526010602052604081208054429182905591612efb8383866130be565b90508015612f5c576001600160a01b03851660009081526011602052604090819020805483019055517fe98389047ad8821fb8895692aa5c5126e11035b3c37b7e71f0796e38c8d8e62290612f539087908490613dea565b60405180910390a15b5050505050565b601380544291829055906000612f7a8383866130be565b90506000612fa1612f8e856224ea00612e3c565b612f9b856224ea00612e3c565b876130be565b9050811561301257600d54600b546040516310e5211b60e11b81526001600160a01b03928316926321ca423692612fdf929116908690600401613dea565b600060405180830381600087803b158015612ff957600080fd5b505af115801561300d573d6000803e3d6000fd5b505050505b8015612f5c57600d54600c546001600160a01b03918216916321ca4236911661303c846002612e9e565b6040518363ffffffff1660e01b8152600401613059929190613dea565b600060405180830381600087803b15801561307357600080fd5b505af1158015613087573d6000803e3d6000fd5b505050505050505050565b600061188e83836133d9565b600061188e836001600160a01b03841661341e565b6000610c2b82613436565b6000828414806130d057506015548311155b806130d9575081155b156130e65750600061188e565b600060155485111561310557601554613100908690612e3c565b613108565b60005b9050600061312160155486612e3c90919063ffffffff16565b9050600061314a613136846303c30ab06128e6565b6115bc69021e19e0c9bab240000086612e64565b9050600061315f613136846303c30ab06128e6565b905061316f8661190f8385612e3c565b98975050505050505050565b6040805160018082528183019092526060918291906020808301908036833701905050905082816000815181106131ae57fe5b602090810291909101015292915050565b6131d1846001600160a01b03166132da565b156111725760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061320a9089908990889088908890600401613da5565b602060405180830381600087803b15801561322457600080fd5b505af1925050508015613254575060408051601f3d908101601f1916820190925261325191810190613a76565b60015b613260576129ac6148ab565b6001600160e01b0319811663f23a6e6160e01b146128b15760405162461bcd60e51b8152600401610bfd90613f01565b600061329c838361341e565b6132d257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610c2b565b506000610c2b565b3b151590565b600061188e836001600160a01b03841661343a565b6001600160a01b03841661331b5760405162461bcd60e51b8152600401610bfd90614664565b6000613325612631565b9050613337816000876124b18861317b565b60008481526001602090815260408083206001600160a01b038916845290915290205461336490846128e6565b60008581526001602090815260408083206001600160a01b03808b16808652919093528184209490945551908416907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62906133c29089908990614791565b60405180910390a4612f5c816000878787876131bf565b815460009082106133fc5760405162461bcd60e51b8152600401610bfd90613ebf565b82600001828154811061340b57fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b5490565b600081815260018301602052604081205480156134f6578354600019808301919081019060009087908390811061346d57fe5b906000526020600020015490508087600001848154811061348a57fe5b6000918252602080832090910192909255828152600189810190925260409020908401905586548790806134ba57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610c2b565b6000915050610c2b565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061354157805160ff191683800117855561356e565b8280016001018555821561356e579182015b8281111561356e578251825591602001919060010190613553565b5061357a92915061357e565b5090565b5b8082111561357a576000815560010161357f565b80356001600160a01b0381168114610c4f57600080fd5b60008083601f8401126135bb578182fd5b5081356001600160401b038111156135d1578182fd5b60208301915083602080830285010111156135eb57600080fd5b9250929050565b600082601f830112613602578081fd5b813561361561361082614858565b614835565b81815291506020808301908481018184028601820187101561363657600080fd5b60005b8481101561365557813584529282019290820190600101613639565b505050505092915050565b600082601f830112613670578081fd5b81356001600160401b0381111561368357fe5b613696601f8201601f1916602001614835565b91508082528360208285010111156136ad57600080fd5b8060208401602084013760009082016020015292915050565b6000602082840312156136d7578081fd5b61188e82613593565b600080604083850312156136f2578081fd5b6136fb83613593565b915061370960208401613593565b90509250929050565b600080600080600060a08688031215613729578081fd5b61373286613593565b945061374060208701613593565b935060408601356001600160401b038082111561375b578283fd5b61376789838a016135f2565b9450606088013591508082111561377c578283fd5b61378889838a016135f2565b9350608088013591508082111561379d578283fd5b506137aa88828901613660565b9150509295509295909350565b600080600080600060a086880312156137ce578081fd5b6137d786613593565b94506137e560208701613593565b9350604086013592506060860135915060808601356001600160401b0381111561380d578182fd5b6137aa88828901613660565b6000806040838503121561382b578182fd5b61383483613593565b915060208301356138448161494f565b809150509250929050565b60008060408385031215613861578182fd5b61386a83613593565b946020939093013593505050565b6000806040838503121561388a578182fd5b82356001600160401b03808211156138a0578384fd5b818501915085601f8301126138b3578384fd5b81356138c161361082614858565b80828252602080830192508086018a8283870289010111156138e1578889fd5b8896505b8487101561390a576138f681613593565b8452600196909601959281019281016138e5565b509096508701359350505080821115613921578283fd5b5061392e858286016135f2565b9150509250929050565b6000602080838503121561394a578182fd5b82516001600160401b0381111561395f578283fd5b8301601f8101851361396f578283fd5b805161397d61361082614858565b8181528381019083850185840285018601891015613999578687fd5b8694505b838510156139bb57805183526001949094019391850191850161399d565b50979650505050505050565b6000602082840312156139d8578081fd5b813561188e8161494f565b6000602082840312156139f4578081fd5b815161188e8161494f565b600060208284031215613a10578081fd5b5035919050565b60008060408385031215613a29578182fd5b8235915061370960208401613593565b60008060408385031215613a4b578182fd5b50508035926020909101359150565b600060208284031215613a6b578081fd5b813561188e81614960565b600060208284031215613a87578081fd5b815161188e81614960565b600060208284031215613aa3578081fd5b81356001600160401b03811115613ab8578182fd5b613ac484828501613660565b949350505050565b60008060408385031215613ade578182fd5b82356001600160401b03811115613af3578283fd5b613aff85828601613660565b95602094909401359450505050565b600060208284031215613b1f578081fd5b5051919050565b60008060008060608587031215613b3b578182fd5b8435935060208501356001600160401b03811115613b57578283fd5b613b63878288016135aa565b9598909750949560400135949350505050565b600080600080600060808688031215613b8d578283fd5b853594506020860135935060408601356001600160401b03811115613bb0578384fd5b613bbc888289016135aa565b96999598509660600135949350505050565b600080600060608486031215613be2578081fd5b505081359360208301359350604090920135919050565b60008284526020808501945082825b85811015613c34576001600160a01b03613c2183613593565b1687529582019590820190600101613c08565b509495945050505050565b6000815180845260208085019450808401835b83811015613c3457815187529582019590820190600101613c52565b60008151808452613c86816020860160208601614875565b601f01601f19169290920160200192915050565b6000808454600180821660008114613cb95760018114613cd057613cff565b60ff198316865260028304607f1686019350613cff565b600283048886526020808720875b83811015613cf75781548a820152908501908201613cde565b505050860193505b5050508351613d12818360208801614875565b01949350505050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0386811682528516602082015260a060408201819052600090613d7f90830186613c3f565b8281036060840152613d918186613c3f565b9050828103608084015261316f8185613c6e565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613ddf90830184613c6e565b979650505050505050565b6001600160a01b03929092168252602082015260400190565b60006020825261188e6020830184613c3f565b600060408252613e296040830185613c3f565b8281036020840152613e3b8185613c3f565b95945050505050565b901515815260200190565b90815260200190565b60006020825261188e6020830184613c6e565b60208082526034908201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356040820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b606082015260800190565b60208082526022908201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604082015261647360f01b606082015260800190565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6020808252602f908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201526e0818591b5a5b881d1bc819dc985b9d608a1b606082015260800190565b60208082526035908201527f63616e27742073656c6c207468697320746f6b656e206265666f726520697473604082015274206d696e696d756d206f6e2073616c65206461746560581b606082015260800190565b60208082526019908201527f63616e277420627579206d6f7265207468616e206d6178202300000000000000604082015260600190565b6020808252602b908201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60408201526a65726f206164647265737360a81b606082015260800190565b6020808252818101527f746f6b656e2073616c65206d757374206e6f7420686176652073746172746564604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526029908201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260408201526808185c1c1c9bdd995960ba1b606082015260800190565b6020808252602b908201527f746f6b656e20312063616e277420676f206f6e2073616c65206166746572206f60408201526a7468657220746f6b656e7360a81b606082015260800190565b602080825260149082015273746f6b656e20496473207374617274206174203160601b604082015260600190565b60208082526018908201527f73616c6520686173206e6f742073746172746564207965740000000000000000604082015260600190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b6020808252601c908201527f6d757374206265666f726520666972737420746f6b656e2073616c6500000000604082015260600190565b6020808252601590820152746275726e696e67206973206e6f742061637469766560581b604082015260600190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b60208082526030908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201526f2061646d696e20746f207265766f6b6560801b606082015260800190565b6020808252600c908201526b0d2dcecc2d8d2c840e0c2e8d60a31b604082015260600190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526032908201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206040820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b606082015260800190565b60208082526032908201527f63616e277420757064617465207468697320746f6b656e20756e74696c20746f6040820152716b656e203120676f6573206f6e2073616c6560701b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526023908201527f73656e646572206d7573742068617665206174206c65617374206f6e6520746f60408201526235b2b760e91b606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b60208082526030908201527f63616e277420646566696e65207468697320746f6b656e20756e74696c20746f60408201526f1ad95b880c481a5cc81919599a5b995960821b606082015260800190565b6020808252818101527f6d75737420706179206174206c65617374207468652062617365207072696365604082015260600190565b60208082526029908201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604082015268103337b91039b2b63360b91b606082015260800190565b60208082526029908201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604082015268040dad2e6dac2e8c6d60bb1b606082015260800190565b6020808252601f908201527f73616c652064617465206d75737420626520696e207468652066757475726500604082015260600190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601590820152746d696e74696e67206973206e6f742061637469766560581b604082015260600190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201526e103937b632b9903337b91039b2b63360891b606082015260800190565b600086825260806020830152614774608083018688613bf9565b6001600160a01b0394909416604083015250606001529392505050565b918252602082015260400190565b600087825286602083015260a060408301526147bf60a083018688613bf9565b6001600160a01b039490941660608301525060800152949350505050565b958652602086019490945260408501929092526060840152608083015260a082015260c00190565b968752602087019590955260408601939093526060850191909152608084015260a083015260c082015260e00190565b6040518181016001600160401b038111828210171561485057fe5b604052919050565b60006001600160401b0382111561486b57fe5b5060209081020190565b60005b83811015614890578181015183820152602001614878565b8381111561489f576000848401525b50505050565b60e01c90565b600060443d10156148bb57611829565b600481823e6308c379a06148cf82516148a5565b146148d957611829565b6040513d600319016004823e80513d6001600160401b0381602484011181841117156149085750505050611829565b828401925082519150808211156149225750505050611829565b503d8301602082840101111561493a57505050611829565b601f01601f1916810160200160405291505090565b801515811461495d57600080fd5b50565b6001600160e01b03198116811461495d57600080fdfe455243313135353a206275726e20616d6f756e7420657863656564732062616c616e6365455243313135353a20696e73756666696369656e742062616c616e636520666f72207472616e73666572a2646970667358221220207019117d0f2bbb22bc7f64b4297c98152b84210a272c7aa6d051d514f3330b64736f6c63430007030033d5d5075e961870cd6ae6c021cf8fd5a63f7cffe4692fe4ff2c6c536a647a60f90000000000000000000000002c5ac9d8e04d98def29b0c9c3d42cd8778a64e92000000000000000000000000e2e7d16e692227bcdb45d8b9514446b08fa9f43e0000000000000000000000002057808b51daabca5d4788a5fc42aa494c055ffe0000000000000000000000000977487f39651c79b998dbf92fe52f40539e63fc0000000000000000000000002c5ac9d8e04d98def29b0c9c3d42cd8778a64e92

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.