ETH Price: $3,306.61 (+1.75%)
Gas: 3 Gwei

Token

Tunney Munney (TM)
 

Overview

Max Total Supply

5,000 TM

Holders

494

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Filtered by Token Holder
drspringles.eth
Balance
1 TM
0x6790d29E79aaF790420D7DF3aC316A6C3261d993
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
TunneyMunney

Compiler Version
v0.8.8+commit.dddeac2f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 21 : NFT.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.8;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

// Royalties: Rarible
import "./@rarible/royalties/contracts/impl/RoyaltiesV2Impl.sol";
import "./@rarible/royalties/contracts/LibPart.sol";
import "./@rarible/royalties/contracts/LibRoyaltiesV2.sol";

contract TunneyMunney is ERC721Enumerable, ReentrancyGuard, Ownable, RoyaltiesV2Impl {
    address payable private constant _ROYALTY_ADDRESS = payable(0x85b23C39D500Dc9BbDDc5a06b459FEf027f2F9d6);
    uint96 private constant _ROYALTY_PERCENTAGE_BASIS_POINTS = 400;
    uint256 private constant _MAXIMUM_SUPPLY = 5000;
    uint256 private constant _MAXIMUM_PURCHASE = 20;
    uint256 private constant _TUNNEY_MUNNEY_PRICE_PRESALE_AND_WHITELIST = 0.32 ether;
    uint256 private constant _TUNNEY_MUNNEY_PRICE_PUBLIC = 0.39 ether;
    uint256 private constant _TOTAL_PRESALE_NFT_COUNT = 2067;
    uint256 private constant _PRESALE_START_DATE = 1644588000;
    uint256 private constant _PRESALE_END_DATE = 1645160340;
    uint256 private constant _PUBLIC_START_DATE = 1645624800;
    uint256 private constant _PUBLIC_RESERVED_COUNT = 300;
    string private __baseURI = "ipfs://bafybwibxnu3vjzxxnhx2xpzfpdcajgtngw3l5ipvci7nkan2hiwjpne5ve/"; // Initialize with preview base URI

    // Wallet Address -> Token allowance mapping
    mapping(address => uint8) walletsPresale;

    // Wallet Address -> Boolean mappings
    mapping(address => bool) walletsPriceExempt;

    bytes4 private constant _INTERFACE_TO_ERC2981 = 0x2a55205a;
    using Counters for Counters.Counter;
    Counters.Counter private _tokenIdTracker;
    Counters.Counter private _presaleNFTsMinted;

    uint256 private _revealed = 0;

    constructor() ERC721("Tunney Munney", "TM") {
        // Start counter at 1
        _tokenIdTracker.increment();

        // Populate privileged wallets
        walletsPresale[0xc3f17178311899B068d0E2C86253E087DAB5ba8f] = 10;
        walletsPresale[0x92178Cdcf11E9f77F378503D05415D8BEb9E7bcF] = 10;
        walletsPresale[0x10a3d8178EE389208cBc5A5AaD05aA928a575C94] = 10;
        walletsPresale[0x659797d648C27c052aD95CBf7F8631f2FAD143c2] = 10;
        walletsPresale[0xb99426903d812A09b8DE7DF6708c70F97D3dD0aE] = 20;
        walletsPresale[0x810505953e7DB74b4d242773D797Ce15C68e0562] = 10;
        walletsPresale[0x08BB2f68B3A799337B14DE0f28E6E04f5DeF18a1] = 10;
        walletsPresale[0x65F65D1001dA3BAA411c5f5Fa4890713cE8f7F1D] = 10;
        walletsPresale[0x1010595F96Ab62b31BfeAc411Ec5f8f60DB5DC23] = 10;
        walletsPresale[0xA494876207Ae80D8669Dd347Fe11Fadae31c48E7] = 10;
        walletsPresale[0xe5d009bbcE5a5D7ab9c6c2B1b0A56F9B98297Cff] = 10;
        walletsPresale[0x740C569F20076F1D96be1222240d55A5eED29Df5] = 10;
        walletsPresale[0x88D78534Ccc1CA50070272E095788F9f35aD42Ba] = 10;
        walletsPresale[0x9d9B1A7be1CBA854bC4656Daa56A784b0ff056EC] = 5;
        walletsPresale[0x1fe1d8C07386d9605B548B575Fd16F3E9C5B8624] = 10;
        walletsPresale[0x60CED65A51922C9560d72631F658Db0df85BFf1f] = 10;
        walletsPresale[0x125e41f52D62464B3B57AAA2F24d7952359BAabC] = 10;
        walletsPresale[0x2931E2037376875555c0c247C66727fcA7F2648e] = 5;
        walletsPresale[0xbAfc553548242F0487a5370c54aB3048E826e514] = 5;
        walletsPresale[0xA41A4b84D74E085bd463386d55c3b6dDe6aa2759] = 10;
        walletsPresale[0xa3139f46A92cac9e5c445c5574BD10D522781037] = 10;
        walletsPresale[0x166EB9317E2540DFB7841a48a31Ba2eca5D4A9CF] = 20;
        walletsPresale[0x69E5eA08a0b708dE81906DB05B3F80644acE8D3f] = 10;
        walletsPresale[0xDd1F61E95CA9ec479de81f869921eD191DfeeBA8] = 10;
        walletsPresale[0xBcaa247d4E6678BC9D42114186c8e2dfC6b6c1bD] = 10;
        walletsPresale[0xfDc319B1327DE28C82BB283610dAFcF736a6D229] = 20;
        walletsPresale[0x0d74759D78B3A25E3c537FC3116D6f20Eb1C6dE6] = 10;
        walletsPresale[0xef30776Cd1A6cF63Acf9F72C7BF47Bd6272Ec4F9] = 10;
        walletsPresale[0x282F9b62a7Efe70eE66FF45578D22a72A3e18e01] = 10;
        walletsPresale[0x5Db6f7C9Ef71069216a176bbE6dF7f02D0fbDEfb] = 10;
        walletsPresale[0x48A75020408740589a9Fe6f7341c1B3c32d11AB8] = 10;
        walletsPresale[0xa269d981A584f6e122c4067Dfb1aA12AB1f2b38D] = 20;
        walletsPresale[0xe59E3d516f52c2E393F27232D163E51fcdA1cFe5] = 10;
        walletsPresale[0x67cf9c01afFEfaB6F99b706096bC36037f8D57c2] = 10;
        walletsPresale[0x221320D34800760E06B206aCd01e626e463eB03E] = 10;
        walletsPresale[0xc3A51fFd872d38737973EE0bbA6ffc14502a4ced] = 10;
        walletsPresale[0x7ca42F73F80C285bbE93d72f6DdEf00798e304D9] = 10;
        walletsPresale[0x44b1f231D743B9b73AaD305Fe307ce6f099c9AB4] = 10;
        walletsPresale[0xFd61F8599431ebff62DC81eFc571C1FBCb908DCF] = 10;
        walletsPresale[0xcBA88D0E47673352BdBe3Ce9788DF97bAfdC7DDE] = 10;
        walletsPresale[0x5583734DCAFc257581cc3a089C29C68aB440Da58] = 10;
        walletsPresale[0x2054B81AEd12840A17EA1fc66D233ba5B921b77d] = 1;
        walletsPresale[0xEA2761F45d274E4e314cF0Aa1A3304fD1fa69e68] = 20;
        walletsPresale[0xf1FE82F8ba582a7c3e10473C0F964C61A165CE08] = 10;
        walletsPresale[0x5Cb58a3fA9B02ae11f443b3Adc231172356EcCd7] = 10;
        walletsPresale[0x04513dc3DcdEA1A570EDe00273889F12a3f91589] = 10;
        walletsPresale[0x11b0B2DB7F2A85A8FD52917f586A278A1dBa3747] = 10;
        walletsPresale[0x7a8448C623DFD441C9B725bFAB8a002DaC25Dc75] = 10;
        walletsPresale[0x37CD8223Da1Be068Ab6BD9dE805431999EE89871] = 10;
        walletsPresale[0x49ca963Ef75BCEBa8E4A5F4cEAB5Fd326beF6123] = 10;
        walletsPresale[0x0851CeD43aab7Bc38b0fA4fBc4e3849634d2cA67] = 10;
        walletsPresale[0xAD35cAE6192acC0000b3cD2E07CF5108AF9fD015] = 10;
        walletsPresale[0x17410AC8E1e7C0296d3d1EE82C2bcE9Cf5250a5c] = 10;
        walletsPresale[0xA6EBe8639FCb0235dE905212c7ef0E2E8bb92989] = 10;
        walletsPresale[0xC914646a35786335D1226281D49edbf2d5d10485] = 10;
        walletsPresale[0x2002480606e08351B75682866642e947BD8C6bcf] = 10;
        walletsPresale[0x1adF685E4714f7c516b7bC813b3148e68bd8095c] = 20;
        walletsPresale[0x042EBfe134790c0f4e8A3699797Ac2D0833755B7] = 20;
        walletsPresale[0xB009aD5322412730E909CFC27B33c410C2B3D2Aa] = 10;
        walletsPresale[0xeF5AFBa8ec7258F96Fd7794717747AB4edD7605D] = 20;
        walletsPresale[0x0989A2A165fd66E4c64510328A1A6A9809Ef9418] = 10;
        walletsPresale[0x3EBCcC002Ff8aED4e982F0011fC2090799F844e0] = 10;
        walletsPresale[0xf2C8797A4815002f62007BB43a5462Aeb6c0b7b9] = 20;
        walletsPresale[0x070B0700bc42F080b970A58e592bCfb0357d11Fb] = 100;
        walletsPresale[0x61c3476D99E6fa4b66c5D7d46738e0EF6049C844] = 10;
        walletsPresale[0xA3f1b25bD254A0fb0CAA6c1a784a120da49F99EC] = 5;
        walletsPresale[0x4E05Bc165652140654e0F07b7cB429E5E1B0ed92] = 10;
        walletsPresale[0xB9E651ab75e2CE8a292F60a37d258F8BbcFF4368] = 20;
        walletsPresale[0x0a159aE5b783545D328d7799D523961D5Cc47eA0] = 10;
        walletsPresale[0xB5696E4057B9BA76616cEcB5A537eAcA7B3CDf54] = 10;
        walletsPresale[0xF349CC68cF9820247E3f7465fDaD807b6FbCA3CD] = 10;
        walletsPresale[0x993a69EFE73e3f87df4276E40E81E426385Fd2D8] = 10;
        walletsPresale[0x46aB683c6D4f42666826Bf6D6Da1C131B71318d8] = 10;
        walletsPresale[0xB8e52606BDa86d031f7c8E2D73C95cD020002F03] = 10;
        walletsPresale[0x5F4C5ef5Be53Db7631d5257348BBcD354159269A] = 10;
        walletsPresale[0xa4c36e63cAa42cAE77f7A8f72b9f4dD7f5740a05] = 10;
        walletsPresale[0x80f176A4009d91bAdA3ace15692418990Be8B0a7] = 10;
        walletsPresale[0xfBA32e383CF23992249ac0E5B113bc4d092bb668] = 10;
        walletsPresale[0x11C331c574C4F6a97B596fDf17266EBB7f0aCb91] = 20;
        walletsPresale[0xb5771A5cBE3fbf377c4969D58fcec943C898a905] = 10;
        walletsPresale[0x3AFe0eb50CFd574E260ea1f99dBBCA4FFB384E0e] = 10;
        walletsPresale[0x180c7F25A4DBA3310cC3746619256d1EDA5a4F5A] = 10;
        walletsPresale[0xA883B60C5EaD0EFD604b41a7C0509c3c6b81739e] = 10;
        walletsPresale[0x54296Fe0C5eB70bA5D893e744733ebB9846ece72] = 10;
        walletsPresale[0x0277278833e8A40197dF5D54fC425D123b0dc6D1] = 10;
        walletsPresale[0x572Ec7691b6aE768fD71098bf815785A7BAE6480] = 5;
        walletsPresale[0xA75323816443d49a1142f4E8d84F579bBc1B06fE] = 20;
        walletsPresale[0xa802d76BBc1adEB3aF9F8a73114856D39D52b4f9] = 10;
        walletsPresale[0x91F1d086B83584b5da60eC8c426c8f7b1023F42D] = 10;
        walletsPresale[0x12331ABA9762b52b69109a06B84F6404B75BB478] = 10;
        walletsPresale[0xe51BA9BE3751eff989e53e9d234915db2dFFFAb6] = 10;
        walletsPresale[0xcEB0eF1bA3F3A543ea13cD6953A1c5978C5BFD14] = 10;
        walletsPresale[0xFd61F8599431ebff62DC81eFc571C1FBCb908DCF] = 10;
        walletsPresale[0x3F1A421b47c5a9ec1025475a3Fd3e99cE20616A2] = 10;
        walletsPresale[0xF80CD8714d092771e6D95DB5ba7Cc5ae960948Dd] = 20;
        walletsPresale[0x2C79A929a7b6dBaC83bE6690F69737D873c58941] = 20;
        walletsPresale[0x3C2175a86eaffac2Ea609Ab4db6aB8e27Ff56Db2] = 10;
        walletsPresale[0x363e89408093719f67b7a674B74006989442116A] = 10;
        walletsPresale[0x5C27b3a3D46D8728f0eeEB9342F50AA13A27ff5f] = 10;
        walletsPresale[0x8097222c73362cD7F9f313aA720bB85A0FCA3C3c] = 10;
        walletsPresale[0x1e8eAA773F43844813F0842E15ac9B1fd40A2d92] = 10;
        walletsPresale[0xA98220f6dC5DFcA27ff19605a0a6D3E1dDE4CFE8] = 10;
        walletsPresale[0x9B7d8DbD54e5aeBbEDdb1722C9aB8956Bc2003A5] = 10;
        walletsPresale[0x19F87442CC618751406fFC37cc1A0e6111071030] = 20;
        walletsPresale[0x16faDFebD498813B63fBcd399571fbf1Cfa86550] = 10;
        walletsPresale[0x07cd101a8cd329a170d3A762d9d1645A2adB7f7A] = 10;
        walletsPresale[0x32d29de590eC186eC5B28710E7659D5Fb18419C0] = 10;
        walletsPresale[0x838d673258CEAb8E78c31a6088227DAc593B2d72] = 10;
        walletsPresale[0x18A0e52AD9d827E7BCb456f70888B45854dCf099] = 20;
        walletsPresale[0xbca572D1928b34Cf2e86b32295Cd27ff71A554Bf] = 10;
        walletsPresale[0x02aEB12821C2c18A61373B1931dE24b0c4f2e7f0] = 10;
        walletsPresale[0xc8d5E6d8da7792006D75BEE8856Af73037e20291] = 10;
        walletsPresale[0xAf2F83b3C5086BFa613A00f1637a920b50230e27] = 20;
        walletsPresale[0x056F154C822cB374508Cd318038C3d1e1230c377] = 10;
        walletsPresale[0x23CAF6c7BA9C315569Dba9A0B33265c58eEF020D] = 1;
        walletsPresale[0x85b23C39D500Dc9BbDDc5a06b459FEf027f2F9d6] = 25;
        walletsPresale[0x672E5F3D8f007826C64Fce3644938f596fB521E1] = 10;
        walletsPresale[0x2d15e7F2061eBdf16B37c62Df4ae2d3550a1617F] = 1;
        walletsPresale[0x3599564B917588C2a42C365B306dFDF6c34BBb55] = 10;
        walletsPresale[0x67644b68B24505c37EEc4Ed070C7fd78Aa560777] = 30;
        walletsPresale[0x4bd8FA4995a6C6CDe085e044cd09194Dc8CF533f] = 40;
        walletsPresale[0xFC5446EfE679f109f2772e45EA623CaA63791d5e] = 10;
        walletsPresale[0x091B9eC195247d5226cFC23D4d2F919B053B07c1] = 10;
        walletsPresale[0x195d76F290E660D56e25515a982C77EE4aaE7Ed1] = 10;
        walletsPresale[0x0925af5b3A31B6458357E8B01804B0a598c55bdD] = 20;
        walletsPresale[0x23Adbac7540eb3E7ab100FAb282fe006d5D72073] = 16;
        walletsPresale[0x7894c47148642C4396D9CE2929d8603Fb48Ad22A] = 10;
        walletsPresale[0xE3e97ede6F9995331A665687509be4Ecc5292cf4] = 10;
        walletsPresale[0xb8e01f384E385A6E1F0f37d0BE3aB39945A09F43] = 10;
        walletsPresale[0x73f7Ad858ae331C91BFDF9BBAE5E1b8A13f802b3] = 10;
        walletsPresale[0xc96722455ce56F676D4aD9343b3631d1fB4FD621] = 20;
        walletsPresale[0x180EE781e84A4f554562d1CC2ea677c6e8776302] = 2;
        walletsPresale[0xeE9F2A814b3e27dF5044b771973C7a7589478580] = 10;
        walletsPresale[0xCecE436D727DC4De835D8a0f2e930c7D29C556fD] = 20;
        walletsPresale[0x3A7b011311581e1D7FC5c97c558726aabB598aEE] = 30;
        walletsPresale[0x559de301EffC4338b2805f79B4e815F387332d23] = 10;
        walletsPresale[0xD2cc3E17c813e24C8a66e3CA2DeA7125EF64BFBE] = 20;
        walletsPresale[0x3F3c1471889604dE57ea3f17548014CeEB29Ce82] = 20;
        walletsPresale[0xE9581fb58eB6fdcBD45fcBA793149bAb6B0e0c4B] = 10;
        walletsPresale[0x4D2C5853F18eA553CF5716a9AF95bCD7f4095cc5] = 10;
        walletsPresale[0xa03d58D41b8978fF2F1DCA861faf0DC842E25F72] = 20;
        walletsPresale[0xB91105F277a6b5046Cf5faf3e8033eA31D4A0023] = 20;
        walletsPresale[0x7F3535b21F9747076d0f4a4d7C8328505ACC7A69] = 30;
        walletsPresale[0x4B4C57286a90e5DdB08a4Cb826F8209a0B15E677] = 50;
        walletsPresale[0x0C64D5DA9CBc8bbeE994166FF8dd47809DF0002b] = 5;
        walletsPresale[0xc436292c46E642185d96A570108C369f0F1a4Ccf] = 10;
        walletsPresale[0x28512542eB68f758fF60D68DB0fd00c0918D0C4a] = 10;
        walletsPresale[0x366036DB07c04A3fE224909E6067730DB491b3f9] = 10;
        walletsPresale[0xA38500bc712Ff5C52B146CdA22fF625d766C7D2F] = 10;
        walletsPresale[0x9c090D8EdABAF6ef7D77632a16d1Db67ae5d4DE4] = 10;
        walletsPresale[0x2Ba11189F73757319460967f569C5F1Ca5e44E8E] = 10;
        walletsPresale[0x9a1C13dcE181087d7C03A12E4CBE8A2a62312420] = 30;
        walletsPresale[0x6f67d99EE4CaA0056A3cd80F5b0019BF305aE706] = 10;
        walletsPresale[0x3f3599943d83Dd5C241Fb767A526b260fc2D62Ee] = 20;
        walletsPresale[0xa240eAdb80C2Cc19731Ad62EF856d6d225d6c7B8] = 10;
        walletsPresale[0x6Cd064f3c9028Af67eDdc24dd936c9f3FAeF963C] = 10;
        walletsPresale[0x91bf1E0Bc322450142383B88e515C3D798102377] = 20;
        walletsPresale[0xAA3d165d24C159F04EaBedE92e263E1840E4a5b8] = 10;
        walletsPresale[0xbA726320a6D963b3a9E7E3685fb12AEA71Af3f6d] = 10;
        
        walletsPriceExempt[0x1F1Fd08ED5f3dBC2158D96Cd5eC063A7A5AeBc67] = true;
        
    }

    function reveal() public onlyOwner {
        if (_revealed == 0) {
            _revealed = 1;
        }
    }

    function setBaseURI(string memory newBaseURI) public onlyOwner {
        require(_revealed == 0, "Cannot call setBaseURI() after Tunney Munney has been revealed."); // Must not be revealed yet
       __baseURI = newBaseURI;
    }

    function withdraw() public onlyOwner {
        // uint256 balance = address(this).balance;
        // payable(msg.sender).transfer(balance);
        payable(msg.sender).transfer(address(this).balance);
    }

    function addPresaleWallet(address purchaser, uint8 tokenAllotment) public onlyOwner {
        walletsPresale[purchaser] = tokenAllotment;
    }

    function totalMinted() public view returns (uint256) {
        return _tokenIdTracker.current() - 1;
    }

    function calculateCost(address purchaser, uint256 numberOfTokensToMint) public view returns (uint256) {
        if (walletsPriceExempt[purchaser]) return 0;

        uint256 calculatedCost = 0;

        // Do not mutate walletPresale[msg.sender] until token is actually minted
        uint256 walletPresaleAllowance = walletsPresale[purchaser];

        while (numberOfTokensToMint > 0) {
            if (walletPresaleAllowance > 0) {
                walletPresaleAllowance = walletPresaleAllowance - 1;
            } else {
                if (block.timestamp < _PUBLIC_START_DATE) {
                    calculatedCost = calculatedCost + _TUNNEY_MUNNEY_PRICE_PRESALE_AND_WHITELIST;
                } else {
                    calculatedCost = calculatedCost + _TUNNEY_MUNNEY_PRICE_PUBLIC;
                }
            }

            numberOfTokensToMint = numberOfTokensToMint - 1;
        }

        return calculatedCost;
    }

    function mint(uint256 numberOfTokensToMint) public payable nonReentrant {
        require(block.timestamp > _PRESALE_START_DATE, "Minting hasn't started yet.");
        if (block.timestamp < _PRESALE_END_DATE) {
            require(numberOfTokensToMint <= walletsPresale[msg.sender], "Minting is active for presale collectors only. Please wait for whitelist or public minting to begin.");
        }

        require(numberOfTokensToMint <= _MAXIMUM_PURCHASE, "You can only mint 20 Tunney Munney at a time.");

        uint totalMintedTokens = totalMinted();
        uint numberOfTokensToMintNotInPresale = numberOfTokensToMint - Math.min(walletsPresale[msg.sender], numberOfTokensToMint);
        uint unmintedPresaleTokensReserved = _TOTAL_PRESALE_NFT_COUNT - _presaleNFTsMinted.current();

        require(totalMintedTokens + numberOfTokensToMint <= _MAXIMUM_SUPPLY, "Purchase exceeds available supply of Tunney Munney.");
        require(totalMintedTokens + numberOfTokensToMintNotInPresale + unmintedPresaleTokensReserved <= _MAXIMUM_SUPPLY, "Purchase exceeds available supply of Tunney Munney as there are un-minted NFTs reserved as part of the pre-sale.");
        require(calculateCost(msg.sender, numberOfTokensToMint) <= msg.value, "Amount of ether sent for purchase is incorrect.");

        // If before public mint date, reserve some tokens
        if (block.timestamp < _PUBLIC_START_DATE) {
            require(totalMintedTokens + unmintedPresaleTokensReserved + numberOfTokensToMintNotInPresale + _PUBLIC_RESERVED_COUNT <= _MAXIMUM_SUPPLY, "The remaining tokens have been reserved for the pre-sale collectors and the public mint.");
        }

        for (uint256 i = 0; i < numberOfTokensToMint; i++) {
            // If this was a walletPresale mint, subtract one from allowance.
            if (walletsPresale[msg.sender] > 0) {
                walletsPresale[msg.sender] = walletsPresale[msg.sender] - 1;
                _presaleNFTsMinted.increment();
            }

            _tokenIdTracker.increment();
            _safeMint(msg.sender, _tokenIdTracker.current() - 1);
        }
    }

    // Royalties Implementation: Rarible
    //    function setRoyalties(uint256 _tokenId) public onlyOwner {
    //        LibPart.Part[] memory _royalties = new LibPart.Part[](1);
    //        _royalties[0].value = _ROYALTY_PERCENTAGE_BASIS_POINTS;
    //        _royalties[0].account = _ROYALTY_ADDRESS;
    //        _saveRoyalties(_tokenId, _royalties);
    //    }

    // Royalties Implementation: ERC2981
    function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount) {
        if (_exists(_tokenId)) {
            return (_ROYALTY_ADDRESS, _salePrice * _ROYALTY_PERCENTAGE_BASIS_POINTS / 10000);
        } else {
            return (_ROYALTY_ADDRESS, 0);
        }
    }

    // OpenSea Contract-level metadata implementation (https://docs.opensea.io/docs/contract-level-metadata)
    function contractURI() public view returns (string memory) {
        return string(abi.encodePacked(__baseURI, "contract"));
    }

    // Supports Interface Override
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable) returns (bool) {
        // Rarible Royalties Interface
        if (interfaceId == LibRoyaltiesV2._INTERFACE_ID_ROYALTIES) {
            return true;
        }

        // ERC2981 Royalty Standard
        if (interfaceId == _INTERFACE_TO_ERC2981) {
            return true;
        }

        return super.supportsInterface(interfaceId);
    }

    function _baseURI() internal view virtual override returns (string memory) {
        return __baseURI;
    }
}

File 2 of 21 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

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

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

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

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            super.supportsInterface(interfaceId);
    }

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

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

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

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

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

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overriden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

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

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

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

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

        _balances[to] += 1;
        _owners[tokenId] = to;

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

        _afterTokenTransfer(address(0), to, tokenId);
    }

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

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

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

        _balances[owner] -= 1;
        delete _owners[tokenId];

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

        _afterTokenTransfer(owner, address(0), tokenId);
    }

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

        _beforeTokenTransfer(from, to, tokenId);

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

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

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

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

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}

File 3 of 21 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../ERC721.sol";
import "./IERC721Enumerable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
        return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _allTokens.length;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

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

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

File 5 of 21 : Counters.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

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

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 6 of 21 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a / b + (a % b == 0 ? 0 : 1);
    }
}

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

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

pragma solidity ^0.8.6;
pragma abicoder v2;

import "./AbstractRoyalties.sol";
import "../RoyaltiesV2.sol";

contract RoyaltiesV2Impl is AbstractRoyalties, RoyaltiesV2 {

    function getRaribleV2Royalties(uint256 id) override external view returns (LibPart.Part[] memory) {
        return royalties[id];
    }

    function _onRoyaltiesSet(uint256 id, LibPart.Part[] memory _royalties) override internal {
        emit RoyaltiesSet(id, _royalties);
    }
}

File 9 of 21 : LibPart.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.6;

library LibPart {
    bytes32 public constant TYPE_HASH = keccak256("Part(address account,uint96 value)");

    struct Part {
        address payable account;
        uint96 value;
    }

    function hash(Part memory part) internal pure returns (bytes32) {
        return keccak256(abi.encode(TYPE_HASH, part.account, part.value));
    }
}

File 10 of 21 : LibRoyaltiesV2.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.6;

library LibRoyaltiesV2 {
    /*
     * bytes4(keccak256('getRaribleV2Royalties(uint256)')) == 0xcad96cca
     */
    bytes4 constant _INTERFACE_ID_ROYALTIES = 0xcad96cca;
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

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

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

File 14 of 21 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 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");

        (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");

        (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");

        (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");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal 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);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

File 19 of 21 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

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

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

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

pragma solidity ^0.8.6;

import "../LibPart.sol";

abstract contract AbstractRoyalties {
    mapping (uint256 => LibPart.Part[]) internal royalties;

    function _saveRoyalties(uint256 id, LibPart.Part[] memory _royalties) internal {
        uint256 totalValue;
        for (uint i = 0; i < _royalties.length; i++) {
            require(_royalties[i].account != address(0x0), "Recipient should be present");
            require(_royalties[i].value != 0, "Royalty value should be positive");
            totalValue += _royalties[i].value;
            royalties[id].push(_royalties[i]);
        }
        require(totalValue < 10000, "Royalty total value should be < 10000");
        _onRoyaltiesSet(id, _royalties);
    }

    function _updateAccount(uint256 _id, address _from, address _to) internal {
        uint length = royalties[_id].length;
        for(uint i = 0; i < length; i++) {
            if (royalties[_id][i].account == _from) {
                royalties[_id][i].account = payable(address(uint160(_to))); // Wrap address and make it payable
            }
        }
    }

    function _onRoyaltiesSet(uint256 id, LibPart.Part[] memory _royalties) virtual internal;
}

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

pragma solidity ^0.8.6;
pragma abicoder v2;

import "./LibPart.sol";

interface RoyaltiesV2 {
    event RoyaltiesSet(uint256 tokenId, LibPart.Part[] royalties);

    function getRaribleV2Royalties(uint256 id) external view returns (LibPart.Part[] memory);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","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":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"uint96","name":"value","type":"uint96"}],"indexed":false,"internalType":"struct LibPart.Part[]","name":"royalties","type":"tuple[]"}],"name":"RoyaltiesSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"purchaser","type":"address"},{"internalType":"uint8","name":"tokenAllotment","type":"uint8"}],"name":"addPresaleWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"purchaser","type":"address"},{"internalType":"uint256","name":"numberOfTokensToMint","type":"uint256"}],"name":"calculateCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getRaribleV2Royalties","outputs":[{"components":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"uint96","name":"value","type":"uint96"}],"internalType":"struct LibPart.Part[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"numberOfTokensToMint","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","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":"newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

61010060405260436080818152906200446360a03980516200002a91600d9160209091019062001aea565b5060006012553480156200003d57600080fd5b50604080518082018252600d81526c54756e6e6579204d756e6e657960981b602080830191825283518085019094526002845261544d60f01b9084015281519192916200008d9160009162001aea565b508051620000a390600190602084019062001aea565b50506001600a5550620000b63362001a8f565b620000cd601062001ae160201b620015a41760201c565b7fd222771c397492758f5e8711270184c279276a197a3a2b2079198ac9ab330af4805460ff19908116600a9081179092557f3e92c873165f74fc1aa1991646f0b832d9fb064aa07f5307011288a7e14f0d7b80548216831790557f759f3a47f3a570168b04c4410a8dd770bc52bfa9bfe7f5f70d938862587d2dd180548216831790557f9f9e07c5c46e13aff8a2362bdf09a26447e04a3d2cdeed2b019e8cec8f9aeb4c80548216831790557fb8d29cfc055e7d33fe25f8bf62e34e241e496e218ce91fe2d5a481868188b73f8054821660149081179091557f8ee8d297df727cbd883d24a5af2057b4c818e069febdeb7d971a00f38d91438f80548316841790557f73b00ce36b5a669da4d45c951755552a7b4205b50b9fa4505b6406424f16425880548316841790557fa2ebba081ed990493a0e9610833977efc4ea798e9bdb7f3b13344c523814543a80548316841790557f1acb6722026240bf4426c475ac0314ac223afb9c1719c96b432226e8f5a0a20880548316841790557f379f6585de5da07aadd9803f83dc6452dc17d7cc586bef4ae3d2b9478002e3a880548316841790557f18806671122fa16d7e38165447bb475d070549206ff32e29e47252c281aac92a80548316841790557f55f60513112236ff875a04e9ab82b89a861f1bce1b84f97788c86409f0d2e20380548316841790557fb8992fc207be24d979c9d89db44e55f136c791824da4f293cd0c4a7d83e0fb3280548316841790557f61d5f15dbc08b2717144ac02370e58553b505d6bb3e7b0511d44f99a41c8f0ba8054831660059081179091557f04a59486103ebad1c455ab44ce9c469ee92384646b2d211927695e57596d4e2a80548416851790557fb4c9cf153d59396f2aeaef1f57a122f1caab884a4877179ad3e201d2c27e38dd80548416851790557fa2f8cf3b74ec245a1996b7c7eb783607502d97689536a4cfcf993cba4a249e7e80548416851790557f0a5be5a7127c8bf2ad5bc6a7ae4cf22f457e3de4cb52d0dfac535abdb391453180548416821790557ff46f3d23c1ab91a3b08b07fa172caca492dcc57eb8e8c2245067786d16446bfa80548416821790557f0d96a0fa807ca327454f3725b853cb633ef7926bd05a2a0872f358993687101a80548416851790557f1287bb1b47195423c9ab56fb8c53e48f9dde75098a9362c6db7bb7c23e66d4c580548416851790557fbf589e1bf5e8d69e8bd38e87f60f7fc6d669ccd6c595c65ba9ec4d85aa0e0f5280548416831790557ff97dcf0f3db834a74875711cfe81fcbacebb4c08140904bbd0fe26a5ca2038f080548416851790557f9f21fef1f7def832e4b6cf4f163bd6a0355561e1ff83f786ffcf5599e243b46280548416851790557f8d556e164c4c4b99b5817cec6c32c78dfa0a2af2b61e15b87a72afa74a18dd4780548416851790557fa15148fdfecb9921a6ae68902319ee960eab888395563982df4fa1e00ce35ed880548416831790557ffda39c4b1becbf9291822b17306eacd699032fda1ff51b4dd3108449eec3702a80548416851790557f3b268183c86a0faaab3a870329f034e83857c9960dab38523717ee2cab96bfde80548416851790557fa3009ad170375354a4d19bc2d9c3d5f6cf88881851ae43c3c8a12ca1c0c3e1a480548416851790557fddc99d00bf7782f506e6b94e3f019edfa0467eff558d99cdf28344c8f8917fd080548416851790557f346753f3bbc0f0e6d70e90888a2d6229aaf7cbd1bb53c04516c65ee1e7b8c3f380548416851790557ffd261a7d185c15d07ef3625073a5b1a231ec48afd6fff8dd6861897632f5388380548416831790557f54975a515fc8b39d8a5e0a1aab761e91d639bb0caceee7f551b97ba02da1787480548416851790557fa78043da5b93939378ff8e623856025c44c539146847668b828b5485c8d49b0780548416851790557fe347093130adcb34358f3000c6fffd6c2d039e9a6b8e8d68c52f09c82be0859d80548416851790557f2c571244d07ba61eeb20f1a94024d962b0400ebe570a94b3f83a4589d3ed873480548416851790557f75704936ef56a8f15ea4aedb6b13416aa0882d1c44d984d86bf735ea26a7d7d380548416851790557f8b3440e2ffac128863a3f26afce734b76c6d5d98a544956ec6ecc981e404acbe80548416851790557fe98dcc50aaf43c892092f611e0a492ad0f23c796fa09f0abffc8d75981be0cbc80548416851790557fdd9a4b99bb68b9eb59a5bc1a196227ed2399da2a919a083205c3bf8b8972c14880548416851790557f0d319495ca1258861827742ae1f8c0ba07b9d41472b92aff9faa03deb988056180548416851790557fc0f02874f3986a6cbabb930bc6911175252c2fcebab8b7d88c10738f92a1bc3b8054841660019081179091557fa14fa89b01fadcb634d373906d73fea6369912fffbe4ca7e363c0cef5b32d11780548516841790557faef4403ef9fc3270a2c8548983157f29f853acea805819aa9d5009151c60e09580548516861790557f69a4c27399f5f6c23ad8fae0d8d9ec5e1c010fff5024c724a8ed246e8bfad06480548516861790557fd22b3b7592f74e0b878c67893e58fe1a58717898590456f628f4dc232c0d8e8780548516861790557f6b55d373694aff6a4c1e47e09ba9145a49a04d63d69edfe5f8f16d515233bb4c80548516861790557f65b69f25b9780a5f6fe87e5a51ceafca33062fbe7d065afcb06f67808932939180548516861790557ffb9c4ba54d8af2fcfddbb775623248bd8e990e53de3dc0e126f0ac0532d0eb4680548516861790557f9959f695ae52838b4f03add6264b894669fc0b4f38fe3237eb5ab8b6aaedb49080548516861790557fe74ab455804bc32eb9de4f7fbf492bab327ce28c2d818c7703ad98f41ce90cf880548516861790557f0c57aea5785985b24ca19ebff030f36407f634c98a888469312cd4a2f24fe20880548516861790557f58ccf1df24247655477643f156760efe65c2642d09c2ac6a8a25442266c6759280548516861790557fdfe3377d8ab6c745cb4192c5d3e75204b9cd6a8d37968d9dc58cc634e0cf5e2480548516861790557f4619d2ad950e42a264ec3433efbc7a09254d4b55f04a0aa122453447e3d221e180548516861790557fb0593f05b3df51df134f284d89747d7cea43c52a7c41f3a692bd824574e688c180548516861790557fa34c2e1202ed48c956b97a7273bd0f37a2a57ddc40fddde1c6079c92cb839fad80548516841790557f2834795b337f7c1d829be36120226812c4e1abdac8c753499eb95353f0a5e8fd80548516841790557f95956cf900c93bef2e250ecf567a1c66ab1c961107653e2a7d5bdf9042fec83c80548516861790557f4b749c9dfe2eab72e8654f5325c1d46e140ca8b6e5143a68ba32b456b2bc06f680548516841790557f1051c2f92583f07eed3b862759da5651eebd9ea7c3a5556cd4e2d35b4ebf423c80548516861790557fa5fa9b80c3598e63e05e67ab04c9e075507fa57790d6e9eae2eb8fd834ffcbd480548516861790557f86b1b8c79d5257a0be98a6c8513f088b6c6b74ddadef9c67d65c7a917cfa087b80548516841790557f71cab135e292738bd870a725eb81441e0645df81093c991f7494f78e0225ae678054851660641790557f59732f9d39d714adb44a257642c489e15b2c0b30d1cf5efe2a58d1f48142eae780548516861790557fad77b90190b75d7d0872bc58bc7ce93d9f6b2ca20b39bc5936d9d8f40334a8bc80548516831790557fe63c7bdda157655315cac3cc07dc3fe8caf97deb248d6995eccc7d7c184d24e380548516861790557faa340c2a1d87a65bd22bd985981668b073c389e48fe0eaa69b1265f0e780574680548516841790557ff7fd9ed2ebc611e6704353f18b360e51d467fb5e3cce42763862b420bb13c6eb80548516861790557f91ef1a882833f6627b3274f92ae1d65417786ab863614ee65ddb915852c6fd6f80548516861790557f361305bd1f2ef010ef9a7a1de67478617e0e1e503a05dd353cdbed032eff769380548516861790557f75139f3544dcd42caed1d725e12aa7fdb0f5b6ef051fdbfc57e386e940d770a080548516861790557fbad4d2ebd1df4c4c8ea4fc6f5b3969ab4debca9c3da202ab17ff40f126e8282880548516861790557ff57785cb902a8ff0f3aedb992260f813976dfd4a67351b30338dd1aff5ec588e80548516861790557f9726963bd55b8c257995ef792966d6fda3c78f453098c992670d096f317fb37380548516861790557f802a0a9acb2b76a6b0781a9900ac3dc03e29e271cd573468472773919476425180548516861790557f140419a3fd7000ec40ec3c29ae35dcd866d6680ff34f7ded11df52dc44c001ec80548516861790557f7b5b33dbb81a0d0fef17c0077a833ee672df7593ff371d1d2b27b5a17a5d9fd280548516861790557f64384155b50a2448eab240ce5c382dce7e45de7d21855f29d34a0a3da2a5ffed80548516841790557f270b939255d4da159abec1b7e06d9d34c01a247186f1a7466e5a3875eb384b6c80548516861790557f7b5c84f573f432c0c76a2112e64f0991d57487fe3a76299b58968738388a6cd680548516861790557f1d6241833f10b6e191ecd58105fb0533b419e67442b262af4748b3e7357b618980548516861790557f4108a7df176898a268c8d2a77571be19c60cf019e9d1306b2b1b01c190540b4780548516861790557fc43009b1a21e04e9c696bb40d2b4c6d0f0e88a555110366e1e007c1da158274f80548516861790557fd942f00ff9ce8835d6329ff778f0705819176563348058225c010c72abdd036580548516861790557f10baeecf67ad6a4485dc1b0b83c047d72011344e92fe8b272c9a8eed2cda808f80548516831790557f6f5ebb260b6629d7f420204c68cdb63a33e0f8c7c63150f1518020ba7aa2673b80548516841790557ff510c3051c1d0fa931f18073cd18d5706cffb088b1e8a8261b9e8763f9ae84f080548516861790557fc08098a1330047d3502f3b784113e9443a05d91662ffa4af356c28b5ecec3c1b80548516861790557f7e610daeceee9c33ee53cb7259e781db63c31ba963fdb0cb4b6d618f9b3ee39b80548516861790557f63edb6bc6cbb83a0dd07058f51c03f2c2ab355d6e3b753fffbda3b132b847b2580548516861790557facafc4f052648d631d70d7a316ff4dbb38ed12c04a04b700735b7ac1a165203480548516861790557f78c5356403dd01427c96a9abd6448837088e8a4f7d7358ac4fb2895eb998d24880548516861790557f5f1177b2a1bbc981aec4b20d6664090d556392a8edf2a3fd2829522ac4f7d45480548516841790557ff76b567823ccb8390b6853f26e146cf2aa8e3d718aa3a63aa160ecf05281847e80548516841790557ff278635ce4b010ba8885bf32d595c60f3774ceecb805b7d2cff6193c4c05802680548516861790557ff1853cb5523eb85c9f468b6cec8f22a4d45ad89be79df3ccc5a77a4acb6c839e80548516861790557f4cffeb9f8dd768d3ce71057e289d8136baee2f2ca2e8d7bd87eaf0cd60bc7e9780548516861790557f0a74e2bc8df8431b0edbcbdc674c7893b55bb1b80d6d69b6a49901764859a7a280548516861790557f5f36c8a2b659040a2654a07ce757121321b2c42a869a557b2b181827f69a03eb80548516861790557f5ea9201f03847446287eb5808dcfaa255d6e402d4fc50551d58f7b495e7e057480548516861790557f069073d76e66c4a239bd511b20c8653181e3948dd7e1fa5997650a711ebc75b580548516861790557f4febb4ae7853b86a79b6aaf70c7c80bc7c81464b42a1d26290d36d135c411d9f80548516841790557f141f49bce1c15fe057c3d396c350e182a77eec529aa528e39c04a991f2bb966780548516861790557f6aee6f99679f7ab49ede3a532f5d720471378d80311e642f8d0c02c9a921048480548516861790557ff78854079576aef1b7f67745023fc231648cbff12dff392e90e6e18ee76f209580548516861790557fed6d776182e968d0196ce10affd5da7e1431b0e3e6694c92a56028fd38f27cf680548516861790557f8c0bf8a214080174ae2c9b6bf9d7214d48afdf8525260527335db2e5fba4525e80548516841790557f4f94f7b2ac9ffe1d1cb36bbae19900be92a2d3846b12571bf70dbe10f228eb6480548516861790557fd91e8e02898ea9dab2220d08107782a88b0239628cbc64cd6d7da7aabb7f7b7080548516861790557f16f29a0ae7ae477148ebbce5e834e5630011f37c6aa69c5b3a01bcba208430bb80548516861790557f9baa101bb13af420b7518cfbdf0e53c3bd096b5cf4df1f1a204568eefa02e6e280548516841790557f451e6589145645ecc1f8343808a1fa8f2d55f19044f24182b094a75fda4d7c6f80548516861790557f49445517511735859af4111abc3a4fc7bbba3b036dffdd152a04ef04dd1f6a0780548516821790557ff03fb0414960c1aaa35b55f7c159db328faeff789c87765f7f3029a7a7dea0a28054851660191790557f496272c21801ad96e6259ba8e94aa27d2c62898400f4e83d5e170334156cefe680548516861790557f5999126a01fc82349b39cbbb478c59ee496c942492ac5155c0664261d335b8df80548516821790557f1d87b14994d53d0f80d43d9a7fa1ccd8bb3f671d02adbcd07128ec6128c4132580548516861790557f0c50207331afd085ed690a0d01e08cec1709b3de69ac3230ac18aa32201dda5f80548516601e9081179091557ff160c99d2f83ae92dae8eb73e97904676b87dafdd320ca2938260ec7e54591c98054861660281790557f6f9072e2c83896a8fcb55a827a7dd5e00ef4529a206ce0cfe33990513fd5a1ab80548616871790557f8eee141cfe84aa7434f4fc2796911d323fe3704f336a2149631fc3af9f9537a980548616871790557f2c5f3f623dc9cd17f2a2a214cdf3f27fe22eb2c3e14c7ffc45ee6145ba435f6780548616871790557f6bf07339017397b004cfa137c882171063c7950c46dec646c975db5fe88e3d1580548616851790557f41351a93bd82894febfb0956abfbc422ef107711c070c071730a2a31adfd41068054861660101790557f0416813c52df7245debcc9091f2e9a928bab8087374d75568f9d636964e594ec80548616871790557fece11619c669b369a892af1e22cd0014818f49728e1f85b48af06b22e3ba976d80548616871790557f75f0541f3377425df4d884f252713f68be13f4faa5862dbb8bf442242e83599e80548616871790557f2ef8226b8c34227a7c8de63c1a1aed15fd1ae5a04660b272439a3a4f409aad1b80548616871790557f3c8c7abc7f4af9ba83de9a412dde15b4a357f7f64c89bd347767ce1a73897e9980548616851790557ff2ab42572e30c36b203cff1531d0a0fafaddc856c7f9f89a93a19bc0034ee68f8054861660021790557f9eb03b550f69221778f4a78fed12c6715213810522c583ebd5792a7a0559e12780548616871790557f990b896ea4c95523086716eeeeed2ece8bd432140c29a5cd368a90971b7ffe4780548616851790557f910c4726858d10c1e6f6951ed109ff8c7c5a672c9ddd0c090424c7c9e546669580548616821790557f5e15903ac0a2365d9cb0778d28cb4fc34a191562128b95436b4f5584baefb52680548616871790557f09ed241f69ecc23459443c52c8d15ca135f7536efc8c6bd82b118672cb8b126680548616851790557f920d950c7f456019fa17d667d9c66e2d4734d3545122d1f031ca36742b708ab180548616851790557f41c9b5381d9f10aca3d562c1a05787a5762edfaa521f38a93629504c28bce68a80548616871790557fb726e2048a699f2fba9d84a3b8160cc88e07944b6bd60ffcdca70a5b0e39b02780548616871790557f05c0f5829afaf6bf1482c652f16f42b1e61562a34146ce23bad31835001a1ce680548616851790557fe9f979c83335b17674cf3c8564465c56b88184ced3ee70cf6c6e47f1353e536f80548616851790557f31c508a8b70cc8e77a36b1afab411d4e7df78949ba53404f646136cfbe1617a580548616821790557fe94de5555359bb8fdece57fcbd3cf287eae8054ef76e5ee2b7326cabca1865788054861660321790557f6ff382f4960e33b7e101c797b0d53eed7482e3bc8fe05679c9c38577b2370fc1805486169093179092557faa4c4851f7c3a7135f7291eee096535cfff6aca318f0fc3d1f7a37f0878997a180548516861790557fa93159d41d9c47d28f144075d1fb6dc31717c1cc2bc2301ec3a9f1ec853ed6ce80548516861790557fb2b517d5232ad6a90694023e0d5b3b18060ffcc7cdab8e5c438307bfffe3807980548516861790557f5d0e329c5f64ede79a0ca17a13e35e77f0adff76fa5533d675f63ba255ec061080548516861790557f69a6a12858dc19f5bccebbcf61793a988b78832b05f8f430e014e80a166ea4af80548516861790557faeb8f71bb6a89e95d127143a33593724873f4e6d1dcad00138a1b5c6d22822bf80548516861790557fd8037bcdaa4dbb1ac6eea819a20b4843a4aabfa9ebd1a008f6e2b4df011224d8805485169092179091557f1747bc30fda312d98259b1b36b761d104ce8ac59592ff046858fd18919efdb9b80548416851790557fa7adf5e6b2a811dc080d24daa0e114fb1ddb8bb2ce31e6574dfbfe265bea7b8180548416831790557f8aa9956a3a50ce668561c2201059540c65e6302c1837cacbcd46736c4902266880548416851790557f9dc61c9b501c88ed8c11aa5280b2107fb19e41091f56f6b12bcb6344fd4cbc5380548416851790557f2358250632a9c4e8bbba89d2c952979ce20017b99599175602b39e4f80604e95805484169092179091557ff1a98f7750eec5b5d211dc5288f42d23d849d17fac0bca5d6f7e78c5b668ef0880548316841790557fde69a861bad9952ae620bce87c7336a2a747de3632ce9684cf6cbfafb427acf380548316909317909255731f1fd08ed5f3dbc2158d96cd5ec063a7a5aebc67600052600f6020527f6fe78f03142517fe5ace778129d0107bc02bf5f632351d9f96a8a1bc5fe320198054909116909117905562001bcd565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80546001019055565b82805462001af89062001b90565b90600052602060002090601f01602090048101928262001b1c576000855562001b67565b82601f1062001b3757805160ff191683800117855562001b67565b8280016001018555821562001b67579182015b8281111562001b6757825182559160200191906001019062001b4a565b5062001b7592915062001b79565b5090565b5b8082111562001b75576000815560010162001b7a565b600181811c9082168062001ba557607f821691505b6020821081141562001bc757634e487b7160e01b600052602260045260246000fd5b50919050565b6128868062001bdd6000396000f3fe6080604052600436106101c25760003560e01c80636352211e116100f7578063a2309ff811610095578063cad96cca11610064578063cad96cca146104f0578063e8a3d4851461051d578063e985e9c514610532578063f2fde38b1461057b57600080fd5b8063a2309ff814610486578063a475b5dd1461049b578063b88d4fde146104b0578063c87b56dd146104d057600080fd5b80638da5cb5b116100d15780638da5cb5b1461042057806395d89b411461043e578063a0712d6814610453578063a22cb4651461046657600080fd5b80636352211e146103cb57806370a08231146103eb578063715018a61461040b57600080fd5b806323b872dd116101645780633ccfd60b1161013e5780633ccfd60b1461035657806342842e0e1461036b5780634f6ccce71461038b57806355f804b3146103ab57600080fd5b806323b872dd146102d75780632a55205a146102f75780632f745c591461033657600080fd5b8063095ea7b3116101a0578063095ea7b31461025657806318160ddd146102785780632106f5291461029757806322d34454146102b757600080fd5b806301ffc9a7146101c757806306fdde03146101fc578063081812fc1461021e575b600080fd5b3480156101d357600080fd5b506101e76101e2366004612144565b61059b565b60405190151581526020015b60405180910390f35b34801561020857600080fd5b506102116105ee565b6040516101f391906121b9565b34801561022a57600080fd5b5061023e6102393660046121cc565b610680565b6040516001600160a01b0390911681526020016101f3565b34801561026257600080fd5b50610276610271366004612201565b61071a565b005b34801561028457600080fd5b506008545b6040519081526020016101f3565b3480156102a357600080fd5b506102766102b236600461222b565b610830565b3480156102c357600080fd5b506102896102d2366004612201565b610887565b3480156102e357600080fd5b506102766102f2366004612268565b61093f565b34801561030357600080fd5b506103176103123660046122a4565b610970565b604080516001600160a01b0390931683526020830191909152016101f3565b34801561034257600080fd5b50610289610351366004612201565b6109e8565b34801561036257600080fd5b50610276610a7e565b34801561037757600080fd5b50610276610386366004612268565b610ad7565b34801561039757600080fd5b506102896103a63660046121cc565b610af2565b3480156103b757600080fd5b506102766103c6366004612352565b610b85565b3480156103d757600080fd5b5061023e6103e63660046121cc565b610c3c565b3480156103f757600080fd5b5061028961040636600461239b565b610cb3565b34801561041757600080fd5b50610276610d3a565b34801561042c57600080fd5b50600b546001600160a01b031661023e565b34801561044a57600080fd5b50610211610d70565b6102766104613660046121cc565b610d7f565b34801561047257600080fd5b506102766104813660046123b6565b6112de565b34801561049257600080fd5b506102896112e9565b3480156104a757600080fd5b50610276611305565b3480156104bc57600080fd5b506102766104cb3660046123e7565b61133d565b3480156104dc57600080fd5b506102116104eb3660046121cc565b611375565b3480156104fc57600080fd5b5061051061050b3660046121cc565b611450565b6040516101f39190612463565b34801561052957600080fd5b506102116114e4565b34801561053e57600080fd5b506101e761054d3660046124c9565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561058757600080fd5b5061027661059636600461239b565b61150c565b60006001600160e01b0319821663656cb66560e11b14156105be57506001919050565b6001600160e01b0319821663152a902d60e11b14156105df57506001919050565b6105e8826115ad565b92915050565b6060600080546105fd906124fc565b80601f0160208091040260200160405190810160405280929190818152602001828054610629906124fc565b80156106765780601f1061064b57610100808354040283529160200191610676565b820191906000526020600020905b81548152906001019060200180831161065957829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166106fe5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b600061072582610c3c565b9050806001600160a01b0316836001600160a01b031614156107935760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016106f5565b336001600160a01b03821614806107af57506107af813361054d565b6108215760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016106f5565b61082b83836115d2565b505050565b600b546001600160a01b0316331461085a5760405162461bcd60e51b81526004016106f590612537565b6001600160a01b03919091166000908152600e60205260409020805460ff191660ff909216919091179055565b6001600160a01b0382166000908152600f602052604081205460ff16156108b0575060006105e8565b6001600160a01b0383166000908152600e602052604081205460ff165b83156109375780156108eb576108e4600182612582565b9050610925565b6362163de042101561091057610909670470de4df820000083612599565b9150610925565b6109226705698eef0667000083612599565b91505b610930600185612582565b93506108cd565b509392505050565b6109493382611640565b6109655760405162461bcd60e51b81526004016106f5906125b1565b61082b838383611737565b60008281526002602052604081205481906001600160a01b0316156109c6577385b23c39d500dc9bbddc5a06b459fef027f2f9d66127106109b361019086612602565b6109bd9190612637565b915091506109e1565b507385b23c39d500dc9bbddc5a06b459fef027f2f9d6905060005b9250929050565b60006109f383610cb3565b8210610a555760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016106f5565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b600b546001600160a01b03163314610aa85760405162461bcd60e51b81526004016106f590612537565b60405133904780156108fc02916000818181858888f19350505050158015610ad4573d6000803e3d6000fd5b50565b61082b8383836040518060200160405280600081525061133d565b6000610afd60085490565b8210610b605760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016106f5565b60088281548110610b7357610b7361264b565b90600052602060002001549050919050565b600b546001600160a01b03163314610baf5760405162461bcd60e51b81526004016106f590612537565b60125415610c255760405162461bcd60e51b815260206004820152603f60248201527f43616e6e6f742063616c6c20736574426173655552492829206166746572205460448201527f756e6e6579204d756e6e657920686173206265656e2072657665616c65642e0060648201526084016106f5565b8051610c3890600d906020840190612095565b5050565b6000818152600260205260408120546001600160a01b0316806105e85760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016106f5565b60006001600160a01b038216610d1e5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016106f5565b506001600160a01b031660009081526003602052604090205490565b600b546001600160a01b03163314610d645760405162461bcd60e51b81526004016106f590612537565b610d6e60006118de565b565b6060600180546105fd906124fc565b6002600a541415610dd25760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106f5565b6002600a556362066be04211610e2a5760405162461bcd60e51b815260206004820152601b60248201527f4d696e74696e67206861736e27742073746172746564207965742e000000000060448201526064016106f5565b63620f2794421015610ef257336000908152600e602052604090205460ff16811115610ef25760405162461bcd60e51b8152602060048201526064602482018190527f4d696e74696e672069732061637469766520666f722070726573616c6520636f60448301527f6c6c6563746f7273206f6e6c792e20506c65617365207761697420666f722077908201527f686974656c697374206f72207075626c6963206d696e74696e6720746f20626560848201526333b4b71760e11b60a482015260c4016106f5565b6014811115610f595760405162461bcd60e51b815260206004820152602d60248201527f596f752063616e206f6e6c79206d696e742032302054756e6e6579204d756e6e60448201526c32bc9030ba1030903a34b6b29760991b60648201526084016106f5565b6000610f636112e9565b336000908152600e602052604081205491925090610f849060ff1684611930565b610f8e9084612582565b90506000610f9b60115490565b610fa790610813612582565b9050611388610fb68585612599565b11156110205760405162461bcd60e51b815260206004820152603360248201527f5075726368617365206578636565647320617661696c61626c6520737570706c6044820152723c9037b3102a3ab73732bc9026bab73732bc9760691b60648201526084016106f5565b6113888161102e8486612599565b6110389190612599565b11156110eb5760405162461bcd60e51b815260206004820152607060248201527f5075726368617365206578636565647320617661696c61626c6520737570706c60448201527f79206f662054756e6e6579204d756e6e6579206173207468657265206172652060648201527f756e2d6d696e746564204e46547320726573657276656420617320706172742060848201526f37b3103a34329038393296b9b0b6329760811b60a482015260c4016106f5565b346110f63386610887565b111561115c5760405162461bcd60e51b815260206004820152602f60248201527f416d6f756e74206f662065746865722073656e7420666f72207075726368617360448201526e329034b99034b731b7b93932b1ba1760891b60648201526084016106f5565b6362163de04210156112275761138861012c836111798487612599565b6111839190612599565b61118d9190612599565b11156112275760405162461bcd60e51b815260206004820152605860248201527f5468652072656d61696e696e6720746f6b656e732068617665206265656e207260448201527f6573657276656420666f7220746865207072652d73616c6520636f6c6c65637460648201527f6f727320616e6420746865207075626c6963206d696e742e0000000000000000608482015260a4016106f5565b60005b848110156112d257336000908152600e602052604090205460ff161561129457336000908152600e60205260409020546112699060019060ff16612661565b336000908152600e60205260409020805460ff191660ff929092169190911790556011805460010190555b6112a2601080546001019055565b6112c03360016112b160105490565b6112bb9190612582565b611946565b806112ca81612684565b91505061122a565b50506001600a55505050565b610c38338383611960565b600060016112f660105490565b6113009190612582565b905090565b600b546001600160a01b0316331461132f5760405162461bcd60e51b81526004016106f590612537565b601254610d6e576001601255565b6113473383611640565b6113635760405162461bcd60e51b81526004016106f5906125b1565b61136f84848484611a2f565b50505050565b6000818152600260205260409020546060906001600160a01b03166113f45760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016106f5565b60006113fe611a62565b9050600081511161141e5760405180602001604052806000815250611449565b8061142884611a71565b60405160200161143992919061269f565b6040516020818303038152906040525b9392505050565b6060600c6000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156114d957600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b90046bffffffffffffffffffffffff1681830152825260019092019101611485565b505050509050919050565b6060600d6040516020016114f891906126ce565b604051602081830303815290604052905090565b600b546001600160a01b031633146115365760405162461bcd60e51b81526004016106f590612537565b6001600160a01b03811661159b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106f5565b610ad4816118de565b80546001019055565b60006001600160e01b0319821663780e9d6360e01b14806105e857506105e882611b6f565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061160782610c3c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b03166116b95760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016106f5565b60006116c483610c3c565b9050806001600160a01b0316846001600160a01b031614806116ff5750836001600160a01b03166116f484610680565b6001600160a01b0316145b8061172f57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661174a82610c3c565b6001600160a01b0316146117ae5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016106f5565b6001600160a01b0382166118105760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016106f5565b61181b838383611bbf565b6118266000826115d2565b6001600160a01b038316600090815260036020526040812080546001929061184f908490612582565b90915550506001600160a01b038216600090815260036020526040812080546001929061187d908490612599565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600081831061193f5781611449565b5090919050565b610c38828260405180602001604052806000815250611c77565b816001600160a01b0316836001600160a01b031614156119c25760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016106f5565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611a3a848484611737565b611a4684848484611caa565b61136f5760405162461bcd60e51b81526004016106f59061277a565b6060600d80546105fd906124fc565b606081611a955750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611abf5780611aa981612684565b9150611ab89050600a83612637565b9150611a99565b60008167ffffffffffffffff811115611ada57611ada6122c6565b6040519080825280601f01601f191660200182016040528015611b04576020820181803683370190505b5090505b841561172f57611b19600183612582565b9150611b26600a866127cc565b611b31906030612599565b60f81b818381518110611b4657611b4661264b565b60200101906001600160f81b031916908160001a905350611b68600a86612637565b9450611b08565b60006001600160e01b031982166380ac58cd60e01b1480611ba057506001600160e01b03198216635b5e139f60e01b145b806105e857506301ffc9a760e01b6001600160e01b03198316146105e8565b6001600160a01b038316611c1a57611c1581600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b611c3d565b816001600160a01b0316836001600160a01b031614611c3d57611c3d8382611db7565b6001600160a01b038216611c545761082b81611e54565b826001600160a01b0316826001600160a01b03161461082b5761082b8282611f03565b611c818383611f47565b611c8e6000848484611caa565b61082b5760405162461bcd60e51b81526004016106f59061277a565b60006001600160a01b0384163b15611dac57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611cee9033908990889088906004016127e0565b602060405180830381600087803b158015611d0857600080fd5b505af1925050508015611d38575060408051601f3d908101601f19168201909252611d359181019061281d565b60015b611d92573d808015611d66576040519150601f19603f3d011682016040523d82523d6000602084013e611d6b565b606091505b508051611d8a5760405162461bcd60e51b81526004016106f59061277a565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061172f565b506001949350505050565b60006001611dc484610cb3565b611dce9190612582565b600083815260076020526040902054909150808214611e21576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090611e6690600190612582565b60008381526009602052604081205460088054939450909284908110611e8e57611e8e61264b565b906000526020600020015490508060088381548110611eaf57611eaf61264b565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480611ee757611ee761283a565b6001900381819060005260206000200160009055905550505050565b6000611f0e83610cb3565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160a01b038216611f9d5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016106f5565b6000818152600260205260409020546001600160a01b0316156120025760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016106f5565b61200e60008383611bbf565b6001600160a01b0382166000908152600360205260408120805460019290612037908490612599565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b8280546120a1906124fc565b90600052602060002090601f0160209004810192826120c35760008555612109565b82601f106120dc57805160ff1916838001178555612109565b82800160010185558215612109579182015b828111156121095782518255916020019190600101906120ee565b50612115929150612119565b5090565b5b80821115612115576000815560010161211a565b6001600160e01b031981168114610ad457600080fd5b60006020828403121561215657600080fd5b81356114498161212e565b60005b8381101561217c578181015183820152602001612164565b8381111561136f5750506000910152565b600081518084526121a5816020860160208601612161565b601f01601f19169290920160200192915050565b602081526000611449602083018461218d565b6000602082840312156121de57600080fd5b5035919050565b80356001600160a01b03811681146121fc57600080fd5b919050565b6000806040838503121561221457600080fd5b61221d836121e5565b946020939093013593505050565b6000806040838503121561223e57600080fd5b612247836121e5565b9150602083013560ff8116811461225d57600080fd5b809150509250929050565b60008060006060848603121561227d57600080fd5b612286846121e5565b9250612294602085016121e5565b9150604084013590509250925092565b600080604083850312156122b757600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156122f7576122f76122c6565b604051601f8501601f19908116603f0116810190828211818310171561231f5761231f6122c6565b8160405280935085815286868601111561233857600080fd5b858560208301376000602087830101525050509392505050565b60006020828403121561236457600080fd5b813567ffffffffffffffff81111561237b57600080fd5b8201601f8101841361238c57600080fd5b61172f848235602084016122dc565b6000602082840312156123ad57600080fd5b611449826121e5565b600080604083850312156123c957600080fd5b6123d2836121e5565b91506020830135801515811461225d57600080fd5b600080600080608085870312156123fd57600080fd5b612406856121e5565b9350612414602086016121e5565b925060408501359150606085013567ffffffffffffffff81111561243757600080fd5b8501601f8101871361244857600080fd5b612457878235602084016122dc565b91505092959194509250565b602080825282518282018190526000919060409081850190868401855b828110156124bc57815180516001600160a01b031685528601516bffffffffffffffffffffffff16868501529284019290850190600101612480565b5091979650505050505050565b600080604083850312156124dc57600080fd5b6124e5836121e5565b91506124f3602084016121e5565b90509250929050565b600181811c9082168061251057607f821691505b6020821081141561253157634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000828210156125945761259461256c565b500390565b600082198211156125ac576125ac61256c565b500190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600081600019048311821515161561261c5761261c61256c565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261264657612646612621565b500490565b634e487b7160e01b600052603260045260246000fd5b600060ff821660ff84168082101561267b5761267b61256c565b90039392505050565b60006000198214156126985761269861256c565b5060010190565b600083516126b1818460208801612161565b8351908301906126c5818360208801612161565b01949350505050565b600080835481600182811c9150808316806126ea57607f831692505b602080841082141561270a57634e487b7160e01b86526022600452602486fd5b81801561271e576001811461272f5761275c565b60ff1986168952848901965061275c565b60008a81526020902060005b868110156127545781548b82015290850190830161273b565b505084890196505b50505050505061172f816718dbdb9d1c9858dd60c21b815260080190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6000826127db576127db612621565b500690565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906128139083018461218d565b9695505050505050565b60006020828403121561282f57600080fd5b81516114498161212e565b634e487b7160e01b600052603160045260246000fdfea26469706673582212204a38779901f68da66ca07b37a7862e13145743920c474fd834a21feaba5fc57364736f6c63430008080033697066733a2f2f6261667962776962786e7533766a7a78786e68783278707a66706463616a67746e6777336c356970766369376e6b616e326869776a706e653576652f

Deployed Bytecode

0x6080604052600436106101c25760003560e01c80636352211e116100f7578063a2309ff811610095578063cad96cca11610064578063cad96cca146104f0578063e8a3d4851461051d578063e985e9c514610532578063f2fde38b1461057b57600080fd5b8063a2309ff814610486578063a475b5dd1461049b578063b88d4fde146104b0578063c87b56dd146104d057600080fd5b80638da5cb5b116100d15780638da5cb5b1461042057806395d89b411461043e578063a0712d6814610453578063a22cb4651461046657600080fd5b80636352211e146103cb57806370a08231146103eb578063715018a61461040b57600080fd5b806323b872dd116101645780633ccfd60b1161013e5780633ccfd60b1461035657806342842e0e1461036b5780634f6ccce71461038b57806355f804b3146103ab57600080fd5b806323b872dd146102d75780632a55205a146102f75780632f745c591461033657600080fd5b8063095ea7b3116101a0578063095ea7b31461025657806318160ddd146102785780632106f5291461029757806322d34454146102b757600080fd5b806301ffc9a7146101c757806306fdde03146101fc578063081812fc1461021e575b600080fd5b3480156101d357600080fd5b506101e76101e2366004612144565b61059b565b60405190151581526020015b60405180910390f35b34801561020857600080fd5b506102116105ee565b6040516101f391906121b9565b34801561022a57600080fd5b5061023e6102393660046121cc565b610680565b6040516001600160a01b0390911681526020016101f3565b34801561026257600080fd5b50610276610271366004612201565b61071a565b005b34801561028457600080fd5b506008545b6040519081526020016101f3565b3480156102a357600080fd5b506102766102b236600461222b565b610830565b3480156102c357600080fd5b506102896102d2366004612201565b610887565b3480156102e357600080fd5b506102766102f2366004612268565b61093f565b34801561030357600080fd5b506103176103123660046122a4565b610970565b604080516001600160a01b0390931683526020830191909152016101f3565b34801561034257600080fd5b50610289610351366004612201565b6109e8565b34801561036257600080fd5b50610276610a7e565b34801561037757600080fd5b50610276610386366004612268565b610ad7565b34801561039757600080fd5b506102896103a63660046121cc565b610af2565b3480156103b757600080fd5b506102766103c6366004612352565b610b85565b3480156103d757600080fd5b5061023e6103e63660046121cc565b610c3c565b3480156103f757600080fd5b5061028961040636600461239b565b610cb3565b34801561041757600080fd5b50610276610d3a565b34801561042c57600080fd5b50600b546001600160a01b031661023e565b34801561044a57600080fd5b50610211610d70565b6102766104613660046121cc565b610d7f565b34801561047257600080fd5b506102766104813660046123b6565b6112de565b34801561049257600080fd5b506102896112e9565b3480156104a757600080fd5b50610276611305565b3480156104bc57600080fd5b506102766104cb3660046123e7565b61133d565b3480156104dc57600080fd5b506102116104eb3660046121cc565b611375565b3480156104fc57600080fd5b5061051061050b3660046121cc565b611450565b6040516101f39190612463565b34801561052957600080fd5b506102116114e4565b34801561053e57600080fd5b506101e761054d3660046124c9565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561058757600080fd5b5061027661059636600461239b565b61150c565b60006001600160e01b0319821663656cb66560e11b14156105be57506001919050565b6001600160e01b0319821663152a902d60e11b14156105df57506001919050565b6105e8826115ad565b92915050565b6060600080546105fd906124fc565b80601f0160208091040260200160405190810160405280929190818152602001828054610629906124fc565b80156106765780601f1061064b57610100808354040283529160200191610676565b820191906000526020600020905b81548152906001019060200180831161065957829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166106fe5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b600061072582610c3c565b9050806001600160a01b0316836001600160a01b031614156107935760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016106f5565b336001600160a01b03821614806107af57506107af813361054d565b6108215760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016106f5565b61082b83836115d2565b505050565b600b546001600160a01b0316331461085a5760405162461bcd60e51b81526004016106f590612537565b6001600160a01b03919091166000908152600e60205260409020805460ff191660ff909216919091179055565b6001600160a01b0382166000908152600f602052604081205460ff16156108b0575060006105e8565b6001600160a01b0383166000908152600e602052604081205460ff165b83156109375780156108eb576108e4600182612582565b9050610925565b6362163de042101561091057610909670470de4df820000083612599565b9150610925565b6109226705698eef0667000083612599565b91505b610930600185612582565b93506108cd565b509392505050565b6109493382611640565b6109655760405162461bcd60e51b81526004016106f5906125b1565b61082b838383611737565b60008281526002602052604081205481906001600160a01b0316156109c6577385b23c39d500dc9bbddc5a06b459fef027f2f9d66127106109b361019086612602565b6109bd9190612637565b915091506109e1565b507385b23c39d500dc9bbddc5a06b459fef027f2f9d6905060005b9250929050565b60006109f383610cb3565b8210610a555760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016106f5565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b600b546001600160a01b03163314610aa85760405162461bcd60e51b81526004016106f590612537565b60405133904780156108fc02916000818181858888f19350505050158015610ad4573d6000803e3d6000fd5b50565b61082b8383836040518060200160405280600081525061133d565b6000610afd60085490565b8210610b605760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016106f5565b60088281548110610b7357610b7361264b565b90600052602060002001549050919050565b600b546001600160a01b03163314610baf5760405162461bcd60e51b81526004016106f590612537565b60125415610c255760405162461bcd60e51b815260206004820152603f60248201527f43616e6e6f742063616c6c20736574426173655552492829206166746572205460448201527f756e6e6579204d756e6e657920686173206265656e2072657665616c65642e0060648201526084016106f5565b8051610c3890600d906020840190612095565b5050565b6000818152600260205260408120546001600160a01b0316806105e85760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016106f5565b60006001600160a01b038216610d1e5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016106f5565b506001600160a01b031660009081526003602052604090205490565b600b546001600160a01b03163314610d645760405162461bcd60e51b81526004016106f590612537565b610d6e60006118de565b565b6060600180546105fd906124fc565b6002600a541415610dd25760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106f5565b6002600a556362066be04211610e2a5760405162461bcd60e51b815260206004820152601b60248201527f4d696e74696e67206861736e27742073746172746564207965742e000000000060448201526064016106f5565b63620f2794421015610ef257336000908152600e602052604090205460ff16811115610ef25760405162461bcd60e51b8152602060048201526064602482018190527f4d696e74696e672069732061637469766520666f722070726573616c6520636f60448301527f6c6c6563746f7273206f6e6c792e20506c65617365207761697420666f722077908201527f686974656c697374206f72207075626c6963206d696e74696e6720746f20626560848201526333b4b71760e11b60a482015260c4016106f5565b6014811115610f595760405162461bcd60e51b815260206004820152602d60248201527f596f752063616e206f6e6c79206d696e742032302054756e6e6579204d756e6e60448201526c32bc9030ba1030903a34b6b29760991b60648201526084016106f5565b6000610f636112e9565b336000908152600e602052604081205491925090610f849060ff1684611930565b610f8e9084612582565b90506000610f9b60115490565b610fa790610813612582565b9050611388610fb68585612599565b11156110205760405162461bcd60e51b815260206004820152603360248201527f5075726368617365206578636565647320617661696c61626c6520737570706c6044820152723c9037b3102a3ab73732bc9026bab73732bc9760691b60648201526084016106f5565b6113888161102e8486612599565b6110389190612599565b11156110eb5760405162461bcd60e51b815260206004820152607060248201527f5075726368617365206578636565647320617661696c61626c6520737570706c60448201527f79206f662054756e6e6579204d756e6e6579206173207468657265206172652060648201527f756e2d6d696e746564204e46547320726573657276656420617320706172742060848201526f37b3103a34329038393296b9b0b6329760811b60a482015260c4016106f5565b346110f63386610887565b111561115c5760405162461bcd60e51b815260206004820152602f60248201527f416d6f756e74206f662065746865722073656e7420666f72207075726368617360448201526e329034b99034b731b7b93932b1ba1760891b60648201526084016106f5565b6362163de04210156112275761138861012c836111798487612599565b6111839190612599565b61118d9190612599565b11156112275760405162461bcd60e51b815260206004820152605860248201527f5468652072656d61696e696e6720746f6b656e732068617665206265656e207260448201527f6573657276656420666f7220746865207072652d73616c6520636f6c6c65637460648201527f6f727320616e6420746865207075626c6963206d696e742e0000000000000000608482015260a4016106f5565b60005b848110156112d257336000908152600e602052604090205460ff161561129457336000908152600e60205260409020546112699060019060ff16612661565b336000908152600e60205260409020805460ff191660ff929092169190911790556011805460010190555b6112a2601080546001019055565b6112c03360016112b160105490565b6112bb9190612582565b611946565b806112ca81612684565b91505061122a565b50506001600a55505050565b610c38338383611960565b600060016112f660105490565b6113009190612582565b905090565b600b546001600160a01b0316331461132f5760405162461bcd60e51b81526004016106f590612537565b601254610d6e576001601255565b6113473383611640565b6113635760405162461bcd60e51b81526004016106f5906125b1565b61136f84848484611a2f565b50505050565b6000818152600260205260409020546060906001600160a01b03166113f45760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016106f5565b60006113fe611a62565b9050600081511161141e5760405180602001604052806000815250611449565b8061142884611a71565b60405160200161143992919061269f565b6040516020818303038152906040525b9392505050565b6060600c6000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156114d957600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b90046bffffffffffffffffffffffff1681830152825260019092019101611485565b505050509050919050565b6060600d6040516020016114f891906126ce565b604051602081830303815290604052905090565b600b546001600160a01b031633146115365760405162461bcd60e51b81526004016106f590612537565b6001600160a01b03811661159b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106f5565b610ad4816118de565b80546001019055565b60006001600160e01b0319821663780e9d6360e01b14806105e857506105e882611b6f565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061160782610c3c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b03166116b95760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016106f5565b60006116c483610c3c565b9050806001600160a01b0316846001600160a01b031614806116ff5750836001600160a01b03166116f484610680565b6001600160a01b0316145b8061172f57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661174a82610c3c565b6001600160a01b0316146117ae5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016106f5565b6001600160a01b0382166118105760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016106f5565b61181b838383611bbf565b6118266000826115d2565b6001600160a01b038316600090815260036020526040812080546001929061184f908490612582565b90915550506001600160a01b038216600090815260036020526040812080546001929061187d908490612599565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600081831061193f5781611449565b5090919050565b610c38828260405180602001604052806000815250611c77565b816001600160a01b0316836001600160a01b031614156119c25760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016106f5565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611a3a848484611737565b611a4684848484611caa565b61136f5760405162461bcd60e51b81526004016106f59061277a565b6060600d80546105fd906124fc565b606081611a955750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611abf5780611aa981612684565b9150611ab89050600a83612637565b9150611a99565b60008167ffffffffffffffff811115611ada57611ada6122c6565b6040519080825280601f01601f191660200182016040528015611b04576020820181803683370190505b5090505b841561172f57611b19600183612582565b9150611b26600a866127cc565b611b31906030612599565b60f81b818381518110611b4657611b4661264b565b60200101906001600160f81b031916908160001a905350611b68600a86612637565b9450611b08565b60006001600160e01b031982166380ac58cd60e01b1480611ba057506001600160e01b03198216635b5e139f60e01b145b806105e857506301ffc9a760e01b6001600160e01b03198316146105e8565b6001600160a01b038316611c1a57611c1581600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b611c3d565b816001600160a01b0316836001600160a01b031614611c3d57611c3d8382611db7565b6001600160a01b038216611c545761082b81611e54565b826001600160a01b0316826001600160a01b03161461082b5761082b8282611f03565b611c818383611f47565b611c8e6000848484611caa565b61082b5760405162461bcd60e51b81526004016106f59061277a565b60006001600160a01b0384163b15611dac57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611cee9033908990889088906004016127e0565b602060405180830381600087803b158015611d0857600080fd5b505af1925050508015611d38575060408051601f3d908101601f19168201909252611d359181019061281d565b60015b611d92573d808015611d66576040519150601f19603f3d011682016040523d82523d6000602084013e611d6b565b606091505b508051611d8a5760405162461bcd60e51b81526004016106f59061277a565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061172f565b506001949350505050565b60006001611dc484610cb3565b611dce9190612582565b600083815260076020526040902054909150808214611e21576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090611e6690600190612582565b60008381526009602052604081205460088054939450909284908110611e8e57611e8e61264b565b906000526020600020015490508060088381548110611eaf57611eaf61264b565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480611ee757611ee761283a565b6001900381819060005260206000200160009055905550505050565b6000611f0e83610cb3565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160a01b038216611f9d5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016106f5565b6000818152600260205260409020546001600160a01b0316156120025760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016106f5565b61200e60008383611bbf565b6001600160a01b0382166000908152600360205260408120805460019290612037908490612599565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b8280546120a1906124fc565b90600052602060002090601f0160209004810192826120c35760008555612109565b82601f106120dc57805160ff1916838001178555612109565b82800160010185558215612109579182015b828111156121095782518255916020019190600101906120ee565b50612115929150612119565b5090565b5b80821115612115576000815560010161211a565b6001600160e01b031981168114610ad457600080fd5b60006020828403121561215657600080fd5b81356114498161212e565b60005b8381101561217c578181015183820152602001612164565b8381111561136f5750506000910152565b600081518084526121a5816020860160208601612161565b601f01601f19169290920160200192915050565b602081526000611449602083018461218d565b6000602082840312156121de57600080fd5b5035919050565b80356001600160a01b03811681146121fc57600080fd5b919050565b6000806040838503121561221457600080fd5b61221d836121e5565b946020939093013593505050565b6000806040838503121561223e57600080fd5b612247836121e5565b9150602083013560ff8116811461225d57600080fd5b809150509250929050565b60008060006060848603121561227d57600080fd5b612286846121e5565b9250612294602085016121e5565b9150604084013590509250925092565b600080604083850312156122b757600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156122f7576122f76122c6565b604051601f8501601f19908116603f0116810190828211818310171561231f5761231f6122c6565b8160405280935085815286868601111561233857600080fd5b858560208301376000602087830101525050509392505050565b60006020828403121561236457600080fd5b813567ffffffffffffffff81111561237b57600080fd5b8201601f8101841361238c57600080fd5b61172f848235602084016122dc565b6000602082840312156123ad57600080fd5b611449826121e5565b600080604083850312156123c957600080fd5b6123d2836121e5565b91506020830135801515811461225d57600080fd5b600080600080608085870312156123fd57600080fd5b612406856121e5565b9350612414602086016121e5565b925060408501359150606085013567ffffffffffffffff81111561243757600080fd5b8501601f8101871361244857600080fd5b612457878235602084016122dc565b91505092959194509250565b602080825282518282018190526000919060409081850190868401855b828110156124bc57815180516001600160a01b031685528601516bffffffffffffffffffffffff16868501529284019290850190600101612480565b5091979650505050505050565b600080604083850312156124dc57600080fd5b6124e5836121e5565b91506124f3602084016121e5565b90509250929050565b600181811c9082168061251057607f821691505b6020821081141561253157634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000828210156125945761259461256c565b500390565b600082198211156125ac576125ac61256c565b500190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600081600019048311821515161561261c5761261c61256c565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261264657612646612621565b500490565b634e487b7160e01b600052603260045260246000fd5b600060ff821660ff84168082101561267b5761267b61256c565b90039392505050565b60006000198214156126985761269861256c565b5060010190565b600083516126b1818460208801612161565b8351908301906126c5818360208801612161565b01949350505050565b600080835481600182811c9150808316806126ea57607f831692505b602080841082141561270a57634e487b7160e01b86526022600452602486fd5b81801561271e576001811461272f5761275c565b60ff1986168952848901965061275c565b60008a81526020902060005b868110156127545781548b82015290850190830161273b565b505084890196505b50505050505061172f816718dbdb9d1c9858dd60c21b815260080190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6000826127db576127db612621565b500690565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906128139083018461218d565b9695505050505050565b60006020828403121561282f57600080fd5b81516114498161212e565b634e487b7160e01b600052603160045260246000fdfea26469706673582212204a38779901f68da66ca07b37a7862e13145743920c474fd834a21feaba5fc57364736f6c63430008080033

Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.