ETH Price: $3,327.20 (-0.97%)

Token

MOAR by Joan Cornella (MOAR)
 

Overview

Max Total Supply

5,555 MOAR

Holders

2,957

Market

Volume (24H)

0.0606 ETH

Min Price (24H)

$100.81 @ 0.030300 ETH

Max Price (24H)

$100.81 @ 0.030300 ETH
Balance
2 MOAR
0x1de6fd5cab3776170736e2a8749608008d5cd231
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

MOAR by Joan Cornellà is an unusual mansion in the metaverse proudly presented by FWENCLUB, where 5,555 creatures with their souls minted with the ERC721 blockchain as NFTs.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
Moar

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

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

// @title:     MOAR
// @desc:      "MOAR by Joan Cornellà is an unusual mansion in the metaverse proudly presented by FWENCLUB, where 5,555 creatures with their souls minted with the ERC721 blockchain as NFTs. Each of these "peacefully-living-together" humans, cyborgs or even zombies, is unique, hand-drawn by Spanish artist Joan Cornellà using over 200 unique attributes. You may even find shops, games, virtual exhibitions … and MOAR!"
// @twitter:   https://twitter.com/fwenclub
// @instagram: https://instagram.com/fwenclub
// @discord:   https://discord.gg/fwenclub
// @url:       https://www.fwenclub.com/

/*
* ███████╗░██╗░░░░░░░██╗███████╗███╗░░██╗░█████╗░██╗░░░░░██╗░░░██╗██████╗░
* ██╔════╝░██║░░██╗░░██║██╔════╝████╗░██║██╔══██╗██║░░░░░██║░░░██║██╔══██╗
* █████╗░░░╚██╗████╗██╔╝█████╗░░██╔██╗██║██║░░╚═╝██║░░░░░██║░░░██║██████╦╝
* ██╔══╝░░░░████╔═████║░██╔══╝░░██║╚████║██║░░██╗██║░░░░░██║░░░██║██╔══██╗
* ██║░░░░░░░╚██╔╝░╚██╔╝░███████╗██║░╚███║╚█████╔╝███████╗╚██████╔╝██████╦╝
* ╚═╝░░░░░░░░╚═╝░░░╚═╝░░╚══════╝╚═╝░░╚══╝░╚════╝░╚══════╝░╚═════╝░╚═════╝░
*/

pragma solidity ^0.8.13;

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./MoarBase.sol";

error InvalidSaleOn();
error InvalidTime();
error ContractBidder();
error ExceedMaxSupply();
error ExceedMaxTicket();
error ExceedAuctionSupply();
error ExceedDiamondHandSupply();
error InvalidPayment();
error InvalidSignature();
error WithdrawFailed();

contract Moar is MoarBase, ReentrancyGuard {
    // ===== Provenance ======
    bytes32 public provenance;

    // ================ Public Sales ================
    bool public saleOn;
    mapping(address => uint256) public publicMints;

    // ========= Public Mints =========
    struct Tier {
        uint256 startTime;
        uint256 duration;
        uint256 maxTicketNum;
        uint256 ticketPrice;
    }
    mapping(uint256 => Tier) public tiers;

    // =============================== Diamond Hand ================================
    uint256 public constant DIAMOND_HAND_ID = uint256(keccak256("DIAMOND_HAND_ID"));

    // ========================== Dutch Auction ===========================
    uint256 public constant DUTCH_AUCTION_MAX_TICKET = 2;
    uint256 public constant DUTCH_AUCTION_START_PRICE = 0.5 ether;
    uint256 public constant DUTCH_AUCTION_END_PRICE = 0.1 ether;
    uint256 public constant DUTCH_AUCTION_PRICE_CURVE_LENGTH = 180 minutes;
    uint256 public constant DUTCH_AUCTION_DROP_INTERVAL = 45 minutes;
    uint256 public constant DUTCH_AUCTION_DROP_PER_STEP = (DUTCH_AUCTION_START_PRICE - DUTCH_AUCTION_END_PRICE) / (DUTCH_AUCTION_PRICE_CURVE_LENGTH / DUTCH_AUCTION_DROP_INTERVAL);

    uint256 public dutchAuctionStartTime = 1649335500; // Apr 7, 2022, 2045 HKT

    // ==================== Supply ====================
    uint256 public constant maxSupply = 5555;
    uint256 public totalSupply;
    uint256 public constant diamondHandMaxSupply = 1644; // 40% of the dutch auction qty
    uint256 public constant DHDAMaxSupply = 4110; // 74% of the total qty - 1 (English Auction)
    uint256 public DHDATotalSupply;

    // ======== Roles =========
    address private _authority;

    // ========================= Refund ==========================
    event refundFailed(address indexed recipient, uint256 amount);

    /**
     * @dev Constructor function. Mints token #1 to `owner`, updates `totalSupply`
     * @param authority signature authority
     * @param admin admin role
     * @param royaltyAddress royalty fee receiver address
     */
    constructor(address authority, address admin, address royaltyAddress) MoarBase(admin, royaltyAddress) {
        _authority = authority;

        _mint(owner(), 1);
        totalSupply += 1;
    }

    /**
     * @dev Validates `saleOn`
     */    
    modifier isSaleOn(bool saleOn_) {
        if (saleOn != saleOn_) { revert InvalidSaleOn(); }
        _;
    }

    /**
     * @dev Validates time for tier
     * @param tierId Id of tier to validate
     */    
    modifier validTime(uint256 tierId) {
        uint256 startTime = tiers[tierId].startTime;
        uint256 endTime = startTime + tiers[tierId].duration * 1 seconds;
        if (block.timestamp < startTime || block.timestamp >= endTime) { revert InvalidTime(); }
        _;
    }

    /**
     * @dev Validates if caller is a contract
     */    
    modifier validateCaller() {
        if (tx.origin != msg.sender) { revert ContractBidder(); }
        _;
    }

    /**
     * @dev Sets the provenance.
     * @param provenance_ provenance of public mint token images
     *
     * Requirements:
     *
     * - the caller must be `owner`.
     */
    function setProvenance(bytes32 provenance_) external onlyAdmin {
        provenance = provenance_;
    }

    /**
     * @dev Toggles `saleOn`
     *
     * Requirements:
     *
     * - the caller must be `owner`.
     */
    function toggleFlag(uint256 flag) public override onlyAdmin {
        if (flag == uint256(keccak256("SALE")))
            saleOn = !saleOn;
        else
            super.toggleFlag(flag);
    }

    /**
     * @dev Sets `_authority` address
     * @param authority new authority address to set
     *
     * Requirements:
     *
     * - `saleOn` must be false,
     * - the caller must be `owner`.
     */
    function setAuthority( address authority) external isSaleOn(false) onlyOwner {
        _authority = authority;
    }

    /**
     * @dev Sets dutch auction start time
     * @param startTime start time to be set
     *
     * Requirements:
     *
     * - `saleOn` must be false,
     * - the caller must be `owner`.
     */
    function setDutchAuctionStartTime( uint256 startTime) external isSaleOn(false) onlyAdmin {
        dutchAuctionStartTime = startTime;
    }

    /**
     * @dev Configs sales
     * @param tierIds ids of sale tiers
     * @param tierStartTimes start times of sale tiers
     * @param tierDurations durations of sale tiers
     * @param tierMaxTicketNums max ticket numbers per user of sale tiers
     * @param tierTicketPrices ticket prices of sale tiers
     *
     * Requirements:
     *
     * - the caller must be `_admin`.
     */
    function configSales(
        uint256[] memory tierIds,
        uint256[] memory tierStartTimes,
        uint256[] memory tierDurations,
        uint256[] memory tierMaxTicketNums,
        uint256[] memory tierTicketPrices
    ) external onlyAdmin isSaleOn(false) {
        if (
            tierIds.length != tierStartTimes.length ||
            tierIds.length != tierDurations.length ||
            tierIds.length != tierMaxTicketNums.length ||
            tierIds.length != tierTicketPrices.length
        ) {
            revert ArrayLengthMismatch();
        }

        for (uint256 i = 0; i < tierIds.length; i++) {
            tiers[tierIds[i]].startTime = tierStartTimes[i];
            tiers[tierIds[i]].duration = tierDurations[i];
            tiers[tierIds[i]].maxTicketNum = tierMaxTicketNums[i];
            tiers[tierIds[i]].ticketPrice = tierTicketPrices[i];
        }
    }

    /**
     * @dev Creates a new token for every address in `tos`. TokenIds will be automatically assigned
     * @param tos owners of new tokens
     *
     * Requirements:
     *
     * - `saleOn` must be false,
     * - the caller must be `_admin`.
     */
    function privateMint(address[] memory tos) external onlyAdmin isSaleOn(false) {
        for (uint256 i = 0; i < tos.length; i++) {
            _mint(tos[i], totalSupply + 1 + i);
        }
        totalSupply += tos.length;

        if (totalSupply > maxSupply) { revert ExceedMaxSupply(); }
    }

    /**
     * @dev Creates new tokens for public mint. TokenIds will be automatically assigned
     * 
     * @param maxNum  max ticket number per user 
     * @param ticketNum number of tokens to create
     * @param price price of each token
     */
    function _publicMint(uint256 maxNum, uint256 ticketNum, uint256 price, bool lock) private {
        // all public sales share same counter mapping, contract trusts that all signature addresses are unique
        if (publicMints[msg.sender] + ticketNum > maxNum) { revert ExceedMaxTicket(); }

        uint256 availableNum = Math.min(ticketNum, maxSupply - totalSupply );
        if (availableNum <= 0) { revert ExceedMaxSupply(); }
        publicMints[msg.sender] += availableNum;

        uint256 totalPrice = price * availableNum;
        if (msg.value < totalPrice) { revert InvalidPayment(); }

        if (availableNum > 1) {
            for (uint256 i = 0; i < availableNum; i++) {
                uint256 tokenId = totalSupply + 1 + i;
                _mint(msg.sender, tokenId);
                if (lock) transferLocks[tokenId] = LockStatus.LockByAdmin;
            }
        } else {
            uint256 tokenId = totalSupply + 1;
            _mint(msg.sender, tokenId);
            if (lock) transferLocks[tokenId] = LockStatus.LockByAdmin;
        }

        totalSupply += availableNum;
        if (totalSupply > maxSupply) { revert ExceedMaxSupply(); }

        if (msg.value > totalPrice) {
            uint256 refundAmount = msg.value - totalPrice;
            (bool refund, ) = msg.sender.call{value: refundAmount}("");
            if (!refund) {
                emit refundFailed(msg.sender, refundAmount);
            }
        }
    }

    /**
     * @dev Creates new token(s) for valid caller. TokenId(s) will be automatically assigned
     * 
     * @param tierId tier id of caller belonged to
     * @param ticketNum number of tokens to create
     * @param signature signature from `_authority`
     *
     * Requirements:
     *
     * - `saleOn` must be true,
     */
    function whitelistMint(uint256 tierId, uint256 ticketNum, bytes memory signature) external payable isSaleOn(true) validTime(tierId) {
        bytes32 data = keccak256(abi.encode(address(this), msg.sender, tierId));
        if (!SignatureChecker.isValidSignatureNow(_authority, data, signature)) { revert InvalidSignature(); }

        _publicMint(tiers[tierId].maxTicketNum, ticketNum, tiers[tierId].ticketPrice, false);
    }

    /**
     * @dev Creates new tokens for auction winner. TokenIds will be automatically assigned
     * @param ticketNum number of tokens to create
     * @param signature signature from `_authority`
     *
     * Requirements:
     *
     * - `saleOn` must be true,
     * - caller must not be a contract.
     */
    function dutchAuctionMint(uint256 ticketNum, bytes memory signature) external payable isSaleOn(true) validateCaller {
        if (block.timestamp < dutchAuctionStartTime) { revert InvalidTime(); }

        bytes32 data = keccak256(abi.encode(address(this), msg.sender, keccak256("DUTCH")));
        if (!SignatureChecker.isValidSignatureNow(_authority, data, signature)) { revert InvalidSignature(); }

        uint256 availableNum = Math.min(ticketNum, DHDAMaxSupply - DHDATotalSupply );
        if (availableNum <= 0) { revert ExceedAuctionSupply(); }
        DHDATotalSupply += availableNum;

        _publicMint(DUTCH_AUCTION_MAX_TICKET, availableNum, dutchAuctionPrice(), false);
    }

    /**
     * @dev Returns auction token price
     */
    function dutchAuctionPrice() public view returns (uint256){
        uint256 timestamp = block.timestamp;

        if (timestamp < dutchAuctionStartTime)
            return DUTCH_AUCTION_START_PRICE;

        if (timestamp - dutchAuctionStartTime >= DUTCH_AUCTION_PRICE_CURVE_LENGTH)
            return DUTCH_AUCTION_END_PRICE;

        uint256 steps = (timestamp - dutchAuctionStartTime) / DUTCH_AUCTION_DROP_INTERVAL;
        return DUTCH_AUCTION_START_PRICE - steps * DUTCH_AUCTION_DROP_PER_STEP;
    }

    /**
     * @dev Creates new tokens for auction winner. TokenIds will be automatically assigned
     * @param ticketNum number of tokens to create
     * @param signature signature from `_authority`
     *
     * Requirements:
     *
     * - `saleOn` must be true,
     * - caller must not be a contract.
     */
    function diamondHandMint(uint256 ticketNum, bytes memory signature) external payable isSaleOn(true) validateCaller validTime(DIAMOND_HAND_ID) {
        bytes32 data = keccak256(abi.encode(address(this), msg.sender, DIAMOND_HAND_ID));
        if (!SignatureChecker.isValidSignatureNow(_authority, data, signature)) { revert InvalidSignature(); }

        uint256 availableNum = Math.min(ticketNum, diamondHandMaxSupply - DHDATotalSupply );
        if (availableNum <= 0) { revert ExceedDiamondHandSupply(); }
        DHDATotalSupply += availableNum;

        _publicMint(DUTCH_AUCTION_MAX_TICKET, availableNum, tiers[DIAMOND_HAND_ID].ticketPrice, true);
    }

    /**
     * @dev Payouts contract balance
     * 
     * Requirements:
     *
     * - the caller must be `owner`.
     */
    function withdraw() external onlyOwner nonReentrant {
        (bool success, ) = msg.sender.call{value: address(this).balance}("");
        if (!success) { revert WithdrawFailed(); }
    }
}

File 2 of 25 : MoarBase.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.13;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/interfaces/IERC2981.sol";
import "../erc/ERC721.sol";
import "@openzeppelin/contracts/utils/Strings.sol";

error NonAdmin();
error MetadataFrozen();
error BurnningInactive();
error TransferDeactive();
error TransferLocked();
error TransferLockedByAdmin();
error RoyaltyPercentageExceed();
error ArrayLengthMismatch();

contract MoarBase is ERC721, IERC2981, Ownable {
    using Strings for uint256;

    // ==== Admin Role ====
    address private _admin;

    // ======= Metadata =======
    bool public metadataFrozen;
    string private _baseURI;

    // ======= Burning =======
    bool public burningActive;

    // ================================= Transfer ==================================
    enum LockStatus {
        Unlock,
        LockByAdmin,
        LockByTokenOwner
    }

    bool public transferDeactive;
    mapping ( uint256 => LockStatus ) public transferLocks;

    event LockTransfer(address indexed owner, uint256 indexed tokenId, bool locked);

    // ======== Royalties ==========
    address private _royaltyAddress;
    uint256 private _royaltyPercent;

    /**
     * @dev Initializes the contract by setting a `default_admin` of the token access control.
     */
    constructor(address admin, address royaltyAddress ) {
        _admin = admin;
        _royaltyAddress = royaltyAddress;
        _royaltyPercent = 6;
    }

    /**
     * @dev Throws if called by any account other than the `_admin`.
     */
    modifier onlyAdmin() {
        if (_admin != _msgSender())  { revert NonAdmin(); }
        _;
    }

    /**
     * @dev Sets `_admin` address
     * @param admin new admin address to set
     *
     * Requirements:
     *
     * - `saleOn` must be false,
     * - the caller must be `owner`.
     */
    function setAdmin( address admin) external onlyOwner {
        _admin = admin;
    }

    /**
     * @dev Returns the token collection name.
     */
    function name() public view virtual override returns (string memory) {
        return "MOAR by Joan Cornella";
    }

    /**
     * @dev Returns the token collection symbol
     */
    function symbol() public view virtual override returns (string memory) {
        return "MOAR";
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {
        return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
    }

/**
     * @dev Sets base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`.
     * @param baseURI base URI to set
     *
     * Requirements:
     *
     * - the caller must be owner.
     */
    function setBaseURI(string memory baseURI) external onlyOwner {
        if (metadataFrozen) { revert MetadataFrozen(); }
        _baseURI = baseURI;
    }

    /**
     * @dev Returns the URI for a given token ID
     * Throws if the token ID does not exist.
     * @param tokenId uint256 ID of the token to query
     */
    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        if (!_exists(tokenId)) { revert NonExistentToken(); }
        if (bytes(_baseURI).length > 0)
            return string(abi.encodePacked(_baseURI, tokenId.toString()));
        return string(abi.encodePacked("https://metadata.thefwenclub.com/moar/", tokenId.toString()));
    }

    /**
     * @dev Toggles `burningActive`, `transferActive` and `metadataFrozen`
     *
     * Requirements:
     *
     * - the caller must be `owner`.
     */
    function toggleFlag(uint256 flag) public virtual onlyOwner {
        if (flag == uint256(keccak256("BURN")))
            burningActive = !burningActive;
        else if (flag == uint256(keccak256("TRANSFER")))
            transferDeactive = !transferDeactive;
        else if (flag == uint256(keccak256("METADATA")))
            metadataFrozen = true;
    }

    /**
     * @dev Destroys `tokenId`.
     * Throws if the caller is not token owner or approved
     * @param tokenId uint256 ID of the token to be destroyed
     */
    function burn(uint256 tokenId) external {
        if (!burningActive) { revert BurnningInactive(); }
        if (!_isApprovedOrOwner(_msgSender(), tokenId)) {revert NonOwnerOrApproved(); }
        _burn(tokenId);
    }

    /**
     * @dev Set royalty info for all tokens
     * @param royaltyReceiver address to receive royalty fee
     * @param royaltyPercentage percentage of royalty fee
     *
     * Requirements:
     *
     * - the caller must be the contract owner.
     */
    function setRoyaltyInfo(address royaltyReceiver, uint256 royaltyPercentage) public onlyOwner {
        if (royaltyPercentage > 100) { revert RoyaltyPercentageExceed(); }
        _royaltyAddress = royaltyReceiver;
        _royaltyPercent = royaltyPercentage;
    }

    /**
     * @dev See {IERC2981-royaltyInfo}.
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice) external view override returns (address receiver, uint256 royaltyAmount){
        if (!_exists(tokenId)) { revert NonExistentToken(); }
        return (_royaltyAddress, (salePrice * _royaltyPercent) / 100);
    }

    /**
     * @dev See {ERC721-_transfer}.
     */
    function _transfer(address from, address to, uint256 tokenId) internal virtual override {
        if (transferDeactive) { revert TransferDeactive(); }
        if (transferLocks[tokenId] != LockStatus.Unlock) { revert TransferLocked(); }
        super._transfer(from, to, tokenId);
    }

    /**
     * Locks the transfer of a particular tokenId. This is designed for a non-escrowstaking contract
     * that comes later to lock a user's NFT while still letting them keep it in their wallet.
     *
     * @param tokenId The ID of the token to lock.
     * @param locked The status of the lock; true to lock, false to unlock.
     *
     * Requirements:
     *
     * - the caller must be the token owner or approved.
     */
    function lockTransfer (uint256 tokenId, bool locked) external {
        if (!_isApprovedOrOwner(_msgSender(), tokenId)) { revert NonOwnerOrApproved(); }
        if (transferLocks[tokenId] == LockStatus.LockByAdmin) { revert TransferLockedByAdmin(); }

        transferLocks[tokenId] = locked ? LockStatus.LockByTokenOwner : LockStatus.Unlock;
        emit LockTransfer(ERC721.ownerOf(tokenId), tokenId, locked);
    }

    /**
     * Locks the transfer of tokenIds. This is designed for a non-escrowstaking contract
     * that comes later to lock a user's NFT while still letting them keep it in their wallet.
     *
     * @param tokenIds The IDs of the token to lock.
     * @param locks The status of the lock; true to lock, false to unlock.
     *
     * Requirements:
     *
     * - the caller must be `_admin`.
     */
    function lockTransfers (uint256[] memory tokenIds, bool[] memory locks) external onlyAdmin {
        if (tokenIds.length != locks.length) { revert ArrayLengthMismatch(); }

        for (uint256 i = 0; i < tokenIds.length; i++) {
            transferLocks[tokenIds[i]] = locks[i] ? LockStatus.LockByAdmin : LockStatus.Unlock;
            emit LockTransfer(ERC721.ownerOf(tokenIds[i]), tokenIds[i], locks[i]);
        }
    }
}

File 3 of 25 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

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

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

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

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

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

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

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

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

File 5 of 25 : SignatureChecker.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/SignatureChecker.sol)

pragma solidity ^0.8.0;

import "./ECDSA.sol";
import "../Address.sol";
import "../../interfaces/IERC1271.sol";

/**
 * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA
 * signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like
 * Argent and Gnosis Safe.
 *
 * _Available since v4.1._
 */
library SignatureChecker {
    /**
     * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the
     * signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECDSA.recover`.
     *
     * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
     * change through time. It could return true at block N and false at block N+1 (or the opposite).
     */
    function isValidSignatureNow(
        address signer,
        bytes32 hash,
        bytes memory signature
    ) internal view returns (bool) {
        (address recovered, ECDSA.RecoverError error) = ECDSA.tryRecover(hash, signature);
        if (error == ECDSA.RecoverError.NoError && recovered == signer) {
            return true;
        }

        (bool success, bytes memory result) = signer.staticcall(
            abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, signature)
        );
        return (success && result.length == 32 && abi.decode(result, (bytes4)) == IERC1271.isValidSignature.selector);
    }
}

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

File 8 of 25 : ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.7;

import "@openzeppelin/contracts/interfaces/IERC721.sol";
import "@openzeppelin/contracts/interfaces/IERC721Receiver.sol";
import "@openzeppelin/contracts/interfaces/IERC721Metadata.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";

error ZeroAddress();
error NonExistentToken();
error ApprovalToOwner();
error NonOwner();
error NonOwnerOrOperator();
error NonOwnerOrApproved();
error NonERC721ReceiverImplementer();
error DuplicatedMint();

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

    // 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() {
    }

    /**
     * @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) {
        if (owner == address(0)) { revert ZeroAddress(); }
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        if (owner == address(0)) { revert NonExistentToken(); }
        return owner;
    }

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

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

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) { revert NonExistentToken(); }
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        if (to == owner) { revert ApprovalToOwner(); }
        if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) { revert NonOwnerOrOperator(); }

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        if (!_exists(tokenId)) { revert NonExistentToken(); }

        return _tokenApprovals[tokenId];
    }

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

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        if (!_isApprovedOrOwner(_msgSender(), tokenId)) { revert NonOwnerOrApproved(); }

        _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 {
        if (!_isApprovedOrOwner(_msgSender(), tokenId)) { revert NonOwnerOrApproved(); }
        _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);
        if (!_checkOnERC721Received(from, to, tokenId, _data)) { revert NonERC721ReceiverImplementer(); }
    }

    /**
     * @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) {
        if (!_exists(tokenId)) { revert NonExistentToken(); }
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        if (to == address(0)) { revert ZeroAddress(); }
        if (_exists(tokenId)) { revert DuplicatedMint(); }

        _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 {
        if (ERC721.ownerOf(tokenId) != from) { revert NonOwner(); }
        if (to == address(0)) { revert ZeroAddress(); }

        _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 Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        if (owner == operator)  { revert ApprovalToOwner(); }
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert NonERC721ReceiverImplementer();
                } 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 9 of 25 : IERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Interface for the NFT Royalty Standard.
 *
 * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
 * support for royalty payments across all NFT marketplaces and ecosystem participants.
 *
 * _Available since v4.5._
 */
interface IERC2981 is IERC165 {
    /**
     * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
     * exchange. The royalty amount is denominated and should be payed in that same unit of exchange.
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount);
}

File 10 of 25 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)

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 virtual 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 virtual {
        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 virtual 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 revoked `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}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    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);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

File 12 of 25 : IERC1271.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC1271 standard signature validation method for
 * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].
 *
 * _Available since v4.1._
 */
interface IERC1271 {
    /**
     * @dev Should return whether the signature provided is valid for the provided data
     * @param hash      Hash of the data to be signed
     * @param signature Signature byte array associated with _data
     */
    function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
}

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

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

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

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

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

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

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

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

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

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

File 17 of 25 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../token/ERC721/extensions/IERC721Metadata.sol";

File 18 of 25 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Receiver.sol)

pragma solidity ^0.8.0;

import "../token/ERC721/IERC721Receiver.sol";

File 19 of 25 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol)

pragma solidity ^0.8.0;

import "../token/ERC721/IERC721.sol";

File 20 of 25 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)

pragma solidity ^0.8.0;

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

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

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

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"authority","type":"address"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"address","name":"royaltyAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalToOwner","type":"error"},{"inputs":[],"name":"ArrayLengthMismatch","type":"error"},{"inputs":[],"name":"BurnningInactive","type":"error"},{"inputs":[],"name":"ContractBidder","type":"error"},{"inputs":[],"name":"DuplicatedMint","type":"error"},{"inputs":[],"name":"ExceedAuctionSupply","type":"error"},{"inputs":[],"name":"ExceedDiamondHandSupply","type":"error"},{"inputs":[],"name":"ExceedMaxSupply","type":"error"},{"inputs":[],"name":"ExceedMaxTicket","type":"error"},{"inputs":[],"name":"InvalidPayment","type":"error"},{"inputs":[],"name":"InvalidSaleOn","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"InvalidTime","type":"error"},{"inputs":[],"name":"MetadataFrozen","type":"error"},{"inputs":[],"name":"NonAdmin","type":"error"},{"inputs":[],"name":"NonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"NonExistentToken","type":"error"},{"inputs":[],"name":"NonOwner","type":"error"},{"inputs":[],"name":"NonOwnerOrApproved","type":"error"},{"inputs":[],"name":"NonOwnerOrOperator","type":"error"},{"inputs":[],"name":"RoyaltyPercentageExceed","type":"error"},{"inputs":[],"name":"TransferDeactive","type":"error"},{"inputs":[],"name":"TransferLocked","type":"error"},{"inputs":[],"name":"TransferLockedByAdmin","type":"error"},{"inputs":[],"name":"WithdrawFailed","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"locked","type":"bool"}],"name":"LockTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"refundFailed","type":"event"},{"inputs":[],"name":"DHDAMaxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DHDATotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DIAMOND_HAND_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DUTCH_AUCTION_DROP_INTERVAL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DUTCH_AUCTION_DROP_PER_STEP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DUTCH_AUCTION_END_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DUTCH_AUCTION_MAX_TICKET","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DUTCH_AUCTION_PRICE_CURVE_LENGTH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DUTCH_AUCTION_START_PRICE","outputs":[{"internalType":"uint256","name":"","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":[{"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":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"burningActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tierIds","type":"uint256[]"},{"internalType":"uint256[]","name":"tierStartTimes","type":"uint256[]"},{"internalType":"uint256[]","name":"tierDurations","type":"uint256[]"},{"internalType":"uint256[]","name":"tierMaxTicketNums","type":"uint256[]"},{"internalType":"uint256[]","name":"tierTicketPrices","type":"uint256[]"}],"name":"configSales","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"diamondHandMaxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ticketNum","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"diamondHandMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"ticketNum","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"dutchAuctionMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"dutchAuctionPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dutchAuctionStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bool","name":"locked","type":"bool"}],"name":"lockTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"bool[]","name":"locks","type":"bool[]"}],"name":"lockTransfers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"metadataFrozen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tos","type":"address[]"}],"name":"privateMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"provenance","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"publicMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleOn","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"authority","type":"address"}],"name":"setAuthority","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"startTime","type":"uint256"}],"name":"setDutchAuctionStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"provenance_","type":"bytes32"}],"name":"setProvenance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"royaltyReceiver","type":"address"},{"internalType":"uint256","name":"royaltyPercentage","type":"uint256"}],"name":"setRoyaltyInfo","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":"","type":"uint256"}],"name":"tiers","outputs":[{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"maxTicketNum","type":"uint256"},{"internalType":"uint256","name":"ticketPrice","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"flag","type":"uint256"}],"name":"toggleFlag","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"transferDeactive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"transferLocks","outputs":[{"internalType":"enum MoarBase.LockStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tierId","type":"uint256"},{"internalType":"uint256","name":"ticketNum","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"whitelistMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405263624edccc6010553480156200001957600080fd5b5060405162003897380380620038978339810160408190526200003c916200021d565b81816200004933620000c4565b600580546001600160a01b03199081166001600160a01b0394851617909155600980548216928416929092179091556006600a556001600b5560138054909116858316179055600454620000a09116600162000116565b600160116000828254620000b5919062000267565b909155506200028e9350505050565b600480546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166200013e5760405163d92e233d60e01b815260040160405180910390fd5b6000818152602081905260409020546001600160a01b0316156200017557604051635c5e682d60e01b815260040160405180910390fd5b6001600160a01b03821660009081526001602081905260408220805491929091620001a290849062000267565b909155505060008181526020819052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b80516001600160a01b03811681146200021857600080fd5b919050565b6000806000606084860312156200023357600080fd5b6200023e8462000200565b92506200024e6020850162000200565b91506200025e6040850162000200565b90509250925092565b600082198211156200028957634e487b7160e01b600052601160045260246000fd5b500190565b6135f9806200029e6000396000f3fe6080604052600436106103505760003560e01c8063773ef1cf116101c6578063c87b56dd116100f7578063e7a3f5a611610095578063f0b57a6a1161006f578063f0b57a6a14610a17578063f2fde38b14610a37578063f323965e14610a57578063fb3cc6c214610a6d57600080fd5b8063e7a3f5a6146109a8578063e985e9c5146109bb578063ec596b7214610a0457600080fd5b8063cc50f265116100d1578063cc50f2651461093c578063cfedc3d31461095c578063d5abeb0114610972578063e2e784d51461098857600080fd5b8063c87b56dd146108e0578063c9de3c6814610900578063cae9af7d1461092057600080fd5b80639917701711610164578063a537f74d1161013e578063a537f74d1461087f578063aefabd4414610894578063b88d4fde146108aa578063c3fb29af146108ca57600080fd5b8063991770171461082d5780639b0a1c9314610843578063a22cb4651461085f57600080fd5b80637d665ff5116101a05780637d665ff5146107905780638c47a507146107a55780638da5cb5b146107e257806395d89b411461080057600080fd5b8063773ef1cf146107405780637a9e5e4b1461075a5780637b3ef7bb1461077a57600080fd5b806333b57274116102a057806355f804b31161023e578063693f3f6611610218578063693f3f66146106d6578063704b6c02146106eb57806370a082311461070b578063715018a61461072b57600080fd5b806355f804b314610683578063595fc367146106a35780636352211e146106b657600080fd5b806342842e0e1161027a57806342842e0e1461060457806342966c68146106245780634ad84c451461064457806350a8be391461066457600080fd5b806333b57274146105a25780633add14c8146105c25780633ccfd60b146105ef57600080fd5b8063128e886c1161030d5780631c7c2598116102e75780631c7c25981461050757806323b872dd146105215780632a55205a1461054157806331bb25131461058057600080fd5b8063128e886c146104b157806312d52945146104d157806318160ddd146104f157600080fd5b806301ffc9a714610355578063039af9eb1461038a57806306fdde03146103ec578063081812fc14610433578063095ea7b31461046b5780630f7309e81461048d575b600080fd5b34801561036157600080fd5b50610375610370366004612bce565b610a8e565b60405190151581526020015b60405180910390f35b34801561039657600080fd5b506103cc6103a5366004612beb565b600f6020526000908152604090208054600182015460028301546003909301549192909184565b604080519485526020850193909352918301526060820152608001610381565b3480156103f857600080fd5b506040805180820190915260158152744d4f4152206279204a6f616e20436f726e656c6c6160581b60208201525b6040516103819190612c5c565b34801561043f57600080fd5b5061045361044e366004612beb565b610ab9565b6040516001600160a01b039091168152602001610381565b34801561047757600080fd5b5061048b610486366004612c8b565b610b0a565b005b34801561049957600080fd5b506104a3600c5481565b604051908152602001610381565b3480156104bd57600080fd5b5061048b6104cc366004612beb565b610b96565b3480156104dd57600080fd5b5061048b6104ec366004612d8b565b610bee565b3480156104fd57600080fd5b506104a360115481565b34801561051357600080fd5b506007546103759060ff1681565b34801561052d57600080fd5b5061048b61053c366004612e5d565b610de7565b34801561054d57600080fd5b5061056161055c366004612e99565b610e1a565b604080516001600160a01b039093168352602083019190915201610381565b34801561058c57600080fd5b506104a36000805160206135a483398151915281565b3480156105ae57600080fd5b5061048b6105bd366004612ecb565b610e86565b3480156105ce57600080fd5b506104a36105dd366004612ef7565b600e6020526000908152604090205481565b3480156105fb57600080fd5b5061048b610f7f565b34801561061057600080fd5b5061048b61061f366004612e5d565b61107a565b34801561063057600080fd5b5061048b61063f366004612beb565b611095565b34801561065057600080fd5b5061048b61065f366004612beb565b6110ea565b34801561067057600080fd5b5060075461037590610100900460ff1681565b34801561068f57600080fd5b5061048b61069e366004612f6a565b61115a565b61048b6106b1366004612fd3565b6111c6565b3480156106c257600080fd5b506104536106d1366004612beb565b611332565b3480156106e257600080fd5b506104a3611368565b3480156106f757600080fd5b5061048b610706366004612ef7565b61139d565b34801561071757600080fd5b506104a3610726366004612ef7565b6113e9565b34801561073757600080fd5b5061048b61142e565b34801561074c57600080fd5b50600d546103759060ff1681565b34801561076657600080fd5b5061048b610775366004612ef7565b611464565b34801561078657600080fd5b506104a361100e81565b34801561079c57600080fd5b506104a3600281565b3480156107b157600080fd5b506107d56107c0366004612beb565b60086020526000908152604090205460ff1681565b6040516103819190613030565b3480156107ee57600080fd5b506004546001600160a01b0316610453565b34801561080c57600080fd5b5060408051808201909152600481526326a7a0a960e11b6020820152610426565b34801561083957600080fd5b506104a361066c81565b34801561084f57600080fd5b506104a36706f05b59d3b2000081565b34801561086b57600080fd5b5061048b61087a366004613058565b6114d8565b34801561088b57600080fd5b506104a36114e3565b3480156108a057600080fd5b506104a3612a3081565b3480156108b657600080fd5b5061048b6108c5366004613082565b61159a565b3480156108d657600080fd5b506104a360105481565b3480156108ec57600080fd5b506104266108fb366004612beb565b6115d2565b34801561090c57600080fd5b5061048b61091b3660046130ea565b61166c565b34801561092c57600080fd5b506104a367016345785d8a000081565b34801561094857600080fd5b5061048b6109573660046131ac565b6117ea565b34801561096857600080fd5b506104a360125481565b34801561097e57600080fd5b506104a36115b381565b34801561099457600080fd5b5061048b6109a3366004612c8b565b6118d4565b61048b6109b6366004612fd3565b611946565b3480156109c757600080fd5b506103756109d6366004613244565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205460ff1690565b61048b610a1236600461326e565b611b50565b348015610a2357600080fd5b5061048b610a32366004612beb565b611c61565b348015610a4357600080fd5b5061048b610a52366004612ef7565b611c91565b348015610a6357600080fd5b506104a3610a8c81565b348015610a7957600080fd5b5060055461037590600160a01b900460ff1681565b60006001600160e01b0319821663152a902d60e11b1480610ab35750610ab382611d29565b92915050565b6000818152602081905260408120546001600160a01b0316610aee57604051634a1850bf60e11b815260040160405180910390fd5b506000908152600260205260409020546001600160a01b031690565b6000610b1582611332565b9050806001600160a01b0316836001600160a01b031603610b49576040516349fa8bc360e11b815260040160405180910390fd5b336001600160a01b03821614801590610b695750610b6781336109d6565b155b15610b875760405163107619cb60e01b815260040160405180910390fd5b610b918383611d79565b505050565b600d5460009060ff1615610bbd57604051631faf1dd160e21b815260040160405180910390fd5b6005546001600160a01b03163314610be857604051638202605b60e01b815260040160405180910390fd5b50601055565b6005546001600160a01b03163314610c1957604051638202605b60e01b815260040160405180910390fd5b600d5460009060ff1615610c4057604051631faf1dd160e21b815260040160405180910390fd5b84518651141580610c5357508351865114155b80610c6057508251865114155b80610c6d57508151865114155b15610c8b5760405163512509d360e11b815260040160405180910390fd5b60005b8651811015610dde57858181518110610ca957610ca96132be565b6020026020010151600f6000898481518110610cc757610cc76132be565b6020026020010151815260200190815260200160002060000181905550848181518110610cf657610cf66132be565b6020026020010151600f6000898481518110610d1457610d146132be565b6020026020010151815260200190815260200160002060010181905550838181518110610d4357610d436132be565b6020026020010151600f6000898481518110610d6157610d616132be565b6020026020010151815260200190815260200160002060020181905550828181518110610d9057610d906132be565b6020026020010151600f6000898481518110610dae57610dae6132be565b60200260200101518152602001908152602001600020600301819055508080610dd6906132ea565b915050610c8e565b50505050505050565b610df2335b82611de7565b610e0f576040516344b4834360e11b815260040160405180910390fd5b610b91838383611e9a565b60008281526020819052604081205481906001600160a01b0316610e5157604051634a1850bf60e11b815260040160405180910390fd5b600954600a546001600160a01b0390911690606490610e709086613303565b610e7a9190613338565b915091505b9250929050565b610e91335b83611de7565b610eae576040516344b4834360e11b815260040160405180910390fd5b600160008381526008602052604090205460ff166002811115610ed357610ed361301a565b03610ef1576040516363f0078160e01b815260040160405180910390fd5b80610efd576000610f00565b60025b6000838152600860205260409020805460ff19166001836002811115610f2857610f2861301a565b021790555081610f3783611332565b6001600160a01b03167ff353fbd4da08b85b84f5c67a78630899f3697f6fd111e1a8a0486aa3cf2e5f2e83604051610f73911515815260200190565b60405180910390a35050565b6004546001600160a01b03163314610fb25760405162461bcd60e51b8152600401610fa99061334c565b60405180910390fd5b6002600b54036110045760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610fa9565b6002600b55604051600090339047908381818185875af1925050503d806000811461104b576040519150601f19603f3d011682016040523d82523d6000602084013e611050565b606091505b505090508061107257604051631d42c86760e21b815260040160405180910390fd5b506001600b55565b610b918383836040518060200160405280600081525061159a565b60075460ff166110b85760405163a3d4b25560e01b815260040160405180910390fd5b6110c133610dec565b6110de576040516344b4834360e11b815260040160405180910390fd5b6110e781611f0f565b50565b6005546001600160a01b0316331461111557604051638202605b60e01b815260040160405180910390fd5b7f60a991991c016afbf0de8733940aa735ec22850d153fd7adc44079532594c6f1810161115157600d805460ff19811660ff9091161517905550565b6110e781611fac565b6004546001600160a01b031633146111845760405162461bcd60e51b8152600401610fa99061334c565b600554600160a01b900460ff16156111af5760405163777821ff60e11b815260040160405180910390fd5b80516111c2906006906020840190612b1f565b5050565b600d5460019060ff16151581146111f057604051631faf1dd160e21b815260040160405180910390fd5b32331461121057604051637bf6403b60e11b815260040160405180910390fd5b601054421015611233576040516337bf561360e11b815260040160405180910390fd5b6040805130602082015233918101919091527f57099dca9e95fa778f3d498664bae672f761017d54b2476b12bc4a956eb11ce0606082015260009060800160408051601f1981840301815291905280516020909101206013549091506112a3906001600160a01b03168285612094565b6112c057604051638baa579f60e01b815260040160405180910390fd5b60006112db8560125461100e6112d69190613381565b6121e2565b9050600081116112fe57604051633831346160e01b815260040160405180910390fd5b80601260008282546113109190613398565b9091555061132b90506002826113246114e3565b60006121f8565b5050505050565b6000818152602081905260408120546001600160a01b031680610ab357604051634a1850bf60e11b815260040160405180910390fd5b611376610a8c612a30613338565b61139067016345785d8a00006706f05b59d3b20000613381565b61139a9190613338565b81565b6004546001600160a01b031633146113c75760405162461bcd60e51b8152600401610fa99061334c565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b0382166114125760405163d92e233d60e01b815260040160405180910390fd5b506001600160a01b031660009081526001602052604090205490565b6004546001600160a01b031633146114585760405162461bcd60e51b8152600401610fa99061334c565b6114626000612458565b565b600d5460009060ff161561148b57604051631faf1dd160e21b815260040160405180910390fd5b6004546001600160a01b031633146114b55760405162461bcd60e51b8152600401610fa99061334c565b50601380546001600160a01b0319166001600160a01b0392909216919091179055565b6111c23383836124aa565b6010546000904290811015611501576706f05b59d3b2000091505090565b612a30601054826115129190613381565b106115265767016345785d8a000091505090565b6000610a8c601054836115399190613381565b6115439190613338565b9050611553610a8c612a30613338565b61156d67016345785d8a00006706f05b59d3b20000613381565b6115779190613338565b6115819082613303565b611593906706f05b59d3b20000613381565b9250505090565b6115a333610e8b565b6115c0576040516344b4834360e11b815260040160405180910390fd5b6115cc84848484612549565b50505050565b6000818152602081905260409020546060906001600160a01b031661160a57604051634a1850bf60e11b815260040160405180910390fd5b600060068054611619906133b0565b9050111561165357600661162c8361257d565b60405160200161163d929190613406565b6040516020818303038152906040529050919050565b61165c8261257d565b60405160200161163d91906134ac565b6005546001600160a01b0316331461169757604051638202605b60e01b815260040160405180910390fd5b80518251146116b95760405163512509d360e11b815260040160405180910390fd5b60005b8251811015610b91578181815181106116d7576116d76132be565b60200260200101516116ea5760006116ed565b60015b60086000858481518110611703576117036132be565b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083600281111561173a5761173a61301a565b0217905550828181518110611751576117516132be565b602002602001015161177b84838151811061176e5761176e6132be565b6020026020010151611332565b6001600160a01b03167ff353fbd4da08b85b84f5c67a78630899f3697f6fd111e1a8a0486aa3cf2e5f2e8484815181106117b7576117b76132be565b60200260200101516040516117d0911515815260200190565b60405180910390a3806117e2816132ea565b9150506116bc565b6005546001600160a01b0316331461181557604051638202605b60e01b815260040160405180910390fd5b600d5460009060ff161561183c57604051631faf1dd160e21b815260040160405180910390fd5b60005b82518110156118965761188483828151811061185d5761185d6132be565b60200260200101518260115460016118759190613398565b61187f9190613398565b61267e565b8061188e816132ea565b91505061183f565b508151601160008282546118aa9190613398565b90915550506011546115b310156111c257604051630f0c37b960e11b815260040160405180910390fd5b6004546001600160a01b031633146118fe5760405162461bcd60e51b8152600401610fa99061334c565b60648111156119205760405163bcd4a2a160e01b815260040160405180910390fd5b600980546001600160a01b0319166001600160a01b039390931692909217909155600a55565b600d5460019060ff161515811461197057604051631faf1dd160e21b815260040160405180910390fd5b32331461199057604051637bf6403b60e11b815260040160405180910390fd5b6000805160206135a48339815191526000818152600f6020527fc68702abfd30dc6923256f08aba03384df0a333ee6011d286659e33dfdbb16fe547fc68702abfd30dc6923256f08aba03384df0a333ee6011d286659e33dfdbb16ff549091906119fb906001613303565b611a059083613398565b905081421080611a155750804210155b15611a33576040516337bf561360e11b815260040160405180910390fd5b6040805130602082015233918101919091526000805160206135a4833981519152606082015260009060800160408051601f198184030181529190528051602090910120601354909150611a91906001600160a01b03168288612094565b611aae57604051638baa579f60e01b815260040160405180910390fd5b6000611ac48860125461066c6112d69190613381565b905060008111611ae6576040516293210360e81b815260040160405180910390fd5b8060126000828254611af89190613398565b90915550506000805160206135a4833981519152600052600f6020527fc68702abfd30dc6923256f08aba03384df0a333ee6011d286659e33dfdbb170154611b4690600290839060016121f8565b5050505050505050565b600d5460019060ff1615158114611b7a57604051631faf1dd160e21b815260040160405180910390fd5b6000848152600f60205260408120805460019182015487939192611b9e9190613303565b611ba89083613398565b905081421080611bb85750804210155b15611bd6576040516337bf561360e11b815260040160405180910390fd5b6040805130602080830191909152338284015260608083018b90528351808403909101815260809092019092528051910120601354611c1f906001600160a01b03168288612094565b611c3c57604051638baa579f60e01b815260040160405180910390fd5b6000888152600f602052604081206002810154600390910154611b46928a91906121f8565b6005546001600160a01b03163314611c8c57604051638202605b60e01b815260040160405180910390fd5b600c55565b6004546001600160a01b03163314611cbb5760405162461bcd60e51b8152600401610fa99061334c565b6001600160a01b038116611d205760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610fa9565b6110e781612458565b60006001600160e01b031982166380ac58cd60e01b1480611d5a57506001600160e01b03198216635b5e139f60e01b145b80610ab357506301ffc9a760e01b6001600160e01b0319831614610ab3565b600081815260026020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611dae82611332565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152602081905260408120546001600160a01b0316611e1c57604051634a1850bf60e11b815260040160405180910390fd5b6000611e2783611332565b9050806001600160a01b0316846001600160a01b03161480611e625750836001600160a01b0316611e5784610ab9565b6001600160a01b0316145b80611e9257506001600160a01b0380821660009081526003602090815260408083209388168352929052205460ff165b949350505050565b600754610100900460ff1615611ec357604051633078994b60e21b815260040160405180910390fd5b60008181526008602052604081205460ff166002811115611ee657611ee661301a565b14611f0457604051632b36b06160e01b815260040160405180910390fd5b610b91838383612764565b6000611f1a82611332565b9050611f27600083611d79565b6001600160a01b03811660009081526001602081905260408220805491929091611f52908490613381565b909155505060008281526020819052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6004546001600160a01b03163314611fd65760405162461bcd60e51b8152600401610fa99061334c565b7ffb395b85186ef1074d6adea56817b6a56150a8484fa4027406ae124c02b5e95d8101612012576007805460ff19811660ff9091161517905550565b7f6ebcdc927eddac6b0c429a4bb191d6020b2845f88c2644c0a33ea147f45c8889810161205757506007805461ff001981166101009182900460ff1615909102179055565b7f950517b5e338c7da4884d270eb23aa5fad139ba920a34f6bf1a21b611a93f42d81016110e7576005805460ff60a01b1916600160a01b17905550565b60008060006120a3858561288c565b909250905060008160048111156120bc576120bc61301a565b1480156120da5750856001600160a01b0316826001600160a01b0316145b156120ea576001925050506121db565b600080876001600160a01b0316631626ba7e60e01b8888604051602401612112929190613500565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516121509190613519565b600060405180830381855afa9150503d806000811461218b576040519150601f19603f3d011682016040523d82523d6000602084013e612190565b606091505b50915091508180156121a3575080516020145b80156121d457508051630b135d3f60e11b906121c89083016020908101908401613535565b6001600160e01b031916145b9450505050505b9392505050565b60008183106121f157816121db565b5090919050565b336000908152600e60205260409020548490612215908590613398565b111561223457604051636998bf9360e01b815260040160405180910390fd5b600061224a846011546115b36112d69190613381565b90506000811161226d57604051630f0c37b960e11b815260040160405180910390fd5b336000908152600e60205260408120805483929061228c908490613398565b909155506000905061229e8285613303565b9050803410156122c15760405163078d696560e31b815260040160405180910390fd5b60018211156123365760005b828110156123305760008160115460016122e79190613398565b6122f19190613398565b90506122fd338261267e565b841561231d576000818152600860205260409020805460ff191660011790555b5080612328816132ea565b9150506122cd565b50612375565b600060115460016123479190613398565b9050612353338261267e565b8315612373576000818152600860205260409020805460ff191660011790555b505b81601160008282546123879190613398565b90915550506011546115b310156123b157604051630f0c37b960e11b815260040160405180910390fd5b803411156124505760006123c58234613381565b604051909150600090339083908381818185875af1925050503d806000811461240a576040519150601f19603f3d011682016040523d82523d6000602084013e61240f565b606091505b5050905080611b465760405182815233907f58ed53f57360e3586c9d1171f475e68b67808b6c163f3676757eb00d8f1bb7cf9060200160405180910390a250505b505050505050565b600480546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036124dc576040516349fa8bc360e11b815260040160405180910390fd5b6001600160a01b03838116600081815260036020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612554848484611e9a565b612560848484846128f7565b6115cc576040516342eac10f60e11b815260040160405180910390fd5b6060816000036125a45750506040805180820190915260018152600360fc1b602082015290565b8160005b81156125ce57806125b8816132ea565b91506125c79050600a83613338565b91506125a8565b60008167ffffffffffffffff8111156125e9576125e9612cb5565b6040519080825280601f01601f191660200182016040528015612613576020820181803683370190505b5090505b8415611e9257612628600183613381565b9150612635600a86613552565b612640906030613398565b60f81b818381518110612655576126556132be565b60200101906001600160f81b031916908160001a905350612677600a86613338565b9450612617565b6001600160a01b0382166126a55760405163d92e233d60e01b815260040160405180910390fd5b6000818152602081905260409020546001600160a01b0316156126db57604051635c5e682d60e01b815260040160405180910390fd5b6001600160a01b03821660009081526001602081905260408220805491929091612706908490613398565b909155505060008181526020819052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b826001600160a01b031661277782611332565b6001600160a01b03161461279e5760405163106b771d60e31b815260040160405180910390fd5b6001600160a01b0382166127c55760405163d92e233d60e01b815260040160405180910390fd5b6127d0600082611d79565b6001600160a01b038316600090815260016020819052604082208054919290916127fb908490613381565b90915550506001600160a01b0382166000908152600160208190526040822080549192909161282b908490613398565b909155505060008181526020819052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60008082516041036128c25760208301516040840151606085015160001a6128b6878285856129f9565b94509450505050610e7f565b82516040036128eb57602083015160408401516128e0868383612ae6565b935093505050610e7f565b50600090506002610e7f565b60006001600160a01b0384163b156129ee57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061293b903390899088908890600401613566565b6020604051808303816000875af1925050508015612976575060408051601f3d908101601f1916820190925261297391810190613535565b60015b6129d4573d8080156129a4576040519150601f19603f3d011682016040523d82523d6000602084013e6129a9565b606091505b5080516000036129cc576040516342eac10f60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611e92565b506001949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612a305750600090506003612add565b8460ff16601b14158015612a4857508460ff16601c14155b15612a595750600090506004612add565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612aad573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612ad657600060019250925050612add565b9150600090505b94509492505050565b6000806001600160ff1b03831681612b0360ff86901c601b613398565b9050612b11878288856129f9565b935093505050935093915050565b828054612b2b906133b0565b90600052602060002090601f016020900481019282612b4d5760008555612b93565b82601f10612b6657805160ff1916838001178555612b93565b82800160010185558215612b93579182015b82811115612b93578251825591602001919060010190612b78565b50612b9f929150612ba3565b5090565b5b80821115612b9f5760008155600101612ba4565b6001600160e01b0319811681146110e757600080fd5b600060208284031215612be057600080fd5b81356121db81612bb8565b600060208284031215612bfd57600080fd5b5035919050565b60005b83811015612c1f578181015183820152602001612c07565b838111156115cc5750506000910152565b60008151808452612c48816020860160208601612c04565b601f01601f19169290920160200192915050565b6020815260006121db6020830184612c30565b80356001600160a01b0381168114612c8657600080fd5b919050565b60008060408385031215612c9e57600080fd5b612ca783612c6f565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612cf457612cf4612cb5565b604052919050565b600067ffffffffffffffff821115612d1657612d16612cb5565b5060051b60200190565b600082601f830112612d3157600080fd5b81356020612d46612d4183612cfc565b612ccb565b82815260059290921b84018101918181019086841115612d6557600080fd5b8286015b84811015612d805780358352918301918301612d69565b509695505050505050565b600080600080600060a08688031215612da357600080fd5b853567ffffffffffffffff80821115612dbb57600080fd5b612dc789838a01612d20565b96506020880135915080821115612ddd57600080fd5b612de989838a01612d20565b95506040880135915080821115612dff57600080fd5b612e0b89838a01612d20565b94506060880135915080821115612e2157600080fd5b612e2d89838a01612d20565b93506080880135915080821115612e4357600080fd5b50612e5088828901612d20565b9150509295509295909350565b600080600060608486031215612e7257600080fd5b612e7b84612c6f565b9250612e8960208501612c6f565b9150604084013590509250925092565b60008060408385031215612eac57600080fd5b50508035926020909101359150565b80358015158114612c8657600080fd5b60008060408385031215612ede57600080fd5b82359150612eee60208401612ebb565b90509250929050565b600060208284031215612f0957600080fd5b6121db82612c6f565b600067ffffffffffffffff831115612f2c57612f2c612cb5565b612f3f601f8401601f1916602001612ccb565b9050828152838383011115612f5357600080fd5b828260208301376000602084830101529392505050565b600060208284031215612f7c57600080fd5b813567ffffffffffffffff811115612f9357600080fd5b8201601f81018413612fa457600080fd5b611e9284823560208401612f12565b600082601f830112612fc457600080fd5b6121db83833560208501612f12565b60008060408385031215612fe657600080fd5b82359150602083013567ffffffffffffffff81111561300457600080fd5b61301085828601612fb3565b9150509250929050565b634e487b7160e01b600052602160045260246000fd5b602081016003831061305257634e487b7160e01b600052602160045260246000fd5b91905290565b6000806040838503121561306b57600080fd5b61307483612c6f565b9150612eee60208401612ebb565b6000806000806080858703121561309857600080fd5b6130a185612c6f565b93506130af60208601612c6f565b925060408501359150606085013567ffffffffffffffff8111156130d257600080fd5b6130de87828801612fb3565b91505092959194509250565b600080604083850312156130fd57600080fd5b823567ffffffffffffffff8082111561311557600080fd5b61312186838701612d20565b935060209150818501358181111561313857600080fd5b85019050601f8101861361314b57600080fd5b8035613159612d4182612cfc565b81815260059190911b8201830190838101908883111561317857600080fd5b928401925b8284101561319d5761318e84612ebb565b8252928401929084019061317d565b80955050505050509250929050565b600060208083850312156131bf57600080fd5b823567ffffffffffffffff8111156131d657600080fd5b8301601f810185136131e757600080fd5b80356131f5612d4182612cfc565b81815260059190911b8201830190838101908783111561321457600080fd5b928401925b828410156132395761322a84612c6f565b82529284019290840190613219565b979650505050505050565b6000806040838503121561325757600080fd5b61326083612c6f565b9150612eee60208401612c6f565b60008060006060848603121561328357600080fd5b8335925060208401359150604084013567ffffffffffffffff8111156132a857600080fd5b6132b486828701612fb3565b9150509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016132fc576132fc6132d4565b5060010190565b600081600019048311821515161561331d5761331d6132d4565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261334757613347613322565b500490565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082821015613393576133936132d4565b500390565b600082198211156133ab576133ab6132d4565b500190565b600181811c908216806133c457607f821691505b6020821081036133e457634e487b7160e01b600052602260045260246000fd5b50919050565b600081516133fc818560208601612c04565b9290920192915050565b600080845481600182811c91508083168061342257607f831692505b6020808410820361344157634e487b7160e01b86526022600452602486fd5b818015613455576001811461346657613493565b60ff19861689528489019650613493565b60008b81526020902060005b8681101561348b5781548b820152908501908301613472565b505084890196505b5050505050506134a381856133ea565b95945050505050565b7f68747470733a2f2f6d657461646174612e7468656677656e636c75622e636f6d8152652f6d6f61722f60d01b6020820152600082516134f3816026850160208701612c04565b9190910160260192915050565b828152604060208201526000611e926040830184612c30565b6000825161352b818460208701612c04565b9190910192915050565b60006020828403121561354757600080fd5b81516121db81612bb8565b60008261356157613561613322565b500690565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061359990830184612c30565b969550505050505056fedd78a0a08b9f6bab22efdfbf89882075211b90807220a959000925597bd4e4b8a26469706673582212202f0ea01eaef502fb45a4288e17b16e1875c406e52d1a4385dc124ba3a07379cc64736f6c634300080d00330000000000000000000000005112d14803dbaf87c0261bb3ef39d374e3f739fc000000000000000000000000fb4ae66ab40fcaff28d8d2d930a073752ec2792f000000000000000000000000b75afba91d6befc8b2ee739270827fd9c5714cfb

Deployed Bytecode

0x6080604052600436106103505760003560e01c8063773ef1cf116101c6578063c87b56dd116100f7578063e7a3f5a611610095578063f0b57a6a1161006f578063f0b57a6a14610a17578063f2fde38b14610a37578063f323965e14610a57578063fb3cc6c214610a6d57600080fd5b8063e7a3f5a6146109a8578063e985e9c5146109bb578063ec596b7214610a0457600080fd5b8063cc50f265116100d1578063cc50f2651461093c578063cfedc3d31461095c578063d5abeb0114610972578063e2e784d51461098857600080fd5b8063c87b56dd146108e0578063c9de3c6814610900578063cae9af7d1461092057600080fd5b80639917701711610164578063a537f74d1161013e578063a537f74d1461087f578063aefabd4414610894578063b88d4fde146108aa578063c3fb29af146108ca57600080fd5b8063991770171461082d5780639b0a1c9314610843578063a22cb4651461085f57600080fd5b80637d665ff5116101a05780637d665ff5146107905780638c47a507146107a55780638da5cb5b146107e257806395d89b411461080057600080fd5b8063773ef1cf146107405780637a9e5e4b1461075a5780637b3ef7bb1461077a57600080fd5b806333b57274116102a057806355f804b31161023e578063693f3f6611610218578063693f3f66146106d6578063704b6c02146106eb57806370a082311461070b578063715018a61461072b57600080fd5b806355f804b314610683578063595fc367146106a35780636352211e146106b657600080fd5b806342842e0e1161027a57806342842e0e1461060457806342966c68146106245780634ad84c451461064457806350a8be391461066457600080fd5b806333b57274146105a25780633add14c8146105c25780633ccfd60b146105ef57600080fd5b8063128e886c1161030d5780631c7c2598116102e75780631c7c25981461050757806323b872dd146105215780632a55205a1461054157806331bb25131461058057600080fd5b8063128e886c146104b157806312d52945146104d157806318160ddd146104f157600080fd5b806301ffc9a714610355578063039af9eb1461038a57806306fdde03146103ec578063081812fc14610433578063095ea7b31461046b5780630f7309e81461048d575b600080fd5b34801561036157600080fd5b50610375610370366004612bce565b610a8e565b60405190151581526020015b60405180910390f35b34801561039657600080fd5b506103cc6103a5366004612beb565b600f6020526000908152604090208054600182015460028301546003909301549192909184565b604080519485526020850193909352918301526060820152608001610381565b3480156103f857600080fd5b506040805180820190915260158152744d4f4152206279204a6f616e20436f726e656c6c6160581b60208201525b6040516103819190612c5c565b34801561043f57600080fd5b5061045361044e366004612beb565b610ab9565b6040516001600160a01b039091168152602001610381565b34801561047757600080fd5b5061048b610486366004612c8b565b610b0a565b005b34801561049957600080fd5b506104a3600c5481565b604051908152602001610381565b3480156104bd57600080fd5b5061048b6104cc366004612beb565b610b96565b3480156104dd57600080fd5b5061048b6104ec366004612d8b565b610bee565b3480156104fd57600080fd5b506104a360115481565b34801561051357600080fd5b506007546103759060ff1681565b34801561052d57600080fd5b5061048b61053c366004612e5d565b610de7565b34801561054d57600080fd5b5061056161055c366004612e99565b610e1a565b604080516001600160a01b039093168352602083019190915201610381565b34801561058c57600080fd5b506104a36000805160206135a483398151915281565b3480156105ae57600080fd5b5061048b6105bd366004612ecb565b610e86565b3480156105ce57600080fd5b506104a36105dd366004612ef7565b600e6020526000908152604090205481565b3480156105fb57600080fd5b5061048b610f7f565b34801561061057600080fd5b5061048b61061f366004612e5d565b61107a565b34801561063057600080fd5b5061048b61063f366004612beb565b611095565b34801561065057600080fd5b5061048b61065f366004612beb565b6110ea565b34801561067057600080fd5b5060075461037590610100900460ff1681565b34801561068f57600080fd5b5061048b61069e366004612f6a565b61115a565b61048b6106b1366004612fd3565b6111c6565b3480156106c257600080fd5b506104536106d1366004612beb565b611332565b3480156106e257600080fd5b506104a3611368565b3480156106f757600080fd5b5061048b610706366004612ef7565b61139d565b34801561071757600080fd5b506104a3610726366004612ef7565b6113e9565b34801561073757600080fd5b5061048b61142e565b34801561074c57600080fd5b50600d546103759060ff1681565b34801561076657600080fd5b5061048b610775366004612ef7565b611464565b34801561078657600080fd5b506104a361100e81565b34801561079c57600080fd5b506104a3600281565b3480156107b157600080fd5b506107d56107c0366004612beb565b60086020526000908152604090205460ff1681565b6040516103819190613030565b3480156107ee57600080fd5b506004546001600160a01b0316610453565b34801561080c57600080fd5b5060408051808201909152600481526326a7a0a960e11b6020820152610426565b34801561083957600080fd5b506104a361066c81565b34801561084f57600080fd5b506104a36706f05b59d3b2000081565b34801561086b57600080fd5b5061048b61087a366004613058565b6114d8565b34801561088b57600080fd5b506104a36114e3565b3480156108a057600080fd5b506104a3612a3081565b3480156108b657600080fd5b5061048b6108c5366004613082565b61159a565b3480156108d657600080fd5b506104a360105481565b3480156108ec57600080fd5b506104266108fb366004612beb565b6115d2565b34801561090c57600080fd5b5061048b61091b3660046130ea565b61166c565b34801561092c57600080fd5b506104a367016345785d8a000081565b34801561094857600080fd5b5061048b6109573660046131ac565b6117ea565b34801561096857600080fd5b506104a360125481565b34801561097e57600080fd5b506104a36115b381565b34801561099457600080fd5b5061048b6109a3366004612c8b565b6118d4565b61048b6109b6366004612fd3565b611946565b3480156109c757600080fd5b506103756109d6366004613244565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205460ff1690565b61048b610a1236600461326e565b611b50565b348015610a2357600080fd5b5061048b610a32366004612beb565b611c61565b348015610a4357600080fd5b5061048b610a52366004612ef7565b611c91565b348015610a6357600080fd5b506104a3610a8c81565b348015610a7957600080fd5b5060055461037590600160a01b900460ff1681565b60006001600160e01b0319821663152a902d60e11b1480610ab35750610ab382611d29565b92915050565b6000818152602081905260408120546001600160a01b0316610aee57604051634a1850bf60e11b815260040160405180910390fd5b506000908152600260205260409020546001600160a01b031690565b6000610b1582611332565b9050806001600160a01b0316836001600160a01b031603610b49576040516349fa8bc360e11b815260040160405180910390fd5b336001600160a01b03821614801590610b695750610b6781336109d6565b155b15610b875760405163107619cb60e01b815260040160405180910390fd5b610b918383611d79565b505050565b600d5460009060ff1615610bbd57604051631faf1dd160e21b815260040160405180910390fd5b6005546001600160a01b03163314610be857604051638202605b60e01b815260040160405180910390fd5b50601055565b6005546001600160a01b03163314610c1957604051638202605b60e01b815260040160405180910390fd5b600d5460009060ff1615610c4057604051631faf1dd160e21b815260040160405180910390fd5b84518651141580610c5357508351865114155b80610c6057508251865114155b80610c6d57508151865114155b15610c8b5760405163512509d360e11b815260040160405180910390fd5b60005b8651811015610dde57858181518110610ca957610ca96132be565b6020026020010151600f6000898481518110610cc757610cc76132be565b6020026020010151815260200190815260200160002060000181905550848181518110610cf657610cf66132be565b6020026020010151600f6000898481518110610d1457610d146132be565b6020026020010151815260200190815260200160002060010181905550838181518110610d4357610d436132be565b6020026020010151600f6000898481518110610d6157610d616132be565b6020026020010151815260200190815260200160002060020181905550828181518110610d9057610d906132be565b6020026020010151600f6000898481518110610dae57610dae6132be565b60200260200101518152602001908152602001600020600301819055508080610dd6906132ea565b915050610c8e565b50505050505050565b610df2335b82611de7565b610e0f576040516344b4834360e11b815260040160405180910390fd5b610b91838383611e9a565b60008281526020819052604081205481906001600160a01b0316610e5157604051634a1850bf60e11b815260040160405180910390fd5b600954600a546001600160a01b0390911690606490610e709086613303565b610e7a9190613338565b915091505b9250929050565b610e91335b83611de7565b610eae576040516344b4834360e11b815260040160405180910390fd5b600160008381526008602052604090205460ff166002811115610ed357610ed361301a565b03610ef1576040516363f0078160e01b815260040160405180910390fd5b80610efd576000610f00565b60025b6000838152600860205260409020805460ff19166001836002811115610f2857610f2861301a565b021790555081610f3783611332565b6001600160a01b03167ff353fbd4da08b85b84f5c67a78630899f3697f6fd111e1a8a0486aa3cf2e5f2e83604051610f73911515815260200190565b60405180910390a35050565b6004546001600160a01b03163314610fb25760405162461bcd60e51b8152600401610fa99061334c565b60405180910390fd5b6002600b54036110045760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610fa9565b6002600b55604051600090339047908381818185875af1925050503d806000811461104b576040519150601f19603f3d011682016040523d82523d6000602084013e611050565b606091505b505090508061107257604051631d42c86760e21b815260040160405180910390fd5b506001600b55565b610b918383836040518060200160405280600081525061159a565b60075460ff166110b85760405163a3d4b25560e01b815260040160405180910390fd5b6110c133610dec565b6110de576040516344b4834360e11b815260040160405180910390fd5b6110e781611f0f565b50565b6005546001600160a01b0316331461111557604051638202605b60e01b815260040160405180910390fd5b7f60a991991c016afbf0de8733940aa735ec22850d153fd7adc44079532594c6f1810161115157600d805460ff19811660ff9091161517905550565b6110e781611fac565b6004546001600160a01b031633146111845760405162461bcd60e51b8152600401610fa99061334c565b600554600160a01b900460ff16156111af5760405163777821ff60e11b815260040160405180910390fd5b80516111c2906006906020840190612b1f565b5050565b600d5460019060ff16151581146111f057604051631faf1dd160e21b815260040160405180910390fd5b32331461121057604051637bf6403b60e11b815260040160405180910390fd5b601054421015611233576040516337bf561360e11b815260040160405180910390fd5b6040805130602082015233918101919091527f57099dca9e95fa778f3d498664bae672f761017d54b2476b12bc4a956eb11ce0606082015260009060800160408051601f1981840301815291905280516020909101206013549091506112a3906001600160a01b03168285612094565b6112c057604051638baa579f60e01b815260040160405180910390fd5b60006112db8560125461100e6112d69190613381565b6121e2565b9050600081116112fe57604051633831346160e01b815260040160405180910390fd5b80601260008282546113109190613398565b9091555061132b90506002826113246114e3565b60006121f8565b5050505050565b6000818152602081905260408120546001600160a01b031680610ab357604051634a1850bf60e11b815260040160405180910390fd5b611376610a8c612a30613338565b61139067016345785d8a00006706f05b59d3b20000613381565b61139a9190613338565b81565b6004546001600160a01b031633146113c75760405162461bcd60e51b8152600401610fa99061334c565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b0382166114125760405163d92e233d60e01b815260040160405180910390fd5b506001600160a01b031660009081526001602052604090205490565b6004546001600160a01b031633146114585760405162461bcd60e51b8152600401610fa99061334c565b6114626000612458565b565b600d5460009060ff161561148b57604051631faf1dd160e21b815260040160405180910390fd5b6004546001600160a01b031633146114b55760405162461bcd60e51b8152600401610fa99061334c565b50601380546001600160a01b0319166001600160a01b0392909216919091179055565b6111c23383836124aa565b6010546000904290811015611501576706f05b59d3b2000091505090565b612a30601054826115129190613381565b106115265767016345785d8a000091505090565b6000610a8c601054836115399190613381565b6115439190613338565b9050611553610a8c612a30613338565b61156d67016345785d8a00006706f05b59d3b20000613381565b6115779190613338565b6115819082613303565b611593906706f05b59d3b20000613381565b9250505090565b6115a333610e8b565b6115c0576040516344b4834360e11b815260040160405180910390fd5b6115cc84848484612549565b50505050565b6000818152602081905260409020546060906001600160a01b031661160a57604051634a1850bf60e11b815260040160405180910390fd5b600060068054611619906133b0565b9050111561165357600661162c8361257d565b60405160200161163d929190613406565b6040516020818303038152906040529050919050565b61165c8261257d565b60405160200161163d91906134ac565b6005546001600160a01b0316331461169757604051638202605b60e01b815260040160405180910390fd5b80518251146116b95760405163512509d360e11b815260040160405180910390fd5b60005b8251811015610b91578181815181106116d7576116d76132be565b60200260200101516116ea5760006116ed565b60015b60086000858481518110611703576117036132be565b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083600281111561173a5761173a61301a565b0217905550828181518110611751576117516132be565b602002602001015161177b84838151811061176e5761176e6132be565b6020026020010151611332565b6001600160a01b03167ff353fbd4da08b85b84f5c67a78630899f3697f6fd111e1a8a0486aa3cf2e5f2e8484815181106117b7576117b76132be565b60200260200101516040516117d0911515815260200190565b60405180910390a3806117e2816132ea565b9150506116bc565b6005546001600160a01b0316331461181557604051638202605b60e01b815260040160405180910390fd5b600d5460009060ff161561183c57604051631faf1dd160e21b815260040160405180910390fd5b60005b82518110156118965761188483828151811061185d5761185d6132be565b60200260200101518260115460016118759190613398565b61187f9190613398565b61267e565b8061188e816132ea565b91505061183f565b508151601160008282546118aa9190613398565b90915550506011546115b310156111c257604051630f0c37b960e11b815260040160405180910390fd5b6004546001600160a01b031633146118fe5760405162461bcd60e51b8152600401610fa99061334c565b60648111156119205760405163bcd4a2a160e01b815260040160405180910390fd5b600980546001600160a01b0319166001600160a01b039390931692909217909155600a55565b600d5460019060ff161515811461197057604051631faf1dd160e21b815260040160405180910390fd5b32331461199057604051637bf6403b60e11b815260040160405180910390fd5b6000805160206135a48339815191526000818152600f6020527fc68702abfd30dc6923256f08aba03384df0a333ee6011d286659e33dfdbb16fe547fc68702abfd30dc6923256f08aba03384df0a333ee6011d286659e33dfdbb16ff549091906119fb906001613303565b611a059083613398565b905081421080611a155750804210155b15611a33576040516337bf561360e11b815260040160405180910390fd5b6040805130602082015233918101919091526000805160206135a4833981519152606082015260009060800160408051601f198184030181529190528051602090910120601354909150611a91906001600160a01b03168288612094565b611aae57604051638baa579f60e01b815260040160405180910390fd5b6000611ac48860125461066c6112d69190613381565b905060008111611ae6576040516293210360e81b815260040160405180910390fd5b8060126000828254611af89190613398565b90915550506000805160206135a4833981519152600052600f6020527fc68702abfd30dc6923256f08aba03384df0a333ee6011d286659e33dfdbb170154611b4690600290839060016121f8565b5050505050505050565b600d5460019060ff1615158114611b7a57604051631faf1dd160e21b815260040160405180910390fd5b6000848152600f60205260408120805460019182015487939192611b9e9190613303565b611ba89083613398565b905081421080611bb85750804210155b15611bd6576040516337bf561360e11b815260040160405180910390fd5b6040805130602080830191909152338284015260608083018b90528351808403909101815260809092019092528051910120601354611c1f906001600160a01b03168288612094565b611c3c57604051638baa579f60e01b815260040160405180910390fd5b6000888152600f602052604081206002810154600390910154611b46928a91906121f8565b6005546001600160a01b03163314611c8c57604051638202605b60e01b815260040160405180910390fd5b600c55565b6004546001600160a01b03163314611cbb5760405162461bcd60e51b8152600401610fa99061334c565b6001600160a01b038116611d205760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610fa9565b6110e781612458565b60006001600160e01b031982166380ac58cd60e01b1480611d5a57506001600160e01b03198216635b5e139f60e01b145b80610ab357506301ffc9a760e01b6001600160e01b0319831614610ab3565b600081815260026020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611dae82611332565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152602081905260408120546001600160a01b0316611e1c57604051634a1850bf60e11b815260040160405180910390fd5b6000611e2783611332565b9050806001600160a01b0316846001600160a01b03161480611e625750836001600160a01b0316611e5784610ab9565b6001600160a01b0316145b80611e9257506001600160a01b0380821660009081526003602090815260408083209388168352929052205460ff165b949350505050565b600754610100900460ff1615611ec357604051633078994b60e21b815260040160405180910390fd5b60008181526008602052604081205460ff166002811115611ee657611ee661301a565b14611f0457604051632b36b06160e01b815260040160405180910390fd5b610b91838383612764565b6000611f1a82611332565b9050611f27600083611d79565b6001600160a01b03811660009081526001602081905260408220805491929091611f52908490613381565b909155505060008281526020819052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6004546001600160a01b03163314611fd65760405162461bcd60e51b8152600401610fa99061334c565b7ffb395b85186ef1074d6adea56817b6a56150a8484fa4027406ae124c02b5e95d8101612012576007805460ff19811660ff9091161517905550565b7f6ebcdc927eddac6b0c429a4bb191d6020b2845f88c2644c0a33ea147f45c8889810161205757506007805461ff001981166101009182900460ff1615909102179055565b7f950517b5e338c7da4884d270eb23aa5fad139ba920a34f6bf1a21b611a93f42d81016110e7576005805460ff60a01b1916600160a01b17905550565b60008060006120a3858561288c565b909250905060008160048111156120bc576120bc61301a565b1480156120da5750856001600160a01b0316826001600160a01b0316145b156120ea576001925050506121db565b600080876001600160a01b0316631626ba7e60e01b8888604051602401612112929190613500565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516121509190613519565b600060405180830381855afa9150503d806000811461218b576040519150601f19603f3d011682016040523d82523d6000602084013e612190565b606091505b50915091508180156121a3575080516020145b80156121d457508051630b135d3f60e11b906121c89083016020908101908401613535565b6001600160e01b031916145b9450505050505b9392505050565b60008183106121f157816121db565b5090919050565b336000908152600e60205260409020548490612215908590613398565b111561223457604051636998bf9360e01b815260040160405180910390fd5b600061224a846011546115b36112d69190613381565b90506000811161226d57604051630f0c37b960e11b815260040160405180910390fd5b336000908152600e60205260408120805483929061228c908490613398565b909155506000905061229e8285613303565b9050803410156122c15760405163078d696560e31b815260040160405180910390fd5b60018211156123365760005b828110156123305760008160115460016122e79190613398565b6122f19190613398565b90506122fd338261267e565b841561231d576000818152600860205260409020805460ff191660011790555b5080612328816132ea565b9150506122cd565b50612375565b600060115460016123479190613398565b9050612353338261267e565b8315612373576000818152600860205260409020805460ff191660011790555b505b81601160008282546123879190613398565b90915550506011546115b310156123b157604051630f0c37b960e11b815260040160405180910390fd5b803411156124505760006123c58234613381565b604051909150600090339083908381818185875af1925050503d806000811461240a576040519150601f19603f3d011682016040523d82523d6000602084013e61240f565b606091505b5050905080611b465760405182815233907f58ed53f57360e3586c9d1171f475e68b67808b6c163f3676757eb00d8f1bb7cf9060200160405180910390a250505b505050505050565b600480546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036124dc576040516349fa8bc360e11b815260040160405180910390fd5b6001600160a01b03838116600081815260036020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612554848484611e9a565b612560848484846128f7565b6115cc576040516342eac10f60e11b815260040160405180910390fd5b6060816000036125a45750506040805180820190915260018152600360fc1b602082015290565b8160005b81156125ce57806125b8816132ea565b91506125c79050600a83613338565b91506125a8565b60008167ffffffffffffffff8111156125e9576125e9612cb5565b6040519080825280601f01601f191660200182016040528015612613576020820181803683370190505b5090505b8415611e9257612628600183613381565b9150612635600a86613552565b612640906030613398565b60f81b818381518110612655576126556132be565b60200101906001600160f81b031916908160001a905350612677600a86613338565b9450612617565b6001600160a01b0382166126a55760405163d92e233d60e01b815260040160405180910390fd5b6000818152602081905260409020546001600160a01b0316156126db57604051635c5e682d60e01b815260040160405180910390fd5b6001600160a01b03821660009081526001602081905260408220805491929091612706908490613398565b909155505060008181526020819052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b826001600160a01b031661277782611332565b6001600160a01b03161461279e5760405163106b771d60e31b815260040160405180910390fd5b6001600160a01b0382166127c55760405163d92e233d60e01b815260040160405180910390fd5b6127d0600082611d79565b6001600160a01b038316600090815260016020819052604082208054919290916127fb908490613381565b90915550506001600160a01b0382166000908152600160208190526040822080549192909161282b908490613398565b909155505060008181526020819052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60008082516041036128c25760208301516040840151606085015160001a6128b6878285856129f9565b94509450505050610e7f565b82516040036128eb57602083015160408401516128e0868383612ae6565b935093505050610e7f565b50600090506002610e7f565b60006001600160a01b0384163b156129ee57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061293b903390899088908890600401613566565b6020604051808303816000875af1925050508015612976575060408051601f3d908101601f1916820190925261297391810190613535565b60015b6129d4573d8080156129a4576040519150601f19603f3d011682016040523d82523d6000602084013e6129a9565b606091505b5080516000036129cc576040516342eac10f60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611e92565b506001949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612a305750600090506003612add565b8460ff16601b14158015612a4857508460ff16601c14155b15612a595750600090506004612add565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612aad573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612ad657600060019250925050612add565b9150600090505b94509492505050565b6000806001600160ff1b03831681612b0360ff86901c601b613398565b9050612b11878288856129f9565b935093505050935093915050565b828054612b2b906133b0565b90600052602060002090601f016020900481019282612b4d5760008555612b93565b82601f10612b6657805160ff1916838001178555612b93565b82800160010185558215612b93579182015b82811115612b93578251825591602001919060010190612b78565b50612b9f929150612ba3565b5090565b5b80821115612b9f5760008155600101612ba4565b6001600160e01b0319811681146110e757600080fd5b600060208284031215612be057600080fd5b81356121db81612bb8565b600060208284031215612bfd57600080fd5b5035919050565b60005b83811015612c1f578181015183820152602001612c07565b838111156115cc5750506000910152565b60008151808452612c48816020860160208601612c04565b601f01601f19169290920160200192915050565b6020815260006121db6020830184612c30565b80356001600160a01b0381168114612c8657600080fd5b919050565b60008060408385031215612c9e57600080fd5b612ca783612c6f565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612cf457612cf4612cb5565b604052919050565b600067ffffffffffffffff821115612d1657612d16612cb5565b5060051b60200190565b600082601f830112612d3157600080fd5b81356020612d46612d4183612cfc565b612ccb565b82815260059290921b84018101918181019086841115612d6557600080fd5b8286015b84811015612d805780358352918301918301612d69565b509695505050505050565b600080600080600060a08688031215612da357600080fd5b853567ffffffffffffffff80821115612dbb57600080fd5b612dc789838a01612d20565b96506020880135915080821115612ddd57600080fd5b612de989838a01612d20565b95506040880135915080821115612dff57600080fd5b612e0b89838a01612d20565b94506060880135915080821115612e2157600080fd5b612e2d89838a01612d20565b93506080880135915080821115612e4357600080fd5b50612e5088828901612d20565b9150509295509295909350565b600080600060608486031215612e7257600080fd5b612e7b84612c6f565b9250612e8960208501612c6f565b9150604084013590509250925092565b60008060408385031215612eac57600080fd5b50508035926020909101359150565b80358015158114612c8657600080fd5b60008060408385031215612ede57600080fd5b82359150612eee60208401612ebb565b90509250929050565b600060208284031215612f0957600080fd5b6121db82612c6f565b600067ffffffffffffffff831115612f2c57612f2c612cb5565b612f3f601f8401601f1916602001612ccb565b9050828152838383011115612f5357600080fd5b828260208301376000602084830101529392505050565b600060208284031215612f7c57600080fd5b813567ffffffffffffffff811115612f9357600080fd5b8201601f81018413612fa457600080fd5b611e9284823560208401612f12565b600082601f830112612fc457600080fd5b6121db83833560208501612f12565b60008060408385031215612fe657600080fd5b82359150602083013567ffffffffffffffff81111561300457600080fd5b61301085828601612fb3565b9150509250929050565b634e487b7160e01b600052602160045260246000fd5b602081016003831061305257634e487b7160e01b600052602160045260246000fd5b91905290565b6000806040838503121561306b57600080fd5b61307483612c6f565b9150612eee60208401612ebb565b6000806000806080858703121561309857600080fd5b6130a185612c6f565b93506130af60208601612c6f565b925060408501359150606085013567ffffffffffffffff8111156130d257600080fd5b6130de87828801612fb3565b91505092959194509250565b600080604083850312156130fd57600080fd5b823567ffffffffffffffff8082111561311557600080fd5b61312186838701612d20565b935060209150818501358181111561313857600080fd5b85019050601f8101861361314b57600080fd5b8035613159612d4182612cfc565b81815260059190911b8201830190838101908883111561317857600080fd5b928401925b8284101561319d5761318e84612ebb565b8252928401929084019061317d565b80955050505050509250929050565b600060208083850312156131bf57600080fd5b823567ffffffffffffffff8111156131d657600080fd5b8301601f810185136131e757600080fd5b80356131f5612d4182612cfc565b81815260059190911b8201830190838101908783111561321457600080fd5b928401925b828410156132395761322a84612c6f565b82529284019290840190613219565b979650505050505050565b6000806040838503121561325757600080fd5b61326083612c6f565b9150612eee60208401612c6f565b60008060006060848603121561328357600080fd5b8335925060208401359150604084013567ffffffffffffffff8111156132a857600080fd5b6132b486828701612fb3565b9150509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016132fc576132fc6132d4565b5060010190565b600081600019048311821515161561331d5761331d6132d4565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261334757613347613322565b500490565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082821015613393576133936132d4565b500390565b600082198211156133ab576133ab6132d4565b500190565b600181811c908216806133c457607f821691505b6020821081036133e457634e487b7160e01b600052602260045260246000fd5b50919050565b600081516133fc818560208601612c04565b9290920192915050565b600080845481600182811c91508083168061342257607f831692505b6020808410820361344157634e487b7160e01b86526022600452602486fd5b818015613455576001811461346657613493565b60ff19861689528489019650613493565b60008b81526020902060005b8681101561348b5781548b820152908501908301613472565b505084890196505b5050505050506134a381856133ea565b95945050505050565b7f68747470733a2f2f6d657461646174612e7468656677656e636c75622e636f6d8152652f6d6f61722f60d01b6020820152600082516134f3816026850160208701612c04565b9190910160260192915050565b828152604060208201526000611e926040830184612c30565b6000825161352b818460208701612c04565b9190910192915050565b60006020828403121561354757600080fd5b81516121db81612bb8565b60008261356157613561613322565b500690565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061359990830184612c30565b969550505050505056fedd78a0a08b9f6bab22efdfbf89882075211b90807220a959000925597bd4e4b8a26469706673582212202f0ea01eaef502fb45a4288e17b16e1875c406e52d1a4385dc124ba3a07379cc64736f6c634300080d0033

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

0000000000000000000000005112d14803dbaf87c0261bb3ef39d374e3f739fc000000000000000000000000fb4ae66ab40fcaff28d8d2d930a073752ec2792f000000000000000000000000b75afba91d6befc8b2ee739270827fd9c5714cfb

-----Decoded View---------------
Arg [0] : authority (address): 0x5112d14803dBAf87C0261BB3EF39D374e3f739Fc
Arg [1] : admin (address): 0xFb4AE66ab40fcaFf28d8d2d930A073752EC2792F
Arg [2] : royaltyAddress (address): 0xB75afBa91d6BEfc8B2ee739270827Fd9C5714CfB

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000005112d14803dbaf87c0261bb3ef39d374e3f739fc
Arg [1] : 000000000000000000000000fb4ae66ab40fcaff28d8d2d930a073752ec2792f
Arg [2] : 000000000000000000000000b75afba91d6befc8b2ee739270827fd9c5714cfb


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

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