ETH Price: $2,632.40 (-1.47%)
Gas: 1 Gwei

Token

MultiChain Gang (MCG)
 

Overview

Max Total Supply

0 MCG

Holders

7

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
2 MCG
0x8142409931f554d99013de129cddc70ea016d62d
Loading...
Loading
Loading...
Loading
Loading...
Loading

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

Contract Source Code Verified (Exact Match)

Contract Name:
MultiChainGang

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 1000 runs

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

pragma solidity 0.8.4;

import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./lib/Operatorable.sol";

contract MultiChainGang is ERC721URIStorage, Operatorable, ReentrancyGuard {
    using SafeMath for uint256;

    //Last stake token id, start from 1
    uint256 public tokenIds;

    //Number of items in q, start from 1, add 1 when new item in q, subtract when popped from q
    uint256 public queueIds;

    //NFT Base URI
    string public baseURI;

    //NFT Collection Description
    string public collectionDescription;

    //cap on # of nfts in collection
    uint256 public _cap;

    //info about tokenId stored in contract
    struct NFTInfo {
        string[] badges;
        bool upgraded;
        string upgradeRank;
        uint256 upgradeCount;
    }

    //info about an upgrade in queue i.e. before tokenuri gets set
    struct UpgradeInQ {
        uint256 _tokenID_;
        string[] inputBadges;
        string upgradeType;
        string upgradeRank;
        bool isDeleted;
    }

    //Collection wallet => nft id
    mapping(address => uint256[]) public collectionIds;

    //info for a given tokenId
    mapping(uint256 => NFTInfo) public tokenInfo;

    //info about an upgrade by its id - get count and then call this for each up to the num in queueIds
    mapping(uint256 => UpgradeInQ) public upgradesInQ;

    event NFTCreated(uint256 indexed nftId, address indexed account);
    event NFTUpgraded(
        uint256 indexed previousTokenId,
        uint256 indexed newTokenId,
        uint256 offChainTokenId,
        string offChainChainName,
        string[] _badges,
        string _upgradeRank,
        uint256 _upgradeCount,
        string _upgradeType,
        address indexed mintToAddress
    );

    constructor(
        string memory collectionName,
        string memory collectionSymbol,
        string memory collectionBaseURI,
        uint256 cap
    ) ERC721(collectionName, collectionSymbol) {
        require(
            cap > 0,
            "StandardCappedNFTCollection#constructor: CAP_MUST_BE_GREATER_THAN_0"
        );
        baseURI = collectionBaseURI;
        _cap = cap;
    }

    /**
     * @dev Override supportInterface.
     */
    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(AccessControl, ERC721)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }

    /**
     * @dev Get collection token id array owned by wallet address.
     * @param account address
     */
    function getCollectionIds(address account)
        public
        view
        returns (uint256[] memory)
    {
        return collectionIds[account];
    }

    /**********************|
    |          URI         |
    |_____________________*/

    /**
     * @dev Set token URI
     * Only `operator` can call
     *
     * - `tokenId` must exist, see {ERC721URIStorage:_setTokenURI}
     */
    function setTokenURI(
        uint256 tokenId,
        string memory _tokenURI,
        uint256 qId
    ) public onlyOperator {
        UpgradeInQ storage tokenQueueItem = upgradesInQ[qId];

        //create a check here that the tokenId is in the queue as an upgrade, otherwise it fails
        require(
            upgradesInQ[qId]._tokenID_ == tokenId,
            "MultiChainGang: NOT_VALID_UPGRADE"
        );
        require(
            !(tokenQueueItem.isDeleted),
            "MultiChainGang: ALREADY_UPGRADED"
        );
        super._setTokenURI(tokenId, _tokenURI);
        //after setting the tokenUri, then set isDeleted to true
        tokenQueueItem.isDeleted = true;
    }

    /**
     * @dev Set `baseURI`
     * Only `operator` can call
     */
    function setBaseURI(string memory baseURI_) public onlyOwner {
        baseURI = baseURI_;
    }

    /**
     * @dev Return base URI
     * Override {ERC721:_baseURI}
     */
    function _baseURI() internal view override returns (string memory) {
        return baseURI;
    }

    /**********************|
    |          Description |
    |_____________________*/

    function addDescription(string memory description) public onlyOperator {
        collectionDescription = description;
    }

    /**********************|
    |          MINT        |
    |_____________________*/

    /**
     * @dev Mint a new token.
     * @param recipient address
     */
    function mintNFT(
        address recipient,
        string memory _tokenURI,
        string[] memory _badges,
        uint256 _upgradeCount,
        string memory _upgradeRank
    ) public onlyOperator returns (uint256) {
        tokenIds++;

        NFTInfo storage theTokenIdInfo = tokenInfo[tokenIds];
        theTokenIdInfo.badges = _badges;
        theTokenIdInfo.upgraded = false;
        theTokenIdInfo.upgradeRank = _upgradeRank;
        theTokenIdInfo.upgradeCount = _upgradeCount;

        _mint(recipient, tokenIds);
        super._setTokenURI(tokenIds, _tokenURI);
        return tokenIds;
    }

    function upgradeNFT(
        uint256 onChainTokenId,
        uint256 offChainTokenId,
        string memory offChainChainName,
        string[] memory _badges,
        string memory _upgradeRank,
        uint256 _upgradeCount,
        string memory _upgradeType,
        address mintToAddress
    ) public onlyOperator {
        tokenIds++;

        NFTInfo storage onChainTokenInfo = tokenInfo[onChainTokenId];
        NFTInfo storage tokenIdInfo = tokenInfo[tokenIds];
        require(
            onChainTokenInfo.upgradeCount > 0,
            "MultiChainGang: NOT_AVAILABLE_UPGRADE"
        );

        //add info to NFTInfo: upgraded to true, upgradeRank and badges and reducing upgradeCount by 1 i.e. available upgrades count
        tokenIdInfo.badges = _badges;
        tokenIdInfo.upgraded = true;
        tokenIdInfo.upgradeRank = _upgradeRank;
        tokenIdInfo.upgradeCount = _upgradeCount;

        //reduce upgradeCount on the onChainTokenId used as input by 1
        onChainTokenInfo.upgradeCount = onChainTokenInfo.upgradeCount - 1;

        //add tokenId and info to upgradeQueue
        queueIds++;
        UpgradeInQ storage tokenQueue = upgradesInQ[queueIds];
        tokenQueue._tokenID_ = tokenIds;
        tokenQueue.inputBadges = _badges;
        tokenQueue.upgradeType = _upgradeType;
        tokenQueue.upgradeRank = _upgradeRank;
        tokenQueue.isDeleted = false;

        //mint the token without setting the tokenURI
        _mint(mintToAddress, tokenIds);

        emit NFTUpgraded(
            onChainTokenId,
            tokenIds,
            offChainTokenId,
            offChainChainName,
            _badges,
            _upgradeRank,
            _upgradeCount,
            _upgradeType,
            mintToAddress
        );
    }

    /**
     * @dev Check if wallet address owns any nfts in the collection.
     * @param account address
     */
    function isHolder(address account) public view returns (bool) {
        return balanceOf(account) > 0;
    }

    /**
     * @dev Remove the given token from collectionIds.
     *
     * @param from address from
     * @param tokenId tokenId to remove
     */
    function _popId(address from, uint256 tokenId) internal {
        uint256[] storage _collectionIds = collectionIds[from];
        for (uint256 i = 0; i < _collectionIds.length; i++) {
            if (_collectionIds[i] == tokenId) {
                if (i != _collectionIds.length - 1) {
                    _collectionIds[i] = _collectionIds[
                        _collectionIds.length - 1
                    ];
                }
                _collectionIds.pop();
                break;
            }
        }
    }

    /**
     * @dev Mint a new NFT in the Collection.
     * Requirements:
     *
     * - `account` must not be zero address, check ERC721 {_mint}
     * @param account address of recipient.
     */
    function _mint(address account, uint256 tokenId) internal virtual override {
        require(
            tokenId <= _cap,
            "StandardCappedNFTCollection#_mint: CANNOT_EXCEED_MINTING_CAP"
        );
        super._mint(account, tokenId);
        collectionIds[account].push(tokenId);
        emit NFTCreated(tokenId, account);
    }

    /**
     * @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`.
     *
     * @param from address from
     * @param to address to
     * @param tokenId tokenId to transfer
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal override {
        require(
            to != address(0),
            "CommunityNFT#_transfer: TRANSFER_TO_THE_ZERO_ADDRESS"
        );
        super._transfer(from, to, tokenId);
        _popId(from, tokenId);
        collectionIds[to].push(tokenId);
    }
}

File 2 of 18 : ERC721URIStorage.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721URIStorage.sol)

pragma solidity ^0.8.0;

import "../ERC721.sol";

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

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

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

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

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

        return super.tokenURI(tokenId);
    }

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

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

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

File 3 of 18 : 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 4 of 18 : 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 5 of 18 : Operatorable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";

import "../Error.sol";

contract Operatorable is Ownable, AccessControl {
  bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE");

  /**
    * @dev Restricted to members of the `operator` role.
    */
  modifier onlyOperator() {
    if (!hasRole(OPERATOR_ROLE, msg.sender)) revert("MultiChainGang:NOT_OPERATOR");
    _;
  }

  constructor() {
    _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
    _setupRole(OPERATOR_ROLE, msg.sender);
  }

  /**
    * @dev Add an `_account` to the `operator` role.
    */
  function addOperator(address _account) public onlyOwner {
    grantRole(OPERATOR_ROLE, _account);
  }

  /**
    * @dev Remove an `_account` from the `operator` role.
    */
  function removeOperator(address _account) public onlyOwner {
    revokeRole(OPERATOR_ROLE, _account);
  }

  /**
    * @dev Check if an _account is operator.
    */
  function isOperator(address _account) public view returns (bool) {
    return hasRole(OPERATOR_ROLE, _account);
  }
}

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

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);
    }

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 8 of 18 : 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 9 of 18 : 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 10 of 18 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 11 of 18 : 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 12 of 18 : 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 13 of 18 : 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 14 of 18 : 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 15 of 18 : 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 16 of 18 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 override returns (bool) {
        return _roles[role].members[account];
    }

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

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

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

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

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been 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 17 of 18 : Error.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;

error InvalidAddress();

error InvalidRoyaltiesFee();

error CallerNotOperator();

error SaleStarted();

error InvalidSaleStartTime();

error SaleNotOpen();

error CallerNotNFTOwner();

error CallerNotNFTOwnerOrTokenInvalid();

error OwnershipChanged();

error InvalidNFTId();

error SelfPurchase();

error NFTClosedForSale();

error InvalidPrice();

error InvalidMaxDuration();

error CallerContractAccount();

File 18 of 18 : 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;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"collectionName","type":"string"},{"internalType":"string","name":"collectionSymbol","type":"string"},{"internalType":"string","name":"collectionBaseURI","type":"string"},{"internalType":"uint256","name":"cap","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"nftId","type":"uint256"},{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"NFTCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"previousTokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"newTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"offChainTokenId","type":"uint256"},{"indexed":false,"internalType":"string","name":"offChainChainName","type":"string"},{"indexed":false,"internalType":"string[]","name":"_badges","type":"string[]"},{"indexed":false,"internalType":"string","name":"_upgradeRank","type":"string"},{"indexed":false,"internalType":"uint256","name":"_upgradeCount","type":"uint256"},{"indexed":false,"internalType":"string","name":"_upgradeType","type":"string"},{"indexed":true,"internalType":"address","name":"mintToAddress","type":"address"}],"name":"NFTUpgraded","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":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_cap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"description","type":"string"}],"name":"addDescription","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"addOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collectionDescription","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"collectionIds","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":"account","type":"address"}],"name":"getCollectionIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isHolder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"isOperator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"string","name":"_tokenURI","type":"string"},{"internalType":"string[]","name":"_badges","type":"string[]"},{"internalType":"uint256","name":"_upgradeCount","type":"uint256"},{"internalType":"string","name":"_upgradeRank","type":"string"}],"name":"mintNFT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"queueIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"removeOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"},{"internalType":"uint256","name":"qId","type":"uint256"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenInfo","outputs":[{"internalType":"bool","name":"upgraded","type":"bool"},{"internalType":"string","name":"upgradeRank","type":"string"},{"internalType":"uint256","name":"upgradeCount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"onChainTokenId","type":"uint256"},{"internalType":"uint256","name":"offChainTokenId","type":"uint256"},{"internalType":"string","name":"offChainChainName","type":"string"},{"internalType":"string[]","name":"_badges","type":"string[]"},{"internalType":"string","name":"_upgradeRank","type":"string"},{"internalType":"uint256","name":"_upgradeCount","type":"uint256"},{"internalType":"string","name":"_upgradeType","type":"string"},{"internalType":"address","name":"mintToAddress","type":"address"}],"name":"upgradeNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"upgradesInQ","outputs":[{"internalType":"uint256","name":"_tokenID_","type":"uint256"},{"internalType":"string","name":"upgradeType","type":"string"},{"internalType":"string","name":"upgradeRank","type":"string"},{"internalType":"bool","name":"isDeleted","type":"bool"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b5060405162003a2c38038062003a2c8339810160408190526200003491620003b3565b8383620000413362000156565b8151620000569060019060208501906200025a565b5080516200006c9060029060208401906200025a565b506200007e91506000905033620001a6565b620000aa7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92933620001a6565b600160095580620001335760405162461bcd60e51b815260206004820152604360248201527f5374616e646172644361707065644e4654436f6c6c656374696f6e23636f6e7360448201527f74727563746f723a204341505f4d5553545f42455f475245415445525f54484160648201526204e5f360ec1b608482015260a40160405180910390fd5b81516200014890600c9060208501906200025a565b50600e55506200049b915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b620001b28282620001b6565b5050565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff16620001b25760008281526008602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620002163390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b828054620002689062000448565b90600052602060002090601f0160209004810192826200028c5760008555620002d7565b82601f10620002a757805160ff1916838001178555620002d7565b82800160010185558215620002d7579182015b82811115620002d7578251825591602001919060010190620002ba565b50620002e5929150620002e9565b5090565b5b80821115620002e55760008155600101620002ea565b600082601f83011262000311578081fd5b81516001600160401b03808211156200032e576200032e62000485565b604051601f8301601f19908116603f0116810190828211818310171562000359576200035962000485565b8160405283815260209250868385880101111562000375578485fd5b8491505b8382101562000398578582018301518183018401529082019062000379565b83821115620003a957848385830101525b9695505050505050565b60008060008060808587031215620003c9578384fd5b84516001600160401b0380821115620003e0578586fd5b620003ee8883890162000300565b9550602087015191508082111562000404578485fd5b620004128883890162000300565b9450604087015191508082111562000428578384fd5b50620004378782880162000300565b606096909601519497939650505050565b600181811c908216806200045d57607f821691505b602082108114156200047f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b61358180620004ab6000396000f3fe608060405234801561001057600080fd5b50600436106102d35760003560e01c80638da5cb5b11610186578063c98b54b2116100e3578063e2c6875c11610097578063f2fde38b11610071578063f2fde38b1461061d578063f5b541a614610630578063f6938ed91461065757600080fd5b8063e2c6875c146105b6578063e98050c7146105be578063e985e9c5146105e157600080fd5b8063d4d7b19a116100c8578063d4d7b19a1461057d578063d547741f14610590578063e2282bd4146105a357600080fd5b8063c98b54b214610548578063cc33c8751461055b57600080fd5b8063a22cb4651161013a578063ac8a584a1161011f578063ac8a584a1461050f578063b88d4fde14610522578063c87b56dd1461053557600080fd5b8063a22cb465146104e9578063a72ade44146104fc57600080fd5b806395d89b411161016b57806395d89b41146104c65780639870d7fe146104ce578063a217fddf146104e157600080fd5b80638da5cb5b1461047c57806391d148541461048d57600080fd5b806342842e0e116102345780636c255c19116101e857806370a08231116101cd57806370a0823114610458578063714cff561461046b578063715018a61461047457600080fd5b80636c255c19146104325780636d70f7ae1461044557600080fd5b80636352211e116102195780636352211e1461040e57806365d42184146104215780636c0360eb1461042a57600080fd5b806342842e0e146103e857806355f804b3146103fb57600080fd5b806309a16ae51161028b578063248a9ca311610270578063248a9ca31461039f5780632f2ff15d146103c257806336568abe146103d557600080fd5b806309a16ae51461036c57806323b872dd1461038c57600080fd5b806306fdde03116102bc57806306fdde0314610317578063081812fc1461032c578063095ea7b31461035757600080fd5b806301ffc9a7146102d8578063060cf4e814610300575b600080fd5b6102eb6102e6366004612fa5565b61066a565b60405190151581526020015b60405180910390f35b610309600e5481565b6040519081526020016102f7565b61031f61067b565b6040516102f791906132bb565b61033f61033a366004612f6b565b61070d565b6040516001600160a01b0390911681526020016102f7565b61036a610365366004612f42565b6107a7565b005b61037f61037a366004612d69565b6108d9565b6040516102f7919061324c565b61036a61039a366004612db5565b610945565b6103096103ad366004612f6b565b60009081526008602052604090206001015490565b61036a6103d0366004612f83565b6109cc565b61036a6103e3366004612f83565b6109f2565b61036a6103f6366004612db5565b610a7e565b61036a610409366004612fdd565b610a99565b61033f61041c366004612f6b565b610b06565b610309600b5481565b61031f610b91565b610309610440366004612ea3565b610c1f565b6102eb610453366004612d69565b610d2a565b610309610466366004612d69565b610d6a565b610309600a5481565b61036a610e04565b6000546001600160a01b031661033f565b6102eb61049b366004612f83565b60009182526008602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61031f610e6a565b61036a6104dc366004612d69565b610e79565b610309600081565b61036a6104f7366004612e69565b610f00565b61036a61050a36600461305e565b610f0b565b61036a61051d366004612d69565b611166565b61036a610530366004612df0565b6111ea565b61031f610543366004612f6b565b611278565b61036a610556366004613010565b6113fe565b61056e610569366004612f6b565b611572565b6040516102f793929190613290565b6102eb61058b366004612d69565b611624565b61036a61059e366004612f83565b611637565b6103096105b1366004612f42565b61165d565b61031f61168e565b6105d16105cc366004612f6b565b61169b565b6040516102f79493929190613374565b6102eb6105ef366004612d83565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b61036a61062b366004612d69565b6117d7565b6103097f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92981565b61036a610665366004612fdd565b6118b6565b600061067582611947565b92915050565b60606001805461068a90613489565b80601f01602080910402602001604051908101604052809291908181526020018280546106b690613489565b80156107035780601f106106d857610100808354040283529160200191610703565b820191906000526020600020905b8154815290600101906020018083116106e657829003601f168201915b5050505050905090565b6000818152600360205260408120546001600160a01b031661078b5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600560205260409020546001600160a01b031690565b60006107b282610b06565b9050806001600160a01b0316836001600160a01b0316141561083c5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610782565b336001600160a01b0382161480610858575061085881336105ef565b6108ca5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610782565b6108d48383611985565b505050565b6001600160a01b0381166000908152600f602090815260409182902080548351818402810184019094528084526060939283018282801561093957602002820191906000526020600020905b815481526020019060010190808311610925575b50505050509050919050565b61094f3382611a00565b6109c15760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610782565b6108d4838383611af3565b6000828152600860205260409020600101546109e88133611bb1565b6108d48383611c31565b6001600160a01b0381163314610a705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610782565b610a7a8282611cd3565b5050565b6108d4838383604051806020016040528060008152506111ea565b6000546001600160a01b03163314610af35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610782565b8051610a7a90600c906020840190612aed565b6000818152600360205260408120546001600160a01b0316806106755760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610782565b600c8054610b9e90613489565b80601f0160208091040260200160405190810160405280929190818152602001828054610bca90613489565b8015610c175780601f10610bec57610100808354040283529160200191610c17565b820191906000526020600020905b815481529060010190602001808311610bfa57829003601f168201915b505050505081565b3360009081527f6a3d30e0c3cc0c73e38f13b1a1daf3d4bd64c566f95758674a646e998024b3da602052604081205460ff16610c9d5760405162461bcd60e51b815260206004820152601b60248201527f4d756c7469436861696e47616e673a4e4f545f4f50455241544f5200000000006044820152606401610782565b600a8054906000610cad836134c4565b9091555050600a54600090815260106020908152604090912085519091610cd8918391880190612b71565b5060018101805460ff191690558251610cfa9060028301906020860190612aed565b50838160030181905550610d1087600a54611d56565b610d1c600a5487611e31565b5050600a5495945050505050565b6001600160a01b03811660009081527f6a3d30e0c3cc0c73e38f13b1a1daf3d4bd64c566f95758674a646e998024b3da602052604081205460ff16610675565b60006001600160a01b038216610de85760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610782565b506001600160a01b031660009081526004602052604090205490565b6000546001600160a01b03163314610e5e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610782565b610e686000611eda565b565b60606002805461068a90613489565b6000546001600160a01b03163314610ed35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610782565b610efd7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929826109cc565b50565b610a7a338383611f37565b3360009081527f6a3d30e0c3cc0c73e38f13b1a1daf3d4bd64c566f95758674a646e998024b3da602052604090205460ff16610f895760405162461bcd60e51b815260206004820152601b60248201527f4d756c7469436861696e47616e673a4e4f545f4f50455241544f5200000000006044820152606401610782565b600a8054906000610f99836134c4565b9091555050600088815260106020526040808220600a5483529120600382015461102b5760405162461bcd60e51b815260206004820152602560248201527f4d756c7469436861696e47616e673a204e4f545f415641494c41424c455f555060448201527f47524144450000000000000000000000000000000000000000000000000000006064820152608401610782565b865161103d90829060208a0190612b71565b506001818101805460ff1916909117905585516110639060028301906020890190612aed565b50600380820186905582015461107b9060019061342f565b6003830155600b8054906000611090836134c4565b9091555050600b546000908152601160209081526040909120600a548155885190916110c39160018401918b0190612b71565b5084516110d99060028301906020880190612aed565b5086516110ef90600383019060208a0190612aed565b5060048101805460ff19169055600a5461110a908590611d56565b836001600160a01b0316600a548c7f1a51826285cfea66b7040f597215dfda6efb254568f3ff64fadb13cb7e8af64f8d8d8d8d8d8d604051611151969594939291906132ce565b60405180910390a45050505050505050505050565b6000546001600160a01b031633146111c05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610782565b610efd7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92982611637565b6111f43383611a00565b6112665760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610782565b61127284848484612006565b50505050565b6000818152600360205260409020546060906001600160a01b03166113055760405162461bcd60e51b815260206004820152603160248201527f45524337323155524953746f726167653a2055524920717565727920666f722060448201527f6e6f6e6578697374656e7420746f6b656e0000000000000000000000000000006064820152608401610782565b6000828152600760205260408120805461131e90613489565b80601f016020809104026020016040519081016040528092919081815260200182805461134a90613489565b80156113975780601f1061136c57610100808354040283529160200191611397565b820191906000526020600020905b81548152906001019060200180831161137a57829003601f168201915b5050505050905060006113a861208f565b90508051600014156113bb575092915050565b8151156113ed5780826040516020016113d5929190613160565b60405160208183030381529060405292505050919050565b6113f68461209e565b949350505050565b3360009081527f6a3d30e0c3cc0c73e38f13b1a1daf3d4bd64c566f95758674a646e998024b3da602052604090205460ff1661147c5760405162461bcd60e51b815260206004820152601b60248201527f4d756c7469436861696e47616e673a4e4f545f4f50455241544f5200000000006044820152606401610782565b6000818152601160205260409020805484146115005760405162461bcd60e51b815260206004820152602160248201527f4d756c7469436861696e47616e673a204e4f545f56414c49445f55504752414460448201527f45000000000000000000000000000000000000000000000000000000000000006064820152608401610782565b600481015460ff16156115555760405162461bcd60e51b815260206004820181905260248201527f4d756c7469436861696e47616e673a20414c52454144595f55504752414445446044820152606401610782565b61155f8484611e31565b600401805460ff19166001179055505050565b6010602052600090815260409020600181015460028201805460ff909216929161159b90613489565b80601f01602080910402602001604051908101604052809291908181526020018280546115c790613489565b80156116145780601f106115e957610100808354040283529160200191611614565b820191906000526020600020905b8154815290600101906020018083116115f757829003601f168201915b5050505050908060030154905083565b60008061163083610d6a565b1192915050565b6000828152600860205260409020600101546116538133611bb1565b6108d48383611cd3565b600f602052816000526040600020818154811061167957600080fd5b90600052602060002001600091509150505481565b600d8054610b9e90613489565b601160205260009081526040902080546002820180549192916116bd90613489565b80601f01602080910402602001604051908101604052809291908181526020018280546116e990613489565b80156117365780601f1061170b57610100808354040283529160200191611736565b820191906000526020600020905b81548152906001019060200180831161171957829003601f168201915b50505050509080600301805461174b90613489565b80601f016020809104026020016040519081016040528092919081815260200182805461177790613489565b80156117c45780601f10611799576101008083540402835291602001916117c4565b820191906000526020600020905b8154815290600101906020018083116117a757829003601f168201915b5050506004909301549192505060ff1684565b6000546001600160a01b031633146118315760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610782565b6001600160a01b0381166118ad5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610782565b610efd81611eda565b3360009081527f6a3d30e0c3cc0c73e38f13b1a1daf3d4bd64c566f95758674a646e998024b3da602052604090205460ff166119345760405162461bcd60e51b815260206004820152601b60248201527f4d756c7469436861696e47616e673a4e4f545f4f50455241544f5200000000006044820152606401610782565b8051610a7a90600d906020840190612aed565b60006001600160e01b031982167f7965db0b000000000000000000000000000000000000000000000000000000001480610675575061067582612187565b6000818152600560205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03841690811790915581906119c782610b06565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600360205260408120546001600160a01b0316611a795760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610782565b6000611a8483610b06565b9050806001600160a01b0316846001600160a01b03161480611abf5750836001600160a01b0316611ab48461070d565b6001600160a01b0316145b806113f657506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff166113f6565b6001600160a01b038216611b6f5760405162461bcd60e51b815260206004820152603460248201527f436f6d6d756e6974794e4654235f7472616e736665723a205452414e5346455260448201527f5f544f5f5448455f5a45524f5f414444524553530000000000000000000000006064820152608401610782565b611b7a838383612222565b611b8483826123fc565b6001600160a01b039091166000908152600f60209081526040822080546001810182559083529120015550565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff16610a7a57611bef816001600160a01b03166014612516565b611bfa836020612516565b604051602001611c0b92919061318f565b60408051601f198184030181529082905262461bcd60e51b8252610782916004016132bb565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff16610a7a5760008281526008602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611c8f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff1615610a7a5760008281526008602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600e54811115611dce5760405162461bcd60e51b815260206004820152603c60248201527f5374616e646172644361707065644e4654436f6c6c656374696f6e235f6d696e60448201527f743a2043414e4e4f545f4558434545445f4d494e54494e475f434150000000006064820152608401610782565b611dd88282612721565b6001600160a01b0382166000818152600f6020908152604080832080546001810182559084529183209091018490555183917fbe4d5028ecb11dfb1cbc0c1dd7eed270db43c11a50da18fceb823c9af57a2a7891a35050565b6000828152600360205260409020546001600160a01b0316611ebb5760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201527f6578697374656e7420746f6b656e0000000000000000000000000000000000006064820152608401610782565b600082815260076020908152604090912082516108d492840190612aed565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b816001600160a01b0316836001600160a01b03161415611f995760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610782565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612011848484611af3565b61201d84848484612870565b6112725760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610782565b6060600c805461068a90613489565b6000818152600360205260409020546060906001600160a01b031661212b5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610782565b600061213561208f565b905060008151116121555760405180602001604052806000815250612180565b8061215f846129d3565b604051602001612170929190613160565b6040516020818303038152906040525b9392505050565b60006001600160e01b031982167f80ac58cd0000000000000000000000000000000000000000000000000000000014806121ea57506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061067557507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610675565b826001600160a01b031661223582610b06565b6001600160a01b0316146122b15760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610782565b6001600160a01b03821661232c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610782565b612337600082611985565b6001600160a01b038316600090815260046020526040812080546001929061236090849061342f565b90915550506001600160a01b038216600090815260046020526040812080546001929061238e9084906133e4565b9091555050600081815260036020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b0382166000908152600f60205260408120905b8154811015611272578282828154811061244057634e487b7160e01b600052603260045260246000fd5b9060005260206000200154141561250457815461245f9060019061342f565b81146124cb57815482906124759060019061342f565b8154811061249357634e487b7160e01b600052603260045260246000fd5b90600052602060002001548282815481106124be57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001555b818054806124e957634e487b7160e01b600052603160045260246000fd5b60019003818190600052602060002001600090559055611272565b8061250e816134c4565b915050612416565b60606000612525836002613410565b6125309060026133e4565b67ffffffffffffffff81111561255657634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612580576020820181803683370190505b509050600360fc1b816000815181106125a957634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061260257634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000612626846002613410565b6126319060016133e4565b90505b60018111156126d2577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061268057634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106126a457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c936126cb81613472565b9050612634565b5083156121805760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610782565b6001600160a01b0382166127775760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610782565b6000818152600360205260409020546001600160a01b0316156127dc5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610782565b6001600160a01b03821660009081526004602052604081208054600192906128059084906133e4565b9091555050600081815260036020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160a01b0384163b156129c857604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906128b4903390899088908890600401613210565b602060405180830381600087803b1580156128ce57600080fd5b505af19250505080156128fe575060408051601f3d908101601f191682019092526128fb91810190612fc1565b60015b6129ae573d80801561292c576040519150601f19603f3d011682016040523d82523d6000602084013e612931565b606091505b5080516129a65760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610782565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506113f6565b506001949350505050565b6060816129f75750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612a215780612a0b816134c4565b9150612a1a9050600a836133fc565b91506129fb565b60008167ffffffffffffffff811115612a4a57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612a74576020820181803683370190505b5090505b84156113f657612a8960018361342f565b9150612a96600a866134df565b612aa19060306133e4565b60f81b818381518110612ac457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350612ae6600a866133fc565b9450612a78565b828054612af990613489565b90600052602060002090601f016020900481019282612b1b5760008555612b61565b82601f10612b3457805160ff1916838001178555612b61565b82800160010185558215612b61579182015b82811115612b61578251825591602001919060010190612b46565b50612b6d929150612bca565b5090565b828054828255906000526020600020908101928215612bbe579160200282015b82811115612bbe5782518051612bae918491602090910190612aed565b5091602001919060010190612b91565b50612b6d929150612bdf565b5b80821115612b6d5760008155600101612bcb565b80821115612b6d576000612bf38282612bfc565b50600101612bdf565b508054612c0890613489565b6000825580601f10612c18575050565b601f016020900490600052602060002090810190610efd9190612bca565b600067ffffffffffffffff831115612c5057612c5061351f565b612c63601f8401601f19166020016133b3565b9050828152838383011115612c7757600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b0381168114612ca557600080fd5b919050565b600082601f830112612cba578081fd5b8135602067ffffffffffffffff80831115612cd757612cd761351f565b8260051b612ce68382016133b3565b8481528381019087850183890186018a1015612d00578788fd5b8793505b86841015612d3d57803585811115612d1a578889fd5b612d288b88838d0101612d4a565b84525060019390930192918501918501612d04565b5098975050505050505050565b600082601f830112612d5a578081fd5b61218083833560208501612c36565b600060208284031215612d7a578081fd5b61218082612c8e565b60008060408385031215612d95578081fd5b612d9e83612c8e565b9150612dac60208401612c8e565b90509250929050565b600080600060608486031215612dc9578081fd5b612dd284612c8e565b9250612de060208501612c8e565b9150604084013590509250925092565b60008060008060808587031215612e05578081fd5b612e0e85612c8e565b9350612e1c60208601612c8e565b925060408501359150606085013567ffffffffffffffff811115612e3e578182fd5b8501601f81018713612e4e578182fd5b612e5d87823560208401612c36565b91505092959194509250565b60008060408385031215612e7b578182fd5b612e8483612c8e565b915060208301358015158114612e98578182fd5b809150509250929050565b600080600080600060a08688031215612eba578081fd5b612ec386612c8e565b9450602086013567ffffffffffffffff80821115612edf578283fd5b612eeb89838a01612d4a565b95506040880135915080821115612f00578283fd5b612f0c89838a01612caa565b9450606088013593506080880135915080821115612f28578283fd5b50612f3588828901612d4a565b9150509295509295909350565b60008060408385031215612f54578182fd5b612f5d83612c8e565b946020939093013593505050565b600060208284031215612f7c578081fd5b5035919050565b60008060408385031215612f95578182fd5b82359150612dac60208401612c8e565b600060208284031215612fb6578081fd5b813561218081613535565b600060208284031215612fd2578081fd5b815161218081613535565b600060208284031215612fee578081fd5b813567ffffffffffffffff811115613004578182fd5b6113f684828501612d4a565b600080600060608486031215613024578081fd5b83359250602084013567ffffffffffffffff811115613041578182fd5b61304d86828701612d4a565b925050604084013590509250925092565b600080600080600080600080610100898b03121561307a578586fd5b8835975060208901359650604089013567ffffffffffffffff8082111561309f578788fd5b6130ab8c838d01612d4a565b975060608b01359150808211156130c0578485fd5b6130cc8c838d01612caa565b965060808b01359150808211156130e1578485fd5b6130ed8c838d01612d4a565b955060a08b0135945060c08b0135915080821115613109578384fd5b506131168b828c01612d4a565b92505061312560e08a01612c8e565b90509295985092959890939650565b6000815180845261314c816020860160208601613446565b601f01601f19169290920160200192915050565b60008351613172818460208801613446565b835190830190613186818360208801613446565b01949350505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516131c7816017850160208801613446565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351613204816028840160208801613446565b01602801949350505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526132426080830184613134565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561328457835183529284019291840191600101613268565b50909695505050505050565b83151581526060602082015260006132ab6060830185613134565b9050826040830152949350505050565b6020815260006121806020830184613134565b8681526000602060c0818401526132e860c0840189613134565b8381036040850152875180825282820190600581901b83018401848b01865b8381101561333557601f19868403018552613323838351613134565b94870194925090860190600101613307565b50508681036060880152613349818b613134565b94505050505084608084015282810360a08401526133678185613134565b9998505050505050505050565b84815260806020820152600061338d6080830186613134565b828103604084015261339f8186613134565b915050821515606083015295945050505050565b604051601f8201601f1916810167ffffffffffffffff811182821017156133dc576133dc61351f565b604052919050565b600082198211156133f7576133f76134f3565b500190565b60008261340b5761340b613509565b500490565b600081600019048311821515161561342a5761342a6134f3565b500290565b600082821015613441576134416134f3565b500390565b60005b83811015613461578181015183820152602001613449565b838111156112725750506000910152565b600081613481576134816134f3565b506000190190565b600181811c9082168061349d57607f821691505b602082108114156134be57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156134d8576134d86134f3565b5060010190565b6000826134ee576134ee613509565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114610efd57600080fdfea2646970667358221220db6ee20fc389837f1c6de94361f0e7db5910370991f1eb17fa4468f4c6ae956b64736f6c63430008040033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000000f4d756c7469436861696e2047616e67000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034d434700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102d35760003560e01c80638da5cb5b11610186578063c98b54b2116100e3578063e2c6875c11610097578063f2fde38b11610071578063f2fde38b1461061d578063f5b541a614610630578063f6938ed91461065757600080fd5b8063e2c6875c146105b6578063e98050c7146105be578063e985e9c5146105e157600080fd5b8063d4d7b19a116100c8578063d4d7b19a1461057d578063d547741f14610590578063e2282bd4146105a357600080fd5b8063c98b54b214610548578063cc33c8751461055b57600080fd5b8063a22cb4651161013a578063ac8a584a1161011f578063ac8a584a1461050f578063b88d4fde14610522578063c87b56dd1461053557600080fd5b8063a22cb465146104e9578063a72ade44146104fc57600080fd5b806395d89b411161016b57806395d89b41146104c65780639870d7fe146104ce578063a217fddf146104e157600080fd5b80638da5cb5b1461047c57806391d148541461048d57600080fd5b806342842e0e116102345780636c255c19116101e857806370a08231116101cd57806370a0823114610458578063714cff561461046b578063715018a61461047457600080fd5b80636c255c19146104325780636d70f7ae1461044557600080fd5b80636352211e116102195780636352211e1461040e57806365d42184146104215780636c0360eb1461042a57600080fd5b806342842e0e146103e857806355f804b3146103fb57600080fd5b806309a16ae51161028b578063248a9ca311610270578063248a9ca31461039f5780632f2ff15d146103c257806336568abe146103d557600080fd5b806309a16ae51461036c57806323b872dd1461038c57600080fd5b806306fdde03116102bc57806306fdde0314610317578063081812fc1461032c578063095ea7b31461035757600080fd5b806301ffc9a7146102d8578063060cf4e814610300575b600080fd5b6102eb6102e6366004612fa5565b61066a565b60405190151581526020015b60405180910390f35b610309600e5481565b6040519081526020016102f7565b61031f61067b565b6040516102f791906132bb565b61033f61033a366004612f6b565b61070d565b6040516001600160a01b0390911681526020016102f7565b61036a610365366004612f42565b6107a7565b005b61037f61037a366004612d69565b6108d9565b6040516102f7919061324c565b61036a61039a366004612db5565b610945565b6103096103ad366004612f6b565b60009081526008602052604090206001015490565b61036a6103d0366004612f83565b6109cc565b61036a6103e3366004612f83565b6109f2565b61036a6103f6366004612db5565b610a7e565b61036a610409366004612fdd565b610a99565b61033f61041c366004612f6b565b610b06565b610309600b5481565b61031f610b91565b610309610440366004612ea3565b610c1f565b6102eb610453366004612d69565b610d2a565b610309610466366004612d69565b610d6a565b610309600a5481565b61036a610e04565b6000546001600160a01b031661033f565b6102eb61049b366004612f83565b60009182526008602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61031f610e6a565b61036a6104dc366004612d69565b610e79565b610309600081565b61036a6104f7366004612e69565b610f00565b61036a61050a36600461305e565b610f0b565b61036a61051d366004612d69565b611166565b61036a610530366004612df0565b6111ea565b61031f610543366004612f6b565b611278565b61036a610556366004613010565b6113fe565b61056e610569366004612f6b565b611572565b6040516102f793929190613290565b6102eb61058b366004612d69565b611624565b61036a61059e366004612f83565b611637565b6103096105b1366004612f42565b61165d565b61031f61168e565b6105d16105cc366004612f6b565b61169b565b6040516102f79493929190613374565b6102eb6105ef366004612d83565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b61036a61062b366004612d69565b6117d7565b6103097f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92981565b61036a610665366004612fdd565b6118b6565b600061067582611947565b92915050565b60606001805461068a90613489565b80601f01602080910402602001604051908101604052809291908181526020018280546106b690613489565b80156107035780601f106106d857610100808354040283529160200191610703565b820191906000526020600020905b8154815290600101906020018083116106e657829003601f168201915b5050505050905090565b6000818152600360205260408120546001600160a01b031661078b5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600560205260409020546001600160a01b031690565b60006107b282610b06565b9050806001600160a01b0316836001600160a01b0316141561083c5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610782565b336001600160a01b0382161480610858575061085881336105ef565b6108ca5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610782565b6108d48383611985565b505050565b6001600160a01b0381166000908152600f602090815260409182902080548351818402810184019094528084526060939283018282801561093957602002820191906000526020600020905b815481526020019060010190808311610925575b50505050509050919050565b61094f3382611a00565b6109c15760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610782565b6108d4838383611af3565b6000828152600860205260409020600101546109e88133611bb1565b6108d48383611c31565b6001600160a01b0381163314610a705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610782565b610a7a8282611cd3565b5050565b6108d4838383604051806020016040528060008152506111ea565b6000546001600160a01b03163314610af35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610782565b8051610a7a90600c906020840190612aed565b6000818152600360205260408120546001600160a01b0316806106755760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610782565b600c8054610b9e90613489565b80601f0160208091040260200160405190810160405280929190818152602001828054610bca90613489565b8015610c175780601f10610bec57610100808354040283529160200191610c17565b820191906000526020600020905b815481529060010190602001808311610bfa57829003601f168201915b505050505081565b3360009081527f6a3d30e0c3cc0c73e38f13b1a1daf3d4bd64c566f95758674a646e998024b3da602052604081205460ff16610c9d5760405162461bcd60e51b815260206004820152601b60248201527f4d756c7469436861696e47616e673a4e4f545f4f50455241544f5200000000006044820152606401610782565b600a8054906000610cad836134c4565b9091555050600a54600090815260106020908152604090912085519091610cd8918391880190612b71565b5060018101805460ff191690558251610cfa9060028301906020860190612aed565b50838160030181905550610d1087600a54611d56565b610d1c600a5487611e31565b5050600a5495945050505050565b6001600160a01b03811660009081527f6a3d30e0c3cc0c73e38f13b1a1daf3d4bd64c566f95758674a646e998024b3da602052604081205460ff16610675565b60006001600160a01b038216610de85760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610782565b506001600160a01b031660009081526004602052604090205490565b6000546001600160a01b03163314610e5e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610782565b610e686000611eda565b565b60606002805461068a90613489565b6000546001600160a01b03163314610ed35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610782565b610efd7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929826109cc565b50565b610a7a338383611f37565b3360009081527f6a3d30e0c3cc0c73e38f13b1a1daf3d4bd64c566f95758674a646e998024b3da602052604090205460ff16610f895760405162461bcd60e51b815260206004820152601b60248201527f4d756c7469436861696e47616e673a4e4f545f4f50455241544f5200000000006044820152606401610782565b600a8054906000610f99836134c4565b9091555050600088815260106020526040808220600a5483529120600382015461102b5760405162461bcd60e51b815260206004820152602560248201527f4d756c7469436861696e47616e673a204e4f545f415641494c41424c455f555060448201527f47524144450000000000000000000000000000000000000000000000000000006064820152608401610782565b865161103d90829060208a0190612b71565b506001818101805460ff1916909117905585516110639060028301906020890190612aed565b50600380820186905582015461107b9060019061342f565b6003830155600b8054906000611090836134c4565b9091555050600b546000908152601160209081526040909120600a548155885190916110c39160018401918b0190612b71565b5084516110d99060028301906020880190612aed565b5086516110ef90600383019060208a0190612aed565b5060048101805460ff19169055600a5461110a908590611d56565b836001600160a01b0316600a548c7f1a51826285cfea66b7040f597215dfda6efb254568f3ff64fadb13cb7e8af64f8d8d8d8d8d8d604051611151969594939291906132ce565b60405180910390a45050505050505050505050565b6000546001600160a01b031633146111c05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610782565b610efd7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92982611637565b6111f43383611a00565b6112665760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610782565b61127284848484612006565b50505050565b6000818152600360205260409020546060906001600160a01b03166113055760405162461bcd60e51b815260206004820152603160248201527f45524337323155524953746f726167653a2055524920717565727920666f722060448201527f6e6f6e6578697374656e7420746f6b656e0000000000000000000000000000006064820152608401610782565b6000828152600760205260408120805461131e90613489565b80601f016020809104026020016040519081016040528092919081815260200182805461134a90613489565b80156113975780601f1061136c57610100808354040283529160200191611397565b820191906000526020600020905b81548152906001019060200180831161137a57829003601f168201915b5050505050905060006113a861208f565b90508051600014156113bb575092915050565b8151156113ed5780826040516020016113d5929190613160565b60405160208183030381529060405292505050919050565b6113f68461209e565b949350505050565b3360009081527f6a3d30e0c3cc0c73e38f13b1a1daf3d4bd64c566f95758674a646e998024b3da602052604090205460ff1661147c5760405162461bcd60e51b815260206004820152601b60248201527f4d756c7469436861696e47616e673a4e4f545f4f50455241544f5200000000006044820152606401610782565b6000818152601160205260409020805484146115005760405162461bcd60e51b815260206004820152602160248201527f4d756c7469436861696e47616e673a204e4f545f56414c49445f55504752414460448201527f45000000000000000000000000000000000000000000000000000000000000006064820152608401610782565b600481015460ff16156115555760405162461bcd60e51b815260206004820181905260248201527f4d756c7469436861696e47616e673a20414c52454144595f55504752414445446044820152606401610782565b61155f8484611e31565b600401805460ff19166001179055505050565b6010602052600090815260409020600181015460028201805460ff909216929161159b90613489565b80601f01602080910402602001604051908101604052809291908181526020018280546115c790613489565b80156116145780601f106115e957610100808354040283529160200191611614565b820191906000526020600020905b8154815290600101906020018083116115f757829003601f168201915b5050505050908060030154905083565b60008061163083610d6a565b1192915050565b6000828152600860205260409020600101546116538133611bb1565b6108d48383611cd3565b600f602052816000526040600020818154811061167957600080fd5b90600052602060002001600091509150505481565b600d8054610b9e90613489565b601160205260009081526040902080546002820180549192916116bd90613489565b80601f01602080910402602001604051908101604052809291908181526020018280546116e990613489565b80156117365780601f1061170b57610100808354040283529160200191611736565b820191906000526020600020905b81548152906001019060200180831161171957829003601f168201915b50505050509080600301805461174b90613489565b80601f016020809104026020016040519081016040528092919081815260200182805461177790613489565b80156117c45780601f10611799576101008083540402835291602001916117c4565b820191906000526020600020905b8154815290600101906020018083116117a757829003601f168201915b5050506004909301549192505060ff1684565b6000546001600160a01b031633146118315760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610782565b6001600160a01b0381166118ad5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610782565b610efd81611eda565b3360009081527f6a3d30e0c3cc0c73e38f13b1a1daf3d4bd64c566f95758674a646e998024b3da602052604090205460ff166119345760405162461bcd60e51b815260206004820152601b60248201527f4d756c7469436861696e47616e673a4e4f545f4f50455241544f5200000000006044820152606401610782565b8051610a7a90600d906020840190612aed565b60006001600160e01b031982167f7965db0b000000000000000000000000000000000000000000000000000000001480610675575061067582612187565b6000818152600560205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03841690811790915581906119c782610b06565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600360205260408120546001600160a01b0316611a795760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610782565b6000611a8483610b06565b9050806001600160a01b0316846001600160a01b03161480611abf5750836001600160a01b0316611ab48461070d565b6001600160a01b0316145b806113f657506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff166113f6565b6001600160a01b038216611b6f5760405162461bcd60e51b815260206004820152603460248201527f436f6d6d756e6974794e4654235f7472616e736665723a205452414e5346455260448201527f5f544f5f5448455f5a45524f5f414444524553530000000000000000000000006064820152608401610782565b611b7a838383612222565b611b8483826123fc565b6001600160a01b039091166000908152600f60209081526040822080546001810182559083529120015550565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff16610a7a57611bef816001600160a01b03166014612516565b611bfa836020612516565b604051602001611c0b92919061318f565b60408051601f198184030181529082905262461bcd60e51b8252610782916004016132bb565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff16610a7a5760008281526008602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611c8f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff1615610a7a5760008281526008602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600e54811115611dce5760405162461bcd60e51b815260206004820152603c60248201527f5374616e646172644361707065644e4654436f6c6c656374696f6e235f6d696e60448201527f743a2043414e4e4f545f4558434545445f4d494e54494e475f434150000000006064820152608401610782565b611dd88282612721565b6001600160a01b0382166000818152600f6020908152604080832080546001810182559084529183209091018490555183917fbe4d5028ecb11dfb1cbc0c1dd7eed270db43c11a50da18fceb823c9af57a2a7891a35050565b6000828152600360205260409020546001600160a01b0316611ebb5760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201527f6578697374656e7420746f6b656e0000000000000000000000000000000000006064820152608401610782565b600082815260076020908152604090912082516108d492840190612aed565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b816001600160a01b0316836001600160a01b03161415611f995760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610782565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612011848484611af3565b61201d84848484612870565b6112725760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610782565b6060600c805461068a90613489565b6000818152600360205260409020546060906001600160a01b031661212b5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610782565b600061213561208f565b905060008151116121555760405180602001604052806000815250612180565b8061215f846129d3565b604051602001612170929190613160565b6040516020818303038152906040525b9392505050565b60006001600160e01b031982167f80ac58cd0000000000000000000000000000000000000000000000000000000014806121ea57506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061067557507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610675565b826001600160a01b031661223582610b06565b6001600160a01b0316146122b15760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610782565b6001600160a01b03821661232c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610782565b612337600082611985565b6001600160a01b038316600090815260046020526040812080546001929061236090849061342f565b90915550506001600160a01b038216600090815260046020526040812080546001929061238e9084906133e4565b9091555050600081815260036020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b0382166000908152600f60205260408120905b8154811015611272578282828154811061244057634e487b7160e01b600052603260045260246000fd5b9060005260206000200154141561250457815461245f9060019061342f565b81146124cb57815482906124759060019061342f565b8154811061249357634e487b7160e01b600052603260045260246000fd5b90600052602060002001548282815481106124be57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001555b818054806124e957634e487b7160e01b600052603160045260246000fd5b60019003818190600052602060002001600090559055611272565b8061250e816134c4565b915050612416565b60606000612525836002613410565b6125309060026133e4565b67ffffffffffffffff81111561255657634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612580576020820181803683370190505b509050600360fc1b816000815181106125a957634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061260257634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000612626846002613410565b6126319060016133e4565b90505b60018111156126d2577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061268057634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106126a457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c936126cb81613472565b9050612634565b5083156121805760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610782565b6001600160a01b0382166127775760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610782565b6000818152600360205260409020546001600160a01b0316156127dc5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610782565b6001600160a01b03821660009081526004602052604081208054600192906128059084906133e4565b9091555050600081815260036020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160a01b0384163b156129c857604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906128b4903390899088908890600401613210565b602060405180830381600087803b1580156128ce57600080fd5b505af19250505080156128fe575060408051601f3d908101601f191682019092526128fb91810190612fc1565b60015b6129ae573d80801561292c576040519150601f19603f3d011682016040523d82523d6000602084013e612931565b606091505b5080516129a65760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610782565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506113f6565b506001949350505050565b6060816129f75750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612a215780612a0b816134c4565b9150612a1a9050600a836133fc565b91506129fb565b60008167ffffffffffffffff811115612a4a57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612a74576020820181803683370190505b5090505b84156113f657612a8960018361342f565b9150612a96600a866134df565b612aa19060306133e4565b60f81b818381518110612ac457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350612ae6600a866133fc565b9450612a78565b828054612af990613489565b90600052602060002090601f016020900481019282612b1b5760008555612b61565b82601f10612b3457805160ff1916838001178555612b61565b82800160010185558215612b61579182015b82811115612b61578251825591602001919060010190612b46565b50612b6d929150612bca565b5090565b828054828255906000526020600020908101928215612bbe579160200282015b82811115612bbe5782518051612bae918491602090910190612aed565b5091602001919060010190612b91565b50612b6d929150612bdf565b5b80821115612b6d5760008155600101612bcb565b80821115612b6d576000612bf38282612bfc565b50600101612bdf565b508054612c0890613489565b6000825580601f10612c18575050565b601f016020900490600052602060002090810190610efd9190612bca565b600067ffffffffffffffff831115612c5057612c5061351f565b612c63601f8401601f19166020016133b3565b9050828152838383011115612c7757600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b0381168114612ca557600080fd5b919050565b600082601f830112612cba578081fd5b8135602067ffffffffffffffff80831115612cd757612cd761351f565b8260051b612ce68382016133b3565b8481528381019087850183890186018a1015612d00578788fd5b8793505b86841015612d3d57803585811115612d1a578889fd5b612d288b88838d0101612d4a565b84525060019390930192918501918501612d04565b5098975050505050505050565b600082601f830112612d5a578081fd5b61218083833560208501612c36565b600060208284031215612d7a578081fd5b61218082612c8e565b60008060408385031215612d95578081fd5b612d9e83612c8e565b9150612dac60208401612c8e565b90509250929050565b600080600060608486031215612dc9578081fd5b612dd284612c8e565b9250612de060208501612c8e565b9150604084013590509250925092565b60008060008060808587031215612e05578081fd5b612e0e85612c8e565b9350612e1c60208601612c8e565b925060408501359150606085013567ffffffffffffffff811115612e3e578182fd5b8501601f81018713612e4e578182fd5b612e5d87823560208401612c36565b91505092959194509250565b60008060408385031215612e7b578182fd5b612e8483612c8e565b915060208301358015158114612e98578182fd5b809150509250929050565b600080600080600060a08688031215612eba578081fd5b612ec386612c8e565b9450602086013567ffffffffffffffff80821115612edf578283fd5b612eeb89838a01612d4a565b95506040880135915080821115612f00578283fd5b612f0c89838a01612caa565b9450606088013593506080880135915080821115612f28578283fd5b50612f3588828901612d4a565b9150509295509295909350565b60008060408385031215612f54578182fd5b612f5d83612c8e565b946020939093013593505050565b600060208284031215612f7c578081fd5b5035919050565b60008060408385031215612f95578182fd5b82359150612dac60208401612c8e565b600060208284031215612fb6578081fd5b813561218081613535565b600060208284031215612fd2578081fd5b815161218081613535565b600060208284031215612fee578081fd5b813567ffffffffffffffff811115613004578182fd5b6113f684828501612d4a565b600080600060608486031215613024578081fd5b83359250602084013567ffffffffffffffff811115613041578182fd5b61304d86828701612d4a565b925050604084013590509250925092565b600080600080600080600080610100898b03121561307a578586fd5b8835975060208901359650604089013567ffffffffffffffff8082111561309f578788fd5b6130ab8c838d01612d4a565b975060608b01359150808211156130c0578485fd5b6130cc8c838d01612caa565b965060808b01359150808211156130e1578485fd5b6130ed8c838d01612d4a565b955060a08b0135945060c08b0135915080821115613109578384fd5b506131168b828c01612d4a565b92505061312560e08a01612c8e565b90509295985092959890939650565b6000815180845261314c816020860160208601613446565b601f01601f19169290920160200192915050565b60008351613172818460208801613446565b835190830190613186818360208801613446565b01949350505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516131c7816017850160208801613446565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351613204816028840160208801613446565b01602801949350505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526132426080830184613134565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561328457835183529284019291840191600101613268565b50909695505050505050565b83151581526060602082015260006132ab6060830185613134565b9050826040830152949350505050565b6020815260006121806020830184613134565b8681526000602060c0818401526132e860c0840189613134565b8381036040850152875180825282820190600581901b83018401848b01865b8381101561333557601f19868403018552613323838351613134565b94870194925090860190600101613307565b50508681036060880152613349818b613134565b94505050505084608084015282810360a08401526133678185613134565b9998505050505050505050565b84815260806020820152600061338d6080830186613134565b828103604084015261339f8186613134565b915050821515606083015295945050505050565b604051601f8201601f1916810167ffffffffffffffff811182821017156133dc576133dc61351f565b604052919050565b600082198211156133f7576133f76134f3565b500190565b60008261340b5761340b613509565b500490565b600081600019048311821515161561342a5761342a6134f3565b500290565b600082821015613441576134416134f3565b500390565b60005b83811015613461578181015183820152602001613449565b838111156112725750506000910152565b600081613481576134816134f3565b506000190190565b600181811c9082168061349d57607f821691505b602082108114156134be57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156134d8576134d86134f3565b5060010190565b6000826134ee576134ee613509565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114610efd57600080fdfea2646970667358221220db6ee20fc389837f1c6de94361f0e7db5910370991f1eb17fa4468f4c6ae956b64736f6c63430008040033

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

000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000000f4d756c7469436861696e2047616e67000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034d434700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : collectionName (string): MultiChain Gang
Arg [1] : collectionSymbol (string): MCG
Arg [2] : collectionBaseURI (string):
Arg [3] : cap (uint256): 400

-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000190
Arg [4] : 000000000000000000000000000000000000000000000000000000000000000f
Arg [5] : 4d756c7469436861696e2047616e670000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [7] : 4d43470000000000000000000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000000


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.