Contract 0x46207da38bca6a3d34384ded08e4c3dae5ae1ae1

Contract Overview

Balance:
0 BNB
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x125302ac346bf8934578a28920ec4c021a83bdb8311be9b1248b772fe90b9c1fClear User Custo...123957762021-09-15 19:23:079 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.00014411
0xc70b99134c0819179bb48b129f61ae585bd46c35b0cefdeceb46de30ce2460ceUpdate User Cust...123957732021-09-15 19:22:589 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.00046068
0xb8a9cbf87456a25818e72749fae6e3ee5bb8169e22e0487f5b7131f01e73a269Mine Reserves123957632021-09-15 19:22:289 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.01433947
0xcaf91a7a26adaf3f1f61acc39e032a456108257bdd9fac175cda402d4dc93b86Flip Sale State123957552021-09-15 19:22:049 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.0002813
0xdb05eddadb2066994f0bc185f4e3ed11f65c24ae5c077f7e7451b25fb7019f8cFlip Auto Reward...123957522021-09-15 19:21:559 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.00028238
0x68c766350023a2cc0ee1f7de43f5a552d7517170ae410cee1be68499ca9db86aFlip Auto Reward...123957502021-09-15 19:21:499 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.00028238
0xfd53f110826a0106bb4a5d6544ed8c7c73c8f9e266b1b4b6e0fcec301b4730dbRevoke Role123957462021-09-15 19:21:379 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.00025685
0xdcf92774ab6c60f00f4d163749117e7a2fea9b01cc8b3a5ffd4ac2e3da872ed1Grant Role123957442021-09-15 19:21:319 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.0009621
0xcc9d1c4f023e773c113f79e560dd9e4383ec055512714aad437d73803ccf88edClear User Custo...123950892021-09-15 18:48:469 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.00014411
0x4e03255556063bd00449891a9b067d6268260fad0818721360792a963f034fadUpdate User Cust...123950862021-09-15 18:48:379 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.00065268
0x9972ac209449007c00964407c81fbec63226b2dc3eb1b2ae59294757e084a0b1Transfer From123950822021-09-15 18:48:259 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.0007719
0xd288de52e4d3adf8de36979fc44cc0e754a15eabd86a58c5ed73e1f55f4707e0Set Base URI123950782021-09-15 18:48:139 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.0003063
0x2af403c3cd3f33796169cbdabaa7361298ad40fd2cc90fef306a1c095629773dMint By Id123950752021-09-15 18:48:049 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.00164181
0xa02c940c371fac6b6003042d3e816c8fa1355189477f459291b1708ac7a8b546Mine Reserves123950732021-09-15 18:47:589 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.01403761
0xa8796f9298dc3fb1af9c318aedbf8c320df6e127511186603caed7814cdf47d0Mint By Id123950692021-09-15 18:47:469 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.00155781
0x8fea94415204bca2c6299bc0e36be55c497b50d209f5af9242551a43992fd352Set Reflection F...123950652021-09-15 18:47:349 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.00027509
0xb5b469a5aa2853a1d8daa096681c0bf7e134e1b223304b7e5771f909f0e0b10fSet Price123950612021-09-15 18:47:229 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.00027592
0x9b00bd6f060c5392b2d31b9e60965de6986adf38e814650afd505de9469c7709Flip Auto Reward...123950572021-09-15 18:47:109 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.00028174
0x7cd430aad0625fffbd4ee06cd9fda4b280e9086c767fab56900c4c012ae46033Flip Sale State123950532021-09-15 18:46:589 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.0002813
0x4c494b14573b64e201cee57f858d4d34d4a75f1621420c6ca56efafe562c2d21Flip Auto Reward...123950512021-09-15 18:46:529 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.00028238
0x39880c13c6dde49f65607fde3487653f8bd19b204bad95fbc36901de12bc8f77Revoke Role123950482021-09-15 18:46:439 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.00025685
0x6cc2b50049159d49d2218d7097ec85ee5b32613d8636e72f7d2df7e6ac3c380eGrant Role123950452021-09-15 18:46:349 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  0x46207da38bca6a3d34384ded08e4c3dae5ae1ae10 BNB0.0009621
0xcaae229baeb6492507a0e1d4e753ebff5aef0a3680747c5f05819e8e1fea78cd0x60806040123950072021-09-15 18:44:409 days 6 hrs ago0x8b82e7393cb8bb187b9effeab12c28d0ca27002a IN  Contract Creation0 BNB0.08477718
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AutoRewardsNFT

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 22 : nft_contract.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./token/ERC721/ERC721.sol";
import "./token/ERC20/IERC20.sol";
import "./interface/IUniswapV2Router01.sol";
import "./interface/IUniswapV2Router02.sol";
import "./token/ERC721/extensions/ERC721Enumerable.sol";
import "./token/ERC721/extensions/ERC721URIStorage.sol";
import "./access/AccessControlEnumerable.sol";
import "./utils/Context.sol";
import "./utils/Counters.sol";

contract AutoRewardsNFT is
    Context,
    AccessControlEnumerable,
    ERC721Enumerable,
    ERC721URIStorage
{
    using Counters for Counters.Counter;
    Counters.Counter public _tokenIdTracker;

    IUniswapV2Router02 public uniswapV2Router;

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

    string private _baseTokenURI;
    string private _contractURI;

    uint256 private _price;
    uint256 private _max;

    address payable _paymentSplitter;

    uint256 public reflectionBalance;
    uint256 public reflectionFee;
    uint256 public totalDividend;
    uint256 public gasForProcessing = 300000;
    uint256 public lastProcessedNFT;

    mapping(uint256 => uint256) lastDividendAt;
    mapping(uint256 => address) public creator;
    mapping(address => bool) public hasCustomClaimToken;
    mapping(address => address) public userCustomClaimToken;

    bool public saleIsActive = false;
    bool public autoRewardIsActive = true;
    bool public autoRewardAsCustomIsActive = true;
    bool public defaultToDoge = true;

    constructor(
        string memory name,
        string memory symbol,
        string memory base_token_URI,
        string memory contract_URI,
        uint256 mintPrice,
        uint256 max,
        uint256 reflection_fee,
        address admin,
        address payable payment_splitter_address
    ) ERC721(name, symbol) {
        _price = mintPrice;
        _max = max;
        _baseTokenURI = base_token_URI;
        _contractURI = contract_URI;
        reflectionFee = reflection_fee;

        _setupRole(DEFAULT_ADMIN_ROLE, admin);
        _setupRole(MINTER_ROLE, admin);

        IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
            0x10ED43C718714eb63d5aA57B78B54704E256024E
        ); //0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3
        uniswapV2Router = _uniswapV2Router;

        _paymentSplitter = payment_splitter_address;
    }

    function paymentSplitter() public view returns (address) {
        return _paymentSplitter;
    }

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

    function contractURI() public view returns (string memory) {
        return _contractURI;
    }

    function setBaseURI(string memory baseURI) external {
        require(
            hasRole(DEFAULT_ADMIN_ROLE, _msgSender()),
            "Must have admin role to change base URI"
        );
        _baseTokenURI = baseURI;
    }

    function setContractURI(string memory _newContractURI) external {
        require(
            hasRole(DEFAULT_ADMIN_ROLE, _msgSender()),
            "Must have admin role to change base URI"
        );
        _contractURI = _newContractURI;
    }

    function setTokenURI(uint256 tokenId, string memory _tokenURI) external {
        require(
            hasRole(DEFAULT_ADMIN_ROLE, _msgSender()),
            "Must have admin role to change token URI"
        );
        _setTokenURI(tokenId, _tokenURI);
    }

    function setPrice(uint256 mintPrice) external {
        require(
            hasRole(DEFAULT_ADMIN_ROLE, _msgSender()),
            "Must have admin role to change price"
        );
        _price = mintPrice;
    }

    function setReflectionFee(uint256 _reflectionFee) external {
        require(
            hasRole(DEFAULT_ADMIN_ROLE, _msgSender()),
            "Must have admin role to change reflection"
        );
        reflectionFee = _reflectionFee;
    }

    function updateUniswapV2Router(address newAddress) public {
        require(
            newAddress != address(uniswapV2Router),
            "The router already has that address"
        );
        require(
            hasRole(DEFAULT_ADMIN_ROLE, _msgSender()),
            "Must have admin role to update the router address"
        );
        uniswapV2Router = IUniswapV2Router02(newAddress);
    }

    function updatePaymentSplitter(address payable newAddress) public {
        require(
            newAddress != address(uniswapV2Router),
            "The paymentSplitter already has that address"
        );
        require(
            hasRole(DEFAULT_ADMIN_ROLE, _msgSender()),
            "Must have admin role to update the paymentSplitter"
        );
        _paymentSplitter = newAddress;
    }

    function getAllMinters() public view returns (address[10] memory) {
        uint256 count = getRoleMemberCount(MINTER_ROLE);
        address[10] memory members;

        for (uint256 i = 0; i < count; i++) {
            members[i] = getRoleMember(MINTER_ROLE, i);
        }

        return members;
    }

    function getAllRoleMembers(bytes32 _roles)
        public
        view
        returns (address[10] memory)
    {
        uint256 count = getRoleMemberCount(_roles);
        address[10] memory members;

        for (uint256 i = 0; i < count; i++) {
            members[i] = getRoleMember(_roles, i);
        }

        return members;
    }

    function updateGasForProcessing(uint256 newValue) external {
        require(
            newValue >= 200000 && newValue <= 500000,
            "gasForProcessing must be between 200,000 and 500,000"
        );
        require(
            newValue != gasForProcessing,
            "Cannot update gasForProcessing to same value"
        );
        require(
            hasRole(DEFAULT_ADMIN_ROLE, _msgSender()),
            "Must have admin role to change price"
        );
        gasForProcessing = newValue;
    }

    function price() public view returns (uint256) {
        return _price;
    }

    function mint() public payable {
        require(saleIsActive, "Sale must be active to mint");
        require(msg.value == _price, "Must send correct price");
        require(totalSupply() < _max, "All NFTs have been minted");
        while (_exists(_tokenIdTracker.current())) {
            _tokenIdTracker.increment();
        }

        _mint(msg.sender, _tokenIdTracker.current());
        if (defaultToDoge) defaultClaimToDoge(msg.sender);
        creator[_tokenIdTracker.current()] = msg.sender;
        lastDividendAt[_tokenIdTracker.current()] = totalDividend;
        _tokenIdTracker.increment();
        splitBalance(msg.value);
    }

    function mineReserves(uint256 _amount) public {
        require(
            hasRole(MINTER_ROLE, _msgSender()),
            "Does not have Minter role"
        );

        for (uint256 x = 0; x < _amount; x++) {
            reserves_mint();
        }
    }

    function mintById(uint256 _id) public {
        require(
            hasRole(MINTER_ROLE, _msgSender()),
            "Does not have Minter role"
        );
        mint_id(_id);
        lastDividendAt[_id] = totalDividend;
        creator[_id] = msg.sender;
    }

    function flipSaleState() public {
        require(
            hasRole(DEFAULT_ADMIN_ROLE, _msgSender()),
            "Does not have Admin role"
        );
        saleIsActive = !saleIsActive;
    }

    function flipAutoRewardState() public {
        require(
            hasRole(DEFAULT_ADMIN_ROLE, _msgSender()),
            "Does not have Admin role"
        );
        autoRewardIsActive = !autoRewardIsActive;
    }

    function flipAutoRewardAsCustom() public {
        require(
            hasRole(DEFAULT_ADMIN_ROLE, _msgSender()),
            "Does not have Admin role"
        );
        autoRewardAsCustomIsActive = !autoRewardAsCustomIsActive;
    }

    function flipDefaultToDoge() public {
        require(
            hasRole(DEFAULT_ADMIN_ROLE, _msgSender()),
            "Does not have Admin role"
        );
        defaultToDoge = !defaultToDoge;
    }

    function reserves_mint() private {
        while (_exists(_tokenIdTracker.current())) {
            _tokenIdTracker.increment();
        }
        _safeMint(msg.sender, _tokenIdTracker.current());
        lastDividendAt[_tokenIdTracker.current()] = totalDividend;
        creator[_tokenIdTracker.current()] = msg.sender;
        _tokenIdTracker.increment();
    }

    function mint_id(uint256 tokenId) private {
        _safeMint(msg.sender, tokenId);
    }

    function _burn(uint256 tokenId)
        internal
        virtual
        override(ERC721, ERC721URIStorage)
    {
        return ERC721URIStorage._burn(tokenId);
    }

    function tokenURI(uint256 tokenId)
        public
        view
        override(ERC721, ERC721URIStorage)
        returns (string memory)
    {
        return ERC721URIStorage.tokenURI(tokenId);
    }

    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual override(ERC721, ERC721Enumerable) {
        if (autoRewardIsActive) processReward(gasForProcessing);
        super._beforeTokenTransfer(from, to, tokenId);
    }

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

    function currentRate() public view returns (uint256) {
        if (totalSupply() == 0) return 0;
        return reflectionBalance / totalSupply();
    }

    function clearUserCustomToken(address user) external {
        require(
            user == _msgSender() || hasRole(DEFAULT_ADMIN_ROLE, _msgSender()),
            "You can only clear custom tokens for yourself!"
        );
        hasCustomClaimToken[user] = false;
    }

    function updateUserCustomToken(address user, address token)
        external
        returns (address)
    {
        require(
            user == _msgSender() || hasRole(DEFAULT_ADMIN_ROLE, _msgSender()),
            "You can only set custom tokens for yourself!"
        );
        hasCustomClaimToken[user] = true;
        return userCustomClaimToken[user] = token;
    }

    function defaultClaimToDoge(address user) internal {
        hasCustomClaimToken[user] = true;
        userCustomClaimToken[user] = 0xbA2aE424d960c26247Dd6c32edC70B295c744C43;
    }

    function swapEthForCustomToken(address user, uint256 amt)
        internal
        returns (bool)
    {
        address[] memory path = new address[](2);
        path[0] = uniswapV2Router.WETH();
        path[1] = userCustomClaimToken[user];
        try
            uniswapV2Router.swapExactETHForTokens{value: amt}(
                0,
                path,
                user,
                block.timestamp + 2
            )
        {
            return true;
        } catch {
            return false;
        }
    }

    function claimRewards() public {
        uint256 count = balanceOf(msg.sender);
        for (uint256 i = 0; i < count; i++) {
            uint256 tokenId = tokenOfOwnerByIndex(msg.sender, i);
            claimReward(tokenId);
        }
    }

    function processReward(uint256 gas) public {
        uint256 numberOfPunks = _tokenIdTracker.current();
        if (numberOfPunks == 0) return;

        uint256 _lastProcessedNFT = lastProcessedNFT;
        uint256 gasUsed = 0;
        uint256 gasLeft = gasleft();
        uint256 iterations = 0;

        while (gasUsed < gas && iterations < numberOfPunks) {
            _lastProcessedNFT++;

            if (_lastProcessedNFT >= numberOfPunks) {
                _lastProcessedNFT = 0;
            }

            claimRewardAuto(_lastProcessedNFT);

            iterations++;

            uint256 newGasLeft = gasleft();

            if (gasLeft > newGasLeft) {
                gasUsed = gasUsed + (gasLeft - newGasLeft);
            }

            gasLeft = newGasLeft;
        }

        lastProcessedNFT = _lastProcessedNFT;
    }

    function getReflectionBalances() public view returns (uint256) {
        uint256 count = balanceOf(msg.sender);
        uint256 total = 0;
        for (uint256 i = 0; i < count; i++) {
            uint256 tokenId = tokenOfOwnerByIndex(msg.sender, i);
            total += getReflectionBalance(tokenId);
        }
        return total;
    }

    function claimReward(uint256 tokenId) public {
        require(
            ownerOf(tokenId) == _msgSender(),
            "Only owner can claim rewards"
        );

        uint256 balance = getReflectionBalance(tokenId);
        uint256 lastDividend = lastDividendAt[tokenId];
        if (balance > 0) {
            lastDividendAt[tokenId] = totalDividend;

            if (hasCustomClaimToken[ownerOf(tokenId)] == true) {
                bool success = swapEthForCustomToken(ownerOf(tokenId), balance);
                if (!success) {
                    (bool secondSuccess, ) = ownerOf(tokenId).call{
                        value: balance,
                        gas: 3000
                    }("");
                    if (!secondSuccess) {
                        lastDividendAt[tokenId] = lastDividend;
                    }
                }
            } else {
                payable(ownerOf(tokenId)).transfer(balance);
            }
        }
    }

    function claimRewardAuto(uint256 tokenId) internal {
        uint256 balance = getReflectionBalance(tokenId);
        uint256 lastDividend = lastDividendAt[tokenId];

        if (balance > 0) {
            lastDividendAt[tokenId] = totalDividend;

            if (
                hasCustomClaimToken[ownerOf(tokenId)] == true &&
                autoRewardAsCustomIsActive == true
            ) {
                bool success = swapEthForCustomToken(ownerOf(tokenId), balance);
                if (!success) {
                    (bool secondSuccess, ) = ownerOf(tokenId).call{
                        value: balance,
                        gas: 3000
                    }("");
                    if (!secondSuccess) {
                        lastDividendAt[tokenId] = lastDividend;
                    }
                }
            } else {
                payable(ownerOf(tokenId)).transfer(balance);
            }
        }
    }

    function getReflectionBalance(uint256 tokenId)
        public
        view
        returns (uint256)
    {
        return totalDividend - lastDividendAt[tokenId];
    }

    function splitBalance(uint256 amount) private {
        uint256 reflectionShare = amount / reflectionFee;
        uint256 mintingShare = amount - reflectionShare;
        reflectDividend(reflectionShare);
        payable(_paymentSplitter).transfer(mintingShare);
    }

    function reflectDividend(uint256 amount) private {
        reflectionBalance = reflectionBalance + amount;
        totalDividend = totalDividend + (amount / totalSupply());
    }

    function transferAnyERC20Tokens(
        address _tokenAddr,
        address _to,
        uint256 _amount
    ) external {
        require(
            hasRole(DEFAULT_ADMIN_ROLE, _msgSender()),
            "Does not have Admin role"
        );
        require(IERC20(_tokenAddr).transfer(_to, _amount), "Transfer failed");
    }

    function transferBNB(address payable recipient, uint256 amount) external {
        require(
            hasRole(DEFAULT_ADMIN_ROLE, _msgSender()),
            "Does not have Admin role"
        );
        require(
            address(this).balance >= amount,
            "Address: insufficient balance"
        );

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

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

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 {
        require(operator != _msgSender(), "ERC721: approve to caller");

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

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view 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);
    }

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

    /**
     * @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 of token that is not own");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(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 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 {}
}

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

pragma solidity ^0.8.0;

interface IERC20 {


    function balanceOf(address account) external view returns (uint256);

    function transfer(address recipient, uint256 amount) external returns (bool);

}

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

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

    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);

}

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

import './IUniswapV2Router01.sol';

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

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

File 6 of 22 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT

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 7 of 22 : ERC721URIStorage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../ERC721.sol";

/**
 * @dev ERC721 token with storage based token URI management.
 */
abstract contract ERC721URIStorage is ERC721 {
    using Strings for uint256;

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

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

        string memory _tokenURI = _tokenURIs[tokenId];
        string memory base = _baseURI();

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

        return super.tokenURI(tokenId);
    }

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

    /**
     * @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 override {
        super._burn(tokenId);

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

File 8 of 22 : AccessControlEnumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IAccessControlEnumerable.sol";
import "./AccessControl.sol";
import "../utils/structs/EnumerableSet.sol";

/**
 * @dev Extension of {AccessControl} that allows enumerating the members of each role.
 */
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {
    using EnumerableSet for EnumerableSet.AddressSet;

    mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;

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

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

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

    /**
     * @dev Overload {grantRole} to track enumerable memberships
     */
    function grantRole(bytes32 role, address account) public virtual override(AccessControl, IAccessControl) {
        super.grantRole(role, account);
        _roleMembers[role].add(account);
    }

    /**
     * @dev Overload {revokeRole} to track enumerable memberships
     */
    function revokeRole(bytes32 role, address account) public virtual override(AccessControl, IAccessControl) {
        super.revokeRole(role, account);
        _roleMembers[role].remove(account);
    }

    /**
     * @dev Overload {renounceRole} to track enumerable memberships
     */
    function renounceRole(bytes32 role, address account) public virtual override(AccessControl, IAccessControl) {
        super.renounceRole(role, account);
        _roleMembers[role].remove(account);
    }

    /**
     * @dev Overload {_setupRole} to track enumerable memberships
     */
    function _setupRole(bytes32 role, address account) internal virtual override {
        super._setupRole(role, account);
        _roleMembers[role].add(account);
    }
}

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

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 10 of 22 : Counters.sol
// SPDX-License-Identifier: MIT

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 11 of 22 : IERC721.sol
// SPDX-License-Identifier: MIT

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 22 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

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 22 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT

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 22 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

        (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 22 : Strings.sol
// SPDX-License-Identifier: MIT

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 16 of 22 : ERC165.sol
// SPDX-License-Identifier: MIT

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 17 of 22 : IERC165.sol
// SPDX-License-Identifier: MIT

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 18 of 22 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT

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

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

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

pragma solidity ^0.8.0;

import "./IAccessControl.sol";

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

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

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

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

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

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

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

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

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

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

        _revokeRole(role, account);
    }

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

            if (lastIndex != toDeleteIndex) {
                bytes32 lastvalue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastvalue;
                // Update the index for the moved value
                set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
            }

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

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

            return true;
        } else {
            return false;
        }
    }

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

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

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

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

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

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

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

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

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

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly {
            result := store
        }

        return result;
    }
}

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

pragma solidity ^0.8.0;

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

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

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

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

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

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

Contract ABI

[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"base_token_URI","type":"string"},{"internalType":"string","name":"contract_URI","type":"string"},{"internalType":"uint256","name":"mintPrice","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"},{"internalType":"uint256","name":"reflection_fee","type":"uint256"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"address payable","name":"payment_splitter_address","type":"address"}],"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":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_tokenIdTracker","outputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"autoRewardAsCustomIsActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"autoRewardIsActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"claimReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"clearUserCustomToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"creator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultToDoge","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"flipAutoRewardAsCustom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flipAutoRewardState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flipDefaultToDoge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flipSaleState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gasForProcessing","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllMinters","outputs":[{"internalType":"address[10]","name":"","type":"address[10]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_roles","type":"bytes32"}],"name":"getAllRoleMembers","outputs":[{"internalType":"address[10]","name":"","type":"address[10]"}],"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":"tokenId","type":"uint256"}],"name":"getReflectionBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReflectionBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"hasCustomClaimToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastProcessedNFT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mineReserves","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"mintById","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"paymentSplitter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"gas","type":"uint256"}],"name":"processReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reflectionBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reflectionFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"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":[],"name":"saleIsActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newContractURI","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintPrice","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_reflectionFee","type":"uint256"}],"name":"setReflectionFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"setTokenURI","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":"totalDividend","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":"_tokenAddr","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferAnyERC20Tokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferBNB","outputs":[],"stateMutability":"nonpayable","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":[],"name":"uniswapV2Router","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"updateGasForProcessing","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"newAddress","type":"address"}],"name":"updatePaymentSplitter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAddress","type":"address"}],"name":"updateUniswapV2Router","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"token","type":"address"}],"name":"updateUserCustomToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userCustomClaimToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

6080604052620493e0601755601d805463ffffffff191663010101001790553480156200002b57600080fd5b50604051620048c4380380620048c48339810160408190526200004e9162000424565b88518990899062000067906002906020850190620002aa565b5080516200007d906003906020840190620002aa565b5050506011859055601284905586516200009f90600f9060208a0190620002aa565b508551620000b5906010906020890190620002aa565b506015839055620000c860008362000145565b620000f47f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a68362000145565b600e80547310ed43c718714eb63d5aa57b78b54704e256024e6001600160a01b031991821617909155601380549091166001600160a01b039290921691909117905550620005739650505050505050565b6200015c82826200018860201b620023731760201c565b6000828152600160209081526040909120620001839183906200237d62000198821b17901c565b505050565b620001948282620001b8565b5050565b6000620001af836001600160a01b03841662000258565b90505b92915050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000194576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620002143390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000818152600183016020526040812054620002a157508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620001b2565b506000620001b2565b828054620002b89062000520565b90600052602060002090601f016020900481019282620002dc576000855562000327565b82601f10620002f757805160ff191683800117855562000327565b8280016001018555821562000327579182015b82811115620003275782518255916020019190600101906200030a565b506200033592915062000339565b5090565b5b808211156200033557600081556001016200033a565b80516001600160a01b03811681146200036857600080fd5b919050565b600082601f8301126200037f57600080fd5b81516001600160401b03808211156200039c576200039c6200055d565b604051601f8301601f19908116603f01168101908282118183101715620003c757620003c76200055d565b81604052838152602092508683858801011115620003e457600080fd5b600091505b83821015620004085785820183015181830184015290820190620003e9565b838211156200041a5760008385830101525b9695505050505050565b60008060008060008060008060006101208a8c0312156200044457600080fd5b89516001600160401b03808211156200045c57600080fd5b6200046a8d838e016200036d565b9a5060208c01519150808211156200048157600080fd5b6200048f8d838e016200036d565b995060408c0151915080821115620004a657600080fd5b620004b48d838e016200036d565b985060608c0151915080821115620004cb57600080fd5b50620004da8c828d016200036d565b96505060808a0151945060a08a0151935060c08a015192506200050060e08b0162000350565b9150620005116101008b0162000350565b90509295985092959850929598565b600181811c908216806200053557607f821691505b602082108114156200055757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b61434180620005836000396000f3fe6080604052600436106103f95760003560e01c806370a0823111610213578063ae169a5011610123578063e547be69116100ab578063eb17fba31161007a578063eb17fba314610beb578063eb8d244414610c0b578063ed4a6b0c14610c25578063f833513d14610c43578063f9f8bdb714610c6257600080fd5b8063e547be6914610b37578063e65c9f6514610b57578063e8a3d48514610b8d578063e985e9c514610ba257600080fd5b8063c87b56dd116100f2578063c87b56dd14610a85578063ca15c87314610aa5578063d539139314610ac5578063d547741f14610ae7578063d643357a14610b0757600080fd5b8063ae169a5014610a05578063b88d4fde14610a25578063bc040a6d14610a45578063bc25b7f014610a6557600080fd5b806395d89b41116101a6578063a045442c11610175578063a045442c14610978578063a217fddf1461099a578063a22cb465146109af578063a6fa0cb4146109cf578063ad79469d146109ef57600080fd5b806395d89b411461092157806398bcede9146109365780639c1b8af51461094d578063a035b1fe1461096357600080fd5b80639010d07c116101e25780639010d07c146108a157806391b7f5ed146108c157806391d14854146108e1578063938e3d7b1461090157600080fd5b806370a082311461082a57806383ad79941461084a5780638449932e14610860578063871c128d1461088157600080fd5b806334918dfd1161030e5780634f6ccce7116102a15780636352211e116102705780636352211e146107a057806365582547146107c057806365b8dbc0146107d55780636a395ccb146107f55780636d5538e11461081557600080fd5b80634f6ccce71461070a5780634fd2af551461072a578063510b51581461074a57806355f804b31461078057600080fd5b80634131ff99116102dd5780634131ff991461069e57806342842e0e146106b4578063469e5455146106d45780634b6acafb146106f457600080fd5b806334918dfd1461063457806336568abe14610649578063372500ab146106695780633c51c82b1461067e57600080fd5b806313d788031161039157806318160ddd1161036057806318160ddd1461058f57806323b872dd146105a4578063248a9ca3146105c45780632f2ff15d146105f45780632f745c591461061457600080fd5b806313d788031461050f578063146d9f8d1461052f578063162094c41461054f5780631694505e1461056f57600080fd5b8063081812fc116103cd578063081812fc1461049857806308598d5a146104d0578063095ea7b3146104e75780631249c58b1461050757600080fd5b8062fe50c6146103fe57806301eb99ec1461043157806301ffc9a71461044657806306fdde0314610476575b600080fd5b34801561040a57600080fd5b5061041e610419366004613cc4565b610c77565b6040519081526020015b60405180910390f35b34801561043d57600080fd5b5061041e610c99565b34801561045257600080fd5b50610466610461366004613d24565b610cf1565b6040519015158152602001610428565b34801561048257600080fd5b5061048b610cfc565b6040516104289190613f8c565b3480156104a457600080fd5b506104b86104b3366004613cc4565b610d8e565b6040516001600160a01b039091168152602001610428565b3480156104dc57600080fd5b506104e5610e1b565b005b3480156104f357600080fd5b506104e5610502366004613aa6565b610e5f565b6104e5610f75565b34801561051b57600080fd5b506104e561052a366004613cc4565b611188565b34801561053b57600080fd5b506104e561054a366004613a6c565b611221565b34801561055b57600080fd5b506104e561056a366004613d93565b611328565b34801561057b57600080fd5b50600e546104b8906001600160a01b031681565b34801561059b57600080fd5b50600a5461041e565b3480156105b057600080fd5b506104e56105bf366004613b0b565b61139e565b3480156105d057600080fd5b5061041e6105df366004613cc4565b60009081526020819052604090206001015490565b34801561060057600080fd5b506104e561060f366004613cdd565b6113cf565b34801561062057600080fd5b5061041e61062f366004613aa6565b6113f1565b34801561064057600080fd5b506104e5611487565b34801561065557600080fd5b506104e5610664366004613cdd565b6114c2565b34801561067557600080fd5b506104e56114e4565b34801561068a57600080fd5b506104e5610699366004613cc4565b611526565b3480156106aa57600080fd5b5061041e60145481565b3480156106c057600080fd5b506104e56106cf366004613b0b565b6115bf565b3480156106e057600080fd5b506104e56106ef366004613cc4565b6115da565b34801561070057600080fd5b5061041e60165481565b34801561071657600080fd5b5061041e610725366004613cc4565b61165f565b34801561073657600080fd5b506104b8610745366004613ad2565b6116f2565b34801561075657600080fd5b506104b8610765366004613cc4565b601a602052600090815260409020546001600160a01b031681565b34801561078c57600080fd5b506104e561079b366004613d5e565b6117bc565b3480156107ac57600080fd5b506104b86107bb366004613cc4565b6117f6565b3480156107cc57600080fd5b506104e561186d565b3480156107e157600080fd5b506104e56107f0366004613a6c565b6118b5565b34801561080157600080fd5b506104e5610810366004613b0b565b6119b2565b34801561082157600080fd5b506104e5611a99565b34801561083657600080fd5b5061041e610845366004613a6c565b611adf565b34801561085657600080fd5b5061041e60155481565b34801561086c57600080fd5b50601d54610466906301000000900460ff1681565b34801561088d57600080fd5b506104e561089c366004613cc4565b611b66565b3480156108ad57600080fd5b506104b86108bc366004613d02565b611c78565b3480156108cd57600080fd5b506104e56108dc366004613cc4565b611c97565b3480156108ed57600080fd5b506104666108fc366004613cdd565b611cc3565b34801561090d57600080fd5b506104e561091c366004613d5e565b611cec565b34801561092d57600080fd5b5061048b611d26565b34801561094257600080fd5b50600d5461041e9081565b34801561095957600080fd5b5061041e60175481565b34801561096f57600080fd5b5060115461041e565b34801561098457600080fd5b5061098d611d35565b6040516104289190613ee7565b3480156109a657600080fd5b5061041e600081565b3480156109bb57600080fd5b506104e56109ca366004613bcc565b611dba565b3480156109db57600080fd5b5061098d6109ea366004613cc4565b611e7f565b3480156109fb57600080fd5b5061041e60185481565b348015610a1157600080fd5b506104e5610a20366004613cc4565b611ef0565b348015610a3157600080fd5b506104e5610a40366004613b4c565b612099565b348015610a5157600080fd5b50601d546104669062010000900460ff1681565b348015610a7157600080fd5b506104e5610a80366004613a6c565b6120cb565b348015610a9157600080fd5b5061048b610aa0366004613cc4565b61216c565b348015610ab157600080fd5b5061041e610ac0366004613cc4565b612177565b348015610ad157600080fd5b5061041e6000805160206142ec83398151915281565b348015610af357600080fd5b506104e5610b02366004613cdd565b61218e565b348015610b1357600080fd5b50610466610b22366004613a6c565b601b6020526000908152604090205460ff1681565b348015610b4357600080fd5b506104e5610b52366004613cc4565b612198565b348015610b6357600080fd5b506104b8610b72366004613a6c565b601c602052600090815260409020546001600160a01b031681565b348015610b9957600080fd5b5061048b612206565b348015610bae57600080fd5b50610466610bbd366004613ad2565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610bf757600080fd5b506104e5610c06366004613aa6565b612215565b348015610c1757600080fd5b50601d546104669060ff1681565b348015610c3157600080fd5b506013546001600160a01b03166104b8565b348015610c4f57600080fd5b50601d5461046690610100900460ff1681565b348015610c6e57600080fd5b5061041e612349565b600081815260196020526040812054601654610c939190614180565b92915050565b600080610ca533611adf565b90506000805b82811015610cea576000610cbf33836113f1565b9050610cca81610c77565b610cd49084614135565b9250508080610ce290614215565b915050610cab565b5092915050565b6000610c9382612392565b606060028054610d0b906141da565b80601f0160208091040260200160405190810160405280929190818152602001828054610d37906141da565b8015610d845780601f10610d5957610100808354040283529160200191610d84565b820191906000526020600020905b815481529060010190602001808311610d6757829003601f168201915b5050505050905090565b6000610d99826123b7565b610dff5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600660205260409020546001600160a01b031690565b610e26600033611cc3565b610e425760405162461bcd60e51b8152600401610df690614035565b601d805461ff001981166101009182900460ff1615909102179055565b6000610e6a826117f6565b9050806001600160a01b0316836001600160a01b03161415610ed85760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610df6565b336001600160a01b0382161480610ef45750610ef48133610bbd565b610f665760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610df6565b610f7083836123d4565b505050565b601d5460ff16610fc75760405162461bcd60e51b815260206004820152601b60248201527f53616c65206d7573742062652061637469766520746f206d696e7400000000006044820152606401610df6565b60115434146110185760405162461bcd60e51b815260206004820152601760248201527f4d7573742073656e6420636f72726563742070726963650000000000000000006044820152606401610df6565b601254600a541061106b5760405162461bcd60e51b815260206004820152601960248201527f416c6c204e4654732068617665206265656e206d696e746564000000000000006044820152606401610df6565b61107c611077600d5490565b6123b7565b156110945761108f600d80546001019055565b61106b565b6110a6336110a1600d5490565b612442565b601d546301000000900460ff161561110e5761110e336001600160a01b03166000908152601b60209081526040808320805460ff19166001179055601c909152902080546001600160a01b03191673ba2ae424d960c26247dd6c32edc70b295c744c43179055565b33601a600061111c600d5490565b815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b031602179055506016546019600061115e600d5490565b815260208101919091526040016000205561117d600d80546001019055565b61118634612581565b565b6000611193600d5490565b90508061119e575050565b6018546000805a905060005b85831080156111b857508481105b1561121757836111c781614215565b9450508484106111d657600093505b6111df846125e4565b806111e981614215565b91505060005a905080831115611210576112038184614180565b61120d9085614135565b93505b91506111aa565b5050506018555050565b600e546001600160a01b03828116911614156112945760405162461bcd60e51b815260206004820152602c60248201527f546865207061796d656e7453706c697474657220616c7265616479206861732060448201526b74686174206164647265737360a01b6064820152608401610df6565b61129f600033611cc3565b6113065760405162461bcd60e51b815260206004820152603260248201527f4d75737420686176652061646d696e20726f6c6520746f2075706461746520746044820152713432903830bcb6b2b73a29b83634ba3a32b960711b6064820152608401610df6565b601380546001600160a01b0319166001600160a01b0392909216919091179055565b611333600033611cc3565b6113905760405162461bcd60e51b815260206004820152602860248201527f4d75737420686176652061646d696e20726f6c6520746f206368616e676520746044820152676f6b656e2055524960c01b6064820152608401610df6565b61139a8282612676565b5050565b6113a83382612701565b6113c45760405162461bcd60e51b8152600401610df69061406c565b610f708383836127eb565b6113d98282612996565b6000828152600160205260409020610f70908261237d565b60006113fc83611adf565b821061145e5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610df6565b506001600160a01b03919091166000908152600860209081526040808320938352929052205490565b611492600033611cc3565b6114ae5760405162461bcd60e51b8152600401610df690614035565b601d805460ff19811660ff90911615179055565b6114cc82826129bc565b6000828152600160205260409020610f709082612a36565b60006114ef33611adf565b905060005b8181101561139a57600061150833836113f1565b905061151381611ef0565b508061151e81614215565b9150506114f4565b61153e6000805160206142ec83398151915233611cc3565b6115865760405162461bcd60e51b8152602060048201526019602482015278446f6573206e6f742068617665204d696e74657220726f6c6560381b6044820152606401610df6565b61158f81612a4b565b601654600091825260196020908152604080842092909255601a9052902080546001600160a01b03191633179055565b610f7083838360405180602001604052806000815250612099565b6115f26000805160206142ec83398151915233611cc3565b61163a5760405162461bcd60e51b8152602060048201526019602482015278446f6573206e6f742068617665204d696e74657220726f6c6560381b6044820152606401610df6565b60005b8181101561139a5761164d612a58565b8061165781614215565b91505061163d565b600061166a600a5490565b82106116cd5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610df6565b600a82815481106116e0576116e0614286565b90600052602060002001549050919050565b60006001600160a01b0383163314806117115750611711600033611cc3565b6117725760405162461bcd60e51b815260206004820152602c60248201527f596f752063616e206f6e6c792073657420637573746f6d20746f6b656e73206660448201526b6f7220796f757273656c662160a01b6064820152608401610df6565b506001600160a01b039182166000908152601b602090815260408083208054600160ff19909116179055601c909152902080546001600160a01b0319169282169290921790915590565b6117c7600033611cc3565b6117e35760405162461bcd60e51b8152600401610df6906140bd565b805161139a90600f90602084019061393c565b6000818152600460205260408120546001600160a01b031680610c935760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610df6565b611878600033611cc3565b6118945760405162461bcd60e51b8152600401610df690614035565b601d805463ff00000019811663010000009182900460ff1615909102179055565b600e546001600160a01b038281169116141561191f5760405162461bcd60e51b815260206004820152602360248201527f54686520726f7574657220616c7265616479206861732074686174206164647260448201526265737360e81b6064820152608401610df6565b61192a600033611cc3565b6119905760405162461bcd60e51b815260206004820152603160248201527f4d75737420686176652061646d696e20726f6c6520746f207570646174652074604482015270686520726f75746572206164647265737360781b6064820152608401610df6565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6119bd600033611cc3565b6119d95760405162461bcd60e51b8152600401610df690614035565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401602060405180830381600087803b158015611a2357600080fd5b505af1158015611a37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a5b9190613ca7565b610f705760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606401610df6565b611aa4600033611cc3565b611ac05760405162461bcd60e51b8152600401610df690614035565b601d805462ff0000198116620100009182900460ff1615909102179055565b60006001600160a01b038216611b4a5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610df6565b506001600160a01b031660009081526005602052604090205490565b62030d408110158015611b7c57506207a1208111155b611be55760405162461bcd60e51b815260206004820152603460248201527f676173466f7250726f63657373696e67206d757374206265206265747765656e6044820152730203230302c30303020616e64203530302c3030360641b6064820152608401610df6565b601754811415611c4c5760405162461bcd60e51b815260206004820152602c60248201527f43616e6e6f742075706461746520676173466f7250726f63657373696e67207460448201526b6f2073616d652076616c756560a01b6064820152608401610df6565b611c57600033611cc3565b611c735760405162461bcd60e51b8152600401610df690613f9f565b601755565b6000828152600160205260408120611c909083612afe565b9392505050565b611ca2600033611cc3565b611cbe5760405162461bcd60e51b8152600401610df690613f9f565b601155565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b611cf7600033611cc3565b611d135760405162461bcd60e51b8152600401610df6906140bd565b805161139a90601090602084019061393c565b606060038054610d0b906141da565b611d3d6139c0565b6000611d566000805160206142ec833981519152612177565b9050611d606139c0565b60005b82811015610cea57611d836000805160206142ec83398151915282611c78565b8282600a8110611d9557611d95614286565b6001600160a01b03909216602092909202015280611db281614215565b915050611d63565b6001600160a01b038216331415611e135760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610df6565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611e876139c0565b6000611e9283612177565b9050611e9c6139c0565b60005b82811015611ee857611eb18582611c78565b8282600a8110611ec357611ec3614286565b6001600160a01b03909216602092909202015280611ee081614215565b915050611e9f565b509392505050565b33611efa826117f6565b6001600160a01b031614611f505760405162461bcd60e51b815260206004820152601c60248201527f4f6e6c79206f776e65722063616e20636c61696d2072657761726473000000006044820152606401610df6565b6000611f5b82610c77565b6000838152601960205260409020549091508115610f7057601654600084815260196020526040812091909155601b90611f94856117f6565b6001600160a01b0316815260208101919091526040016000205460ff16151560011415612058576000611fcf611fc9856117f6565b84612b0a565b905080612052576000611fe1856117f6565b6001600160a01b031684610bb890604051600060405180830381858888f193505050503d8060008114612030576040519150601f19603f3d011682016040523d82523d6000602084013e612035565b606091505b50509050806120505760008581526019602052604090208390555b505b50505050565b612061836117f6565b6001600160a01b03166108fc839081150290604051600060405180830381858888f19350505050158015612052573d6000803e3d6000fd5b6120a33383612701565b6120bf5760405162461bcd60e51b8152600401610df69061406c565b61205284848484612cb8565b6001600160a01b0381163314806120e857506120e8600033611cc3565b61214b5760405162461bcd60e51b815260206004820152602e60248201527f596f752063616e206f6e6c7920636c65617220637573746f6d20746f6b656e7360448201526d20666f7220796f757273656c662160901b6064820152608401610df6565b6001600160a01b03166000908152601b60205260409020805460ff19169055565b6060610c9382612ceb565b6000818152600160205260408120610c9390612e4d565b6114cc8282612e57565b6121a3600033611cc3565b6122015760405162461bcd60e51b815260206004820152602960248201527f4d75737420686176652061646d696e20726f6c6520746f206368616e6765207260448201526832b33632b1ba34b7b760b91b6064820152608401610df6565b601555565b606060108054610d0b906141da565b612220600033611cc3565b61223c5760405162461bcd60e51b8152600401610df690614035565b8047101561228c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610df6565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146122d9576040519150601f19603f3d011682016040523d82523d6000602084013e6122de565b606091505b5050905080610f705760405162461bcd60e51b815260206004820152603160248201527f556e61626c6520746f2073656e642076616c75652c20726563697069656e74206044820152701b585e481a185d99481c995d995c9d1959607a1b6064820152608401610df6565b6000612354600a5490565b61235e5750600090565b600a5460145461236e919061414d565b905090565b61139a8282612e7d565b6000611c90836001600160a01b038416612f01565b60006001600160e01b0319821663780e9d6360e01b1480610c935750610c9382612f50565b6000908152600460205260409020546001600160a01b0316151590565b600081815260066020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612409826117f6565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6001600160a01b0382166124985760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610df6565b6124a1816123b7565b156124ee5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610df6565b6124fa60008383612f90565b6001600160a01b0382166000908152600560205260408120805460019290612523908490614135565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600060155482612591919061414d565b9050600061259f8284614180565b90506125aa82612fb6565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015612052573d6000803e3d6000fd5b60006125ef82610c77565b6000838152601960205260409020549091508115610f7057601654600084815260196020526040812091909155601b90612628856117f6565b6001600160a01b0316815260208101919091526040016000205460ff16151560011480156126635750601d5462010000900460ff1615156001145b15612058576000611fcf611fc9856117f6565b61267f826123b7565b6126e25760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b6064820152608401610df6565b6000828152600c602090815260409091208251610f709284019061393c565b600061270c826123b7565b61276d5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610df6565b6000612778836117f6565b9050806001600160a01b0316846001600160a01b031614806127b35750836001600160a01b03166127a884610d8e565b6001600160a01b0316145b806127e357506001600160a01b0380821660009081526007602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b03166127fe826117f6565b6001600160a01b0316146128665760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610df6565b6001600160a01b0382166128c85760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610df6565b6128d3838383612f90565b6128de6000826123d4565b6001600160a01b0383166000908152600560205260408120805460019290612907908490614180565b90915550506001600160a01b0382166000908152600560205260408120805460019290612935908490614135565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000828152602081905260409020600101546129b28133612fe7565b610f708383612e7d565b6001600160a01b0381163314612a2c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610df6565b61139a828261304b565b6000611c90836001600160a01b0384166130b0565b612a5533826131a3565b50565b612a64611077600d5490565b15612a7c57612a77600d80546001019055565b612a58565b612a8e33612a89600d5490565b6131a3565b60165460196000612a9e600d5490565b81526020019081526020016000208190555033601a6000612abe600d5490565b815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550611186600d80546001019055565b6000611c9083836131bd565b604080516002808252606082018352600092839291906020830190803683375050600e54604080516315ab88c960e31b815290519394506001600160a01b039091169263ad5c464892506004808301926020929190829003018186803b158015612b7357600080fd5b505afa158015612b87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bab9190613a89565b81600081518110612bbe57612bbe614286565b6001600160a01b039283166020918202929092018101919091528582166000908152601c9091526040902054825191169082906001908110612c0257612c02614286565b6001600160a01b039283166020918202929092010152600e5416637ff36ab58460008488612c31426002614135565b6040518663ffffffff1660e01b8152600401612c509493929190613f22565b6000604051808303818588803b158015612c6957600080fd5b505af193505050508015612c9f57506040513d6000823e601f3d908101601f19168201604052612c9c9190810190613bfa565b60015b612cad576000915050610c93565b506001915050610c93565b612cc38484846127eb565b612ccf848484846131e7565b6120525760405162461bcd60e51b8152600401610df690613fe3565b6060612cf6826123b7565b612d5c5760405162461bcd60e51b815260206004820152603160248201527f45524337323155524953746f726167653a2055524920717565727920666f72206044820152703737b732bc34b9ba32b73a103a37b5b2b760791b6064820152608401610df6565b6000828152600c602052604081208054612d75906141da565b80601f0160208091040260200160405190810160405280929190818152602001828054612da1906141da565b8015612dee5780601f10612dc357610100808354040283529160200191612dee565b820191906000526020600020905b815481529060010190602001808311612dd157829003601f168201915b505050505090506000612dff6132f4565b9050805160001415612e12575092915050565b815115612e44578082604051602001612e2c929190613e06565b60405160208183030381529060405292505050919050565b6127e384613303565b6000610c93825490565b600082815260208190526040902060010154612e738133612fe7565b610f70838361304b565b612e878282611cc3565b61139a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055612ebd3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000818152600183016020526040812054612f4857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610c93565b506000610c93565b60006001600160e01b031982166380ac58cd60e01b1480612f8157506001600160e01b03198216635b5e139f60e01b145b80610c935750610c93826133cd565b601d54610100900460ff1615612fab57612fab601754611188565b610f708383836133f2565b80601454612fc49190614135565b601455600a54612fd4908261414d565b601654612fe19190614135565b60165550565b612ff18282611cc3565b61139a57613009816001600160a01b031660146134aa565b6130148360206134aa565b604051602001613025929190613e35565b60408051601f198184030181529082905262461bcd60e51b8252610df691600401613f8c565b6130558282611cc3565b1561139a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600081815260018301602052604081205480156131995760006130d4600183614180565b85549091506000906130e890600190614180565b905081811461314d57600086600001828154811061310857613108614286565b906000526020600020015490508087600001848154811061312b5761312b614286565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061315e5761315e614270565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610c93565b6000915050610c93565b61139a828260405180602001604052806000815250613646565b60008260000182815481106131d4576131d4614286565b9060005260206000200154905092915050565b60006001600160a01b0384163b156132e957604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061322b903390899088908890600401613eaa565b602060405180830381600087803b15801561324557600080fd5b505af1925050508015613275575060408051601f3d908101601f1916820190925261327291810190613d41565b60015b6132cf573d8080156132a3576040519150601f19603f3d011682016040523d82523d6000602084013e6132a8565b606091505b5080516132c75760405162461bcd60e51b8152600401610df690613fe3565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506127e3565b506001949350505050565b6060600f8054610d0b906141da565b606061330e826123b7565b6133725760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610df6565b600061337c6132f4565b9050600081511161339c5760405180602001604052806000815250611c90565b806133a684613679565b6040516020016133b7929190613e06565b6040516020818303038152906040529392505050565b60006001600160e01b03198216635a05180f60e01b1480610c935750610c9382613777565b6001600160a01b03831661344d5761344881600a80546000838152600b60205260408120829055600182018355919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80155565b613470565b816001600160a01b0316836001600160a01b0316146134705761347083826137ac565b6001600160a01b03821661348757610f7081613849565b826001600160a01b0316826001600160a01b031614610f7057610f7082826138f8565b606060006134b9836002614161565b6134c4906002614135565b67ffffffffffffffff8111156134dc576134dc61429c565b6040519080825280601f01601f191660200182016040528015613506576020820181803683370190505b509050600360fc1b8160008151811061352157613521614286565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061355057613550614286565b60200101906001600160f81b031916908160001a9053506000613574846002614161565b61357f906001614135565b90505b60018111156135f7576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106135b3576135b3614286565b1a60f81b8282815181106135c9576135c9614286565b60200101906001600160f81b031916908160001a90535060049490941c936135f0816141c3565b9050613582565b508315611c905760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610df6565b6136508383612442565b61365d60008484846131e7565b610f705760405162461bcd60e51b8152600401610df690613fe3565b60608161369d5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156136c757806136b181614215565b91506136c09050600a8361414d565b91506136a1565b60008167ffffffffffffffff8111156136e2576136e261429c565b6040519080825280601f01601f19166020018201604052801561370c576020820181803683370190505b5090505b84156127e357613721600183614180565b915061372e600a86614230565b613739906030614135565b60f81b81838151811061374e5761374e614286565b60200101906001600160f81b031916908160001a905350613770600a8661414d565b9450613710565b60006001600160e01b03198216637965db0b60e01b1480610c9357506301ffc9a760e01b6001600160e01b0319831614610c93565b600060016137b984611adf565b6137c39190614180565b600083815260096020526040902054909150808214613816576001600160a01b03841660009081526008602090815260408083208584528252808320548484528184208190558352600990915290208190555b5060009182526009602090815260408084208490556001600160a01b039094168352600881528383209183525290812055565b600a5460009061385b90600190614180565b6000838152600b6020526040812054600a805493945090928490811061388357613883614286565b9060005260206000200154905080600a83815481106138a4576138a4614286565b6000918252602080832090910192909255828152600b9091526040808220849055858252812055600a8054806138dc576138dc614270565b6001900381819060005260206000200160009055905550505050565b600061390383611adf565b6001600160a01b039093166000908152600860209081526040808320868452825280832085905593825260099052919091209190915550565b828054613948906141da565b90600052602060002090601f01602090048101928261396a57600085556139b0565b82601f1061398357805160ff19168380011785556139b0565b828001600101855582156139b0579182015b828111156139b0578251825591602001919060010190613995565b506139bc9291506139df565b5090565b604051806101400160405280600a906020820280368337509192915050565b5b808211156139bc57600081556001016139e0565b600067ffffffffffffffff831115613a0e57613a0e61429c565b613a21601f8401601f1916602001614104565b9050828152838383011115613a3557600080fd5b828260208301376000602084830101529392505050565b600082601f830112613a5d57600080fd5b611c90838335602085016139f4565b600060208284031215613a7e57600080fd5b8135611c90816142b2565b600060208284031215613a9b57600080fd5b8151611c90816142b2565b60008060408385031215613ab957600080fd5b8235613ac4816142b2565b946020939093013593505050565b60008060408385031215613ae557600080fd5b8235613af0816142b2565b91506020830135613b00816142b2565b809150509250929050565b600080600060608486031215613b2057600080fd5b8335613b2b816142b2565b92506020840135613b3b816142b2565b929592945050506040919091013590565b60008060008060808587031215613b6257600080fd5b8435613b6d816142b2565b93506020850135613b7d816142b2565b925060408501359150606085013567ffffffffffffffff811115613ba057600080fd5b8501601f81018713613bb157600080fd5b613bc0878235602084016139f4565b91505092959194509250565b60008060408385031215613bdf57600080fd5b8235613bea816142b2565b91506020830135613b00816142c7565b60006020808385031215613c0d57600080fd5b825167ffffffffffffffff80821115613c2557600080fd5b818501915085601f830112613c3957600080fd5b815181811115613c4b57613c4b61429c565b8060051b9150613c5c848301614104565b8181528481019084860184860187018a1015613c7757600080fd5b600095505b83861015613c9a578051835260019590950194918601918601613c7c565b5098975050505050505050565b600060208284031215613cb957600080fd5b8151611c90816142c7565b600060208284031215613cd657600080fd5b5035919050565b60008060408385031215613cf057600080fd5b823591506020830135613b00816142b2565b60008060408385031215613d1557600080fd5b50508035926020909101359150565b600060208284031215613d3657600080fd5b8135611c90816142d5565b600060208284031215613d5357600080fd5b8151611c90816142d5565b600060208284031215613d7057600080fd5b813567ffffffffffffffff811115613d8757600080fd5b6127e384828501613a4c565b60008060408385031215613da657600080fd5b82359150602083013567ffffffffffffffff811115613dc457600080fd5b613dd085828601613a4c565b9150509250929050565b60008151808452613df2816020860160208601614197565b601f01601f19169290920160200192915050565b60008351613e18818460208801614197565b835190830190613e2c818360208801614197565b01949350505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613e6d816017850160208801614197565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613e9e816028840160208801614197565b01602801949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613edd90830184613dda565b9695505050505050565b6101408101818360005b600a811015613f195781516001600160a01b0316835260209283019290910190600101613ef1565b50505092915050565b600060808201868352602060808185015281875180845260a086019150828901935060005b81811015613f6c5784516001600160a01b031683529383019391830191600101613f47565b50506001600160a01b039690961660408501525050506060015292915050565b602081526000611c906020830184613dda565b60208082526024908201527f4d75737420686176652061646d696e20726f6c6520746f206368616e676520706040820152637269636560e01b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526018908201527f446f6573206e6f7420686176652041646d696e20726f6c650000000000000000604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60208082526027908201527f4d75737420686176652061646d696e20726f6c6520746f206368616e676520626040820152666173652055524960c81b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff8111828210171561412d5761412d61429c565b604052919050565b6000821982111561414857614148614244565b500190565b60008261415c5761415c61425a565b500490565b600081600019048311821515161561417b5761417b614244565b500290565b60008282101561419257614192614244565b500390565b60005b838110156141b257818101518382015260200161419a565b838111156120525750506000910152565b6000816141d2576141d2614244565b506000190190565b600181811c908216806141ee57607f821691505b6020821081141561420f57634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561422957614229614244565b5060010190565b60008261423f5761423f61425a565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114612a5557600080fd5b8015158114612a5557600080fd5b6001600160e01b031981168114612a5557600080fdfe9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6a2646970667358221220ddf890c7e3b66c88c619e1f2eaa3f59766b92b99fdc76cb7c40359adb384355e64736f6c634300080700330000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000470de4df8200000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000008b82e7393cb8bb187b9effeab12c28d0ca27002a0000000000000000000000001813b590e630f7f06a4d525b96dfd25d9c160d4f0000000000000000000000000000000000000000000000000000000000000004546573740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045465737400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e68747470733a2f2f6e66742e646f676570756e6b732e696f2f6d6574612f0000000000000000000000000000000000000000000000000000000000000000002268747470733a2f2f6e66742e646f676570756e6b732e696f2f636f6e74726163742f000000000000000000000000000000000000000000000000000000000000

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

0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000470de4df8200000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000008b82e7393cb8bb187b9effeab12c28d0ca27002a0000000000000000000000001813b590e630f7f06a4d525b96dfd25d9c160d4f0000000000000000000000000000000000000000000000000000000000000004546573740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045465737400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e68747470733a2f2f6e66742e646f676570756e6b732e696f2f6d6574612f0000000000000000000000000000000000000000000000000000000000000000002268747470733a2f2f6e66742e646f676570756e6b732e696f2f636f6e74726163742f000000000000000000000000000000000000000000000000000000000000
-----Encoded View---------------
18 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [2] : 00000000000000000000000000000000000000000000000000000000000001a0
Arg [3] : 00000000000000000000000000000000000000000000000000000000000001e0
Arg [4] : 00000000000000000000000000000000000000000000000000470de4df820000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000002710
Arg [6] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [7] : 0000000000000000000000008b82e7393cb8bb187b9effeab12c28d0ca27002a
Arg [8] : 0000000000000000000000001813b590e630f7f06a4d525b96dfd25d9c160d4f
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [10] : 5465737400000000000000000000000000000000000000000000000000000000
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [12] : 5465737400000000000000000000000000000000000000000000000000000000
Arg [13] : 000000000000000000000000000000000000000000000000000000000000001e
Arg [14] : 68747470733a2f2f6e66742e646f676570756e6b732e696f2f6d6574612f0000
Arg [15] : 0000000000000000000000000000000000000000000000000000000000000022
Arg [16] : 68747470733a2f2f6e66742e646f676570756e6b732e696f2f636f6e74726163
Arg [17] : 742f000000000000000000000000000000000000000000000000000000000000


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading