Arbitrum Sepolia Testnet

Token

MOSSAI_Island_NFG (MIN)
ERC-721

Overview

Max Total Supply

0 MIN

Holders

89

Market

Onchain Market Cap

-

Circulating Supply Market Cap

-
Balance
0 MIN
0x0000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information

Contract Source Code Verified (Exact Match)

Contract Name:
MOSSAI_Island_NFG

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 2000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.1;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "../MOSSAI_Roles_Cfg.sol";

contract MOSSAI_Island_NFG is
    ERC721,
    ERC721URIStorage,
    ERC721Burnable,
    Ownable
{
    uint256 private _nextTokenId;
    address public _MOSSAIRolesCfgAddress;

    mapping(uint256 => uint32) public _tokenSeed;
    mapping(uint32 => uint256) public _seedToken;
    mapping(uint32 => uint256[]) public _mintTokens;
    mapping(uint32 => string) public _locationTokenURI;
    mapping(uint32 => uint32) public _locationSeed;
    mapping(uint32 => uint32) public _seedLocation;

    constructor() ERC721("MOSSAI_Island_NFG", "MIN") {}

    function mint(address to, uint32 location) public returns (uint32) {
        require(
            MOSSAI_Roles_Cfg(_MOSSAIRolesCfgAddress).hasAdminRole(msg.sender),
            "not admin role"
        );

        string memory uri = _locationTokenURI[location];
        uint32 seed = _locationSeed[location];
        require(bytes(uri).length > 0, "location not exists");

        require(_seedToken[seed] == 0, "seed already exists");

        uint256 tokenId = _nextTokenId++;
        _safeMint(to, tokenId);
        _setTokenURI(tokenId, uri);

        _tokenSeed[tokenId] = seed;
        _seedToken[seed] = tokenId;

        _mintTokens[seed].push(tokenId);

        return seed;
    }

    function mintBySeed(address to, uint32 seed) public returns (uint256) {
        require(
            MOSSAI_Roles_Cfg(_MOSSAIRolesCfgAddress).hasAdminRole(msg.sender),
            "not admin role"
        );

        uint32 location = _seedLocation[seed];

        string memory uri = _locationTokenURI[location];
        require(bytes(uri).length > 0, "location not exists");

        require(_seedToken[seed] > 0, "seed not exists");

        uint256 tokenId = _nextTokenId++;
        _safeMint(to, tokenId);
        _setTokenURI(tokenId, uri);

        _tokenSeed[tokenId] = seed;
        _seedToken[seed] = tokenId;

        _mintTokens[seed].push(tokenId);

        return tokenId;
    }

    function getSeedOwer(uint32 seed) public view returns (address) {
        uint256 tokenId = _seedToken[seed];
        require(tokenId > 0, "seed not exists");

        return ownerOf(tokenId);
    }

    function getToken(
        uint256 tokenId
    ) public view returns (uint32, string memory) {
        require(_exists(tokenId), "token not exists");

        uint32 seed = _tokenSeed[tokenId];
        string memory tokenURI = tokenURI(tokenId);

        return (seed, tokenURI);
    }

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

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

    function supportsInterface(
        bytes4 interfaceId
    ) public view override(ERC721, ERC721URIStorage) returns (bool) {
        return super.supportsInterface(interfaceId);
    }

    function batchAddNFG(
        uint32[] memory seeds,
        string[] memory uris,
        uint32[] memory locations
    ) public {
        require(
            MOSSAI_Roles_Cfg(_MOSSAIRolesCfgAddress).hasAdminRole(msg.sender),
            "not admin role"
        );

        for (uint256 i = 0; i < seeds.length; i++) {
            _locationTokenURI[locations[i]] = uris[i];
            _locationSeed[locations[i]] = seeds[i];
            _seedLocation[seeds[i]] = locations[i];
        }
    }

    function getMintTokens(uint32 seed) public view returns (uint256[] memory) {
        return _mintTokens[seed];
    }

    function setMOSSAIRolesCfgAddress(
        address MOSSAIRolesCfgAddress
    ) public onlyOwner {
        _MOSSAIRolesCfgAddress = MOSSAIRolesCfgAddress;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (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 Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling 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 3 of 20 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)

pragma solidity ^0.8.0;

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

File 4 of 20 : IERC4906.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC4906.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";
import "./IERC721.sol";

/// @title EIP-721 Metadata Update Extension
interface IERC4906 is IERC165, IERC721 {
    /// @dev This event emits when the metadata of a token is changed.
    /// So that the third-party platforms such as NFT market could
    /// timely update the images and related attributes of the NFT.
    event MetadataUpdate(uint256 _tokenId);

    /// @dev This event emits when the metadata of a range of tokens is changed.
    /// So that the third-party platforms such as NFT market could
    /// timely update the images and related attributes of the NFTs.
    event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);
}

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

pragma solidity ^0.8.0;

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _ownerOf(tokenId);
        require(owner != address(0), "ERC721: invalid token ID");
        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) {
        _requireMinted(tokenId);

        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 overridden 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 token owner or approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        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: caller is not token owner or 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: caller is not token owner or 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 the owner of the `tokenId`. Does NOT revert if token doesn't exist
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @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 _ownerOf(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) {
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == 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, 1);

        // Check that tokenId was not minted by `_beforeTokenTransfer` hook
        require(!_exists(tokenId), "ERC721: token already minted");

        unchecked {
            // Will not overflow unless all 2**256 token ids are minted to the same owner.
            // Given that tokens are minted one by one, it is impossible in practice that
            // this ever happens. Might change if we allow batch minting.
            // The ERC fails to describe this case.
            _balances[to] += 1;
        }

        _owners[tokenId] = to;

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

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

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

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

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = ERC721.ownerOf(tokenId);

        // Clear approvals
        delete _tokenApprovals[tokenId];

        unchecked {
            // Cannot overflow, as that would require more tokens to be burned/transferred
            // out than the owner initially received through minting and transferring in.
            _balances[owner] -= 1;
        }
        delete _owners[tokenId];

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

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

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

        _beforeTokenTransfer(from, to, tokenId, 1);

        // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");

        // Clear approvals from the previous owner
        delete _tokenApprovals[tokenId];

        unchecked {
            // `_balances[from]` cannot overflow for the same reason as described in `_burn`:
            // `from`'s balance is the number of token held, which is at least one before the current
            // transfer.
            // `_balances[to]` could overflow in the conditions described in `_mint`. That would require
            // all 2**256 token ids to be minted, which in practice is impossible.
            _balances[from] -= 1;
            _balances[to] += 1;
        }
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId, 1);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits an {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 an {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 Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

    /**
     * @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 {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
     * - When `from` is zero, the tokens will be minted for `to`.
     * - When `to` is zero, ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}

    /**
     * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
     * - When `from` is zero, the tokens were minted for `to`.
     * - When `to` is zero, ``from``'s tokens were burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}

    /**
     * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
     *
     * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant
     * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such
     * that `ownerOf(tokenId)` is `a`.
     */
    // solhint-disable-next-line func-name-mixedcase
    function __unsafe_increaseBalance(address account, uint256 amount) internal {
        _balances[account] += amount;
    }
}

File 7 of 20 : ERC721Burnable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Burnable.sol)

pragma solidity ^0.8.0;

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

/**
 * @title ERC721 Burnable Token
 * @dev ERC721 Token that can be burned (destroyed).
 */
abstract contract ERC721Burnable is Context, ERC721 {
    /**
     * @dev Burns `tokenId`. See {ERC721-_burn}.
     *
     * Requirements:
     *
     * - The caller must own `tokenId` or be an approved operator.
     */
    function burn(uint256 tokenId) public virtual {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
        _burn(tokenId);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/extensions/ERC721URIStorage.sol)

pragma solidity ^0.8.0;

import "../ERC721.sol";
import "../../../interfaces/IERC4906.sol";

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

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

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

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        _requireMinted(tokenId);

        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`.
     *
     * Emits {MetadataUpdate}.
     *
     * 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;

        emit MetadataUpdate(tokenId);
    }

    /**
     * @dev See {ERC721-_burn}. This override additionally checks to see if a
     * token-specific URI was set for the token, and if so, it deletes the token URI from
     * the storage mapping.
     */
    function _burn(uint256 tokenId) internal virtual override {
        super._burn(tokenId);

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (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`.
     *
     * 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;

    /**
     * @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 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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * 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 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 the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

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

File 11 of 20 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (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 `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/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.8.0/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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or 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 {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

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

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

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

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

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @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] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/Strings.sol";

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

import "./utils/StrUtil.sol";

contract MOSSAI_Roles_Cfg is Ownable {
    using Strings for *;
    using StrUtil for *;

    mapping(address => bool) public _adminRole;
    mapping(address => bool) public _superAsdminRole;

    constructor() {
        _adminRole[msg.sender] = true;
    }

    function addAdmin(address account) public onlyOwner {
        require(!_adminRole[account], "administrator already exists");
        _adminRole[account] = true;
    }

    function addSuperAdmin(address account) public onlyOwner {
        require(!_superAsdminRole[account], "administrator already exists");
        _superAsdminRole[account] = true;
    }

    function addAdmin2(address account) public {
        require(_superAsdminRole[msg.sender], "not super admin role");
        require(!_adminRole[account], "administrator already exists");
        _adminRole[account] = true;
    }

    function hasAdminRole(address account) public view returns (bool) {
        return _adminRole[account];
    }

    function deleteAdmin(address account) public onlyOwner {
        _adminRole[account] = false;
    }
}

/*
 * @title String & slice utility library for Solidity contracts.
 * @author Nick Johnson <[email protected]>
 *
 * @dev Functionality in this library is largely implemented using an
 *      abstraction called a 'slice'. A slice represents a part of a string -
 *      anything from the entire string to a single character, or even no
 *      characters at all (a 0-length slice). Since a slice only has to specify
 *      an offset and a length, copying and manipulating slices is a lot less
 *      expensive than copying and manipulating the strings they reference.
 *
 *      To further reduce gas costs, most functions on slice that need to return
 *      a slice modify the original one instead of allocating a new one; for
 *      instance, `s.split(".")` will return the text up to the first '.',
 *      modifying s to only contain the remainder of the string after the '.'.
 *      In situations where you do not want to modify the original slice, you
 *      can make a copy first with `.copy()`, for example:
 *      `s.copy().split(".")`. Try and avoid using this idiom in loops; since
 *      Solidity has no memory management, it will result in allocating many
 *      short-lived slices that are later discarded.
 *
 *      Functions that return two slices come in two versions: a non-allocating
 *      version that takes the second slice as an argument, modifying it in
 *      place, and an allocating version that allocates and returns the second
 *      slice; see `nextRune` for example.
 *
 *      Functions that have to copy string data will return strings rather than
 *      slices; these can be cast back to slices for further processing if
 *      required.
 *
 *      For convenience, some functions are provided with non-modifying
 *      variants that create a new slice and return both; for instance,
 *      `s.splitNew('.')` leaves s unmodified, and returns two values
 *      corresponding to the left and right parts of the string.
 */

pragma solidity ^0.8.0;

library StrUtil {
    struct slice {
        uint256 _len;
        uint256 _ptr;
    }

    function memcpy(uint256 dest, uint256 src, uint256 len) private pure {
        // Copy word-length chunks while possible
        for (; len >= 32; len -= 32) {
            assembly {
                mstore(dest, mload(src))
            }
            dest += 32;
            src += 32;
        }

        // Copy remaining bytes
        uint256 mask = type(uint256).max;
        if (len > 0) {
            mask = 256 ** (32 - len) - 1;
        }
        assembly {
            let srcpart := and(mload(src), not(mask))
            let destpart := and(mload(dest), mask)
            mstore(dest, or(destpart, srcpart))
        }
    }

    /*
     * @dev Returns a slice containing the entire string.
     * @param self The string to make a slice from.
     * @return A newly allocated slice containing the entire string.
     */
    function toSlice(string memory self) internal pure returns (slice memory) {
        uint256 ptr;
        assembly {
            ptr := add(self, 0x20)
        }
        return slice(bytes(self).length, ptr);
    }

    /*
     * @dev Returns the length of a null-terminated bytes32 string.
     * @param self The value to find the length of.
     * @return The length of the string, from 0 to 32.
     */
    function len(bytes32 self) internal pure returns (uint256) {
        uint256 ret;
        if (self == 0) return 0;
        if (uint256(self) & type(uint128).max == 0) {
            ret += 16;
            self = bytes32(uint256(self) / 0x100000000000000000000000000000000);
        }
        if (uint256(self) & type(uint64).max == 0) {
            ret += 8;
            self = bytes32(uint256(self) / 0x10000000000000000);
        }
        if (uint256(self) & type(uint32).max == 0) {
            ret += 4;
            self = bytes32(uint256(self) / 0x100000000);
        }
        if (uint256(self) & type(uint16).max == 0) {
            ret += 2;
            self = bytes32(uint256(self) / 0x10000);
        }
        if (uint256(self) & type(uint8).max == 0) {
            ret += 1;
        }
        return 32 - ret;
    }

    /*
     * @dev Returns a slice containing the entire bytes32, interpreted as a
     *      null-terminated utf-8 string.
     * @param self The bytes32 value to convert to a slice.
     * @return A new slice containing the value of the input argument up to the
     *         first null.
     */
    function toSliceB32(bytes32 self) internal pure returns (slice memory ret) {
        // Allocate space for `self` in memory, copy it there, and point ret at it
        assembly {
            let ptr := mload(0x40)
            mstore(0x40, add(ptr, 0x20))
            mstore(ptr, self)
            mstore(add(ret, 0x20), ptr)
        }
        ret._len = len(self);
    }

    /*
     * @dev Returns a new slice containing the same data as the current slice.
     * @param self The slice to copy.
     * @return A new slice containing the same data as `self`.
     */
    function copy(slice memory self) internal pure returns (slice memory) {
        return slice(self._len, self._ptr);
    }

    /*
     * @dev Copies a slice to a new string.
     * @param self The slice to copy.
     * @return A newly allocated string containing the slice's text.
     */
    function toString(slice memory self) internal pure returns (string memory) {
        string memory ret = new string(self._len);
        uint256 retptr;
        assembly {
            retptr := add(ret, 32)
        }

        memcpy(retptr, self._ptr, self._len);
        return ret;
    }

    /*
     * @dev Returns the length in runes of the slice. Note that this operation
     *      takes time proportional to the length of the slice; avoid using it
     *      in loops, and call `slice.empty()` if you only need to know whether
     *      the slice is empty or not.
     * @param self The slice to operate on.
     * @return The length of the slice in runes.
     */
    function len(slice memory self) internal pure returns (uint256 l) {
        // Starting at ptr-31 means the LSB will be the byte we care about
        uint256 ptr = self._ptr - 31;
        uint256 end = ptr + self._len;
        for (l = 0; ptr < end; l++) {
            uint8 b;
            assembly {
                b := and(mload(ptr), 0xFF)
            }
            if (b < 0x80) {
                ptr += 1;
            } else if (b < 0xE0) {
                ptr += 2;
            } else if (b < 0xF0) {
                ptr += 3;
            } else if (b < 0xF8) {
                ptr += 4;
            } else if (b < 0xFC) {
                ptr += 5;
            } else {
                ptr += 6;
            }
        }
    }

    /*
     * @dev Returns true if the slice is empty (has a length of 0).
     * @param self The slice to operate on.
     * @return True if the slice is empty, False otherwise.
     */
    function empty(slice memory self) internal pure returns (bool) {
        return self._len == 0;
    }

    /*
     * @dev Returns a positive number if `other` comes lexicographically after
     *      `self`, a negative number if it comes before, or zero if the
     *      contents of the two slices are equal. Comparison is done per-rune,
     *      on unicode codepoints.
     * @param self The first slice to compare.
     * @param other The second slice to compare.
     * @return The result of the comparison.
     */
    function compare(
        slice memory self,
        slice memory other
    ) internal pure returns (int256) {
        uint256 shortest = self._len;
        if (other._len < self._len) shortest = other._len;

        uint256 selfptr = self._ptr;
        uint256 otherptr = other._ptr;
        for (uint256 idx = 0; idx < shortest; idx += 32) {
            uint256 a;
            uint256 b;
            assembly {
                a := mload(selfptr)
                b := mload(otherptr)
            }
            if (a != b) {
                // Mask out irrelevant bytes and check again
                uint256 mask = type(uint256).max; // 0xffff...
                if (shortest < 32) {
                    mask = ~(2 ** (8 * (32 - shortest + idx)) - 1);
                }
                unchecked {
                    uint256 diff = (a & mask) - (b & mask);
                    if (diff != 0) return int256(diff);
                }
            }
            selfptr += 32;
            otherptr += 32;
        }
        return int256(self._len) - int256(other._len);
    }

    /*
     * @dev Returns true if the two slices contain the same text.
     * @param self The first slice to compare.
     * @param self The second slice to compare.
     * @return True if the slices are equal, false otherwise.
     */
    function equals(
        slice memory self,
        slice memory other
    ) internal pure returns (bool) {
        return compare(self, other) == 0;
    }

    /*
     * @dev Extracts the first rune in the slice into `rune`, advancing the
     *      slice to point to the next rune and returning `self`.
     * @param self The slice to operate on.
     * @param rune The slice that will contain the first rune.
     * @return `rune`.
     */
    function nextRune(
        slice memory self,
        slice memory rune
    ) internal pure returns (slice memory) {
        rune._ptr = self._ptr;

        if (self._len == 0) {
            rune._len = 0;
            return rune;
        }

        uint256 l;
        uint256 b;
        // Load the first byte of the rune into the LSBs of b
        assembly {
            b := and(mload(sub(mload(add(self, 32)), 31)), 0xFF)
        }
        if (b < 0x80) {
            l = 1;
        } else if (b < 0xE0) {
            l = 2;
        } else if (b < 0xF0) {
            l = 3;
        } else {
            l = 4;
        }

        // Check for truncated codepoints
        if (l > self._len) {
            rune._len = self._len;
            self._ptr += self._len;
            self._len = 0;
            return rune;
        }

        self._ptr += l;
        self._len -= l;
        rune._len = l;
        return rune;
    }

    /*
     * @dev Returns the first rune in the slice, advancing the slice to point
     *      to the next rune.
     * @param self The slice to operate on.
     * @return A slice containing only the first rune from `self`.
     */
    function nextRune(
        slice memory self
    ) internal pure returns (slice memory ret) {
        nextRune(self, ret);
    }

    /*
     * @dev Returns the number of the first codepoint in the slice.
     * @param self The slice to operate on.
     * @return The number of the first codepoint in the slice.
     */
    function ord(slice memory self) internal pure returns (uint256 ret) {
        if (self._len == 0) {
            return 0;
        }

        uint256 word;
        uint256 length;
        uint256 divisor = 2 ** 248;

        // Load the rune into the MSBs of b
        assembly {
            word := mload(mload(add(self, 32)))
        }
        uint256 b = word / divisor;
        if (b < 0x80) {
            ret = b;
            length = 1;
        } else if (b < 0xE0) {
            ret = b & 0x1F;
            length = 2;
        } else if (b < 0xF0) {
            ret = b & 0x0F;
            length = 3;
        } else {
            ret = b & 0x07;
            length = 4;
        }

        // Check for truncated codepoints
        if (length > self._len) {
            return 0;
        }

        for (uint256 i = 1; i < length; i++) {
            divisor = divisor / 256;
            b = (word / divisor) & 0xFF;
            if (b & 0xC0 != 0x80) {
                // Invalid UTF-8 sequence
                return 0;
            }
            ret = (ret * 64) | (b & 0x3F);
        }

        return ret;
    }

    /*
     * @dev Returns the keccak-256 hash of the slice.
     * @param self The slice to hash.
     * @return The hash of the slice.
     */
    function keccak(slice memory self) internal pure returns (bytes32 ret) {
        assembly {
            ret := keccak256(mload(add(self, 32)), mload(self))
        }
    }

    /*
     * @dev Returns true if `self` starts with `needle`.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return True if the slice starts with the provided text, false otherwise.
     */
    function startsWith(
        slice memory self,
        slice memory needle
    ) internal pure returns (bool) {
        if (self._len < needle._len) {
            return false;
        }

        if (self._ptr == needle._ptr) {
            return true;
        }

        bool equal;
        assembly {
            let length := mload(needle)
            let selfptr := mload(add(self, 0x20))
            let needleptr := mload(add(needle, 0x20))
            equal := eq(
                keccak256(selfptr, length),
                keccak256(needleptr, length)
            )
        }
        return equal;
    }

    /*
     * @dev If `self` starts with `needle`, `needle` is removed from the
     *      beginning of `self`. Otherwise, `self` is unmodified.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return `self`
     */
    function beyond(
        slice memory self,
        slice memory needle
    ) internal pure returns (slice memory) {
        if (self._len < needle._len) {
            return self;
        }

        bool equal = true;
        if (self._ptr != needle._ptr) {
            assembly {
                let length := mload(needle)
                let selfptr := mload(add(self, 0x20))
                let needleptr := mload(add(needle, 0x20))
                equal := eq(
                    keccak256(selfptr, length),
                    keccak256(needleptr, length)
                )
            }
        }

        if (equal) {
            self._len -= needle._len;
            self._ptr += needle._len;
        }

        return self;
    }

    /*
     * @dev Returns true if the slice ends with `needle`.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return True if the slice starts with the provided text, false otherwise.
     */
    function endsWith(
        slice memory self,
        slice memory needle
    ) internal pure returns (bool) {
        if (self._len < needle._len) {
            return false;
        }

        uint256 selfptr = self._ptr + self._len - needle._len;

        if (selfptr == needle._ptr) {
            return true;
        }

        bool equal;
        assembly {
            let length := mload(needle)
            let needleptr := mload(add(needle, 0x20))
            equal := eq(
                keccak256(selfptr, length),
                keccak256(needleptr, length)
            )
        }

        return equal;
    }

    /*
     * @dev If `self` ends with `needle`, `needle` is removed from the
     *      end of `self`. Otherwise, `self` is unmodified.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return `self`
     */
    function until(
        slice memory self,
        slice memory needle
    ) internal pure returns (slice memory) {
        if (self._len < needle._len) {
            return self;
        }

        uint256 selfptr = self._ptr + self._len - needle._len;
        bool equal = true;
        if (selfptr != needle._ptr) {
            assembly {
                let length := mload(needle)
                let needleptr := mload(add(needle, 0x20))
                equal := eq(
                    keccak256(selfptr, length),
                    keccak256(needleptr, length)
                )
            }
        }

        if (equal) {
            self._len -= needle._len;
        }

        return self;
    }

    // Returns the memory address of the first byte of the first occurrence of
    // `needle` in `self`, or the first byte after `self` if not found.
    function findPtr(
        uint256 selflen,
        uint256 selfptr,
        uint256 needlelen,
        uint256 needleptr
    ) private pure returns (uint256) {
        uint256 ptr = selfptr;
        uint256 idx;

        if (needlelen <= selflen) {
            if (needlelen <= 32) {
                bytes32 mask;
                if (needlelen > 0) {
                    mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1));
                }

                bytes32 needledata;
                assembly {
                    needledata := and(mload(needleptr), mask)
                }

                uint256 end = selfptr + selflen - needlelen;
                bytes32 ptrdata;
                assembly {
                    ptrdata := and(mload(ptr), mask)
                }

                while (ptrdata != needledata) {
                    if (ptr >= end) return selfptr + selflen;
                    ptr++;
                    assembly {
                        ptrdata := and(mload(ptr), mask)
                    }
                }
                return ptr;
            } else {
                // For long needles, use hashing
                bytes32 hash;
                assembly {
                    hash := keccak256(needleptr, needlelen)
                }

                for (idx = 0; idx <= selflen - needlelen; idx++) {
                    bytes32 testHash;
                    assembly {
                        testHash := keccak256(ptr, needlelen)
                    }
                    if (hash == testHash) return ptr;
                    ptr += 1;
                }
            }
        }
        return selfptr + selflen;
    }

    // Returns the memory address of the first byte after the last occurrence of
    // `needle` in `self`, or the address of `self` if not found.
    function rfindPtr(
        uint256 selflen,
        uint256 selfptr,
        uint256 needlelen,
        uint256 needleptr
    ) private pure returns (uint256) {
        uint256 ptr;

        if (needlelen <= selflen) {
            if (needlelen <= 32) {
                bytes32 mask;
                if (needlelen > 0) {
                    mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1));
                }

                bytes32 needledata;
                assembly {
                    needledata := and(mload(needleptr), mask)
                }

                ptr = selfptr + selflen - needlelen;
                bytes32 ptrdata;
                assembly {
                    ptrdata := and(mload(ptr), mask)
                }

                while (ptrdata != needledata) {
                    if (ptr <= selfptr) return selfptr;
                    ptr--;
                    assembly {
                        ptrdata := and(mload(ptr), mask)
                    }
                }
                return ptr + needlelen;
            } else {
                // For long needles, use hashing
                bytes32 hash;
                assembly {
                    hash := keccak256(needleptr, needlelen)
                }
                ptr = selfptr + (selflen - needlelen);
                while (ptr >= selfptr) {
                    bytes32 testHash;
                    assembly {
                        testHash := keccak256(ptr, needlelen)
                    }
                    if (hash == testHash) return ptr + needlelen;
                    ptr -= 1;
                }
            }
        }
        return selfptr;
    }

    /*
     * @dev Modifies `self` to contain everything from the first occurrence of
     *      `needle` to the end of the slice. `self` is set to the empty slice
     *      if `needle` is not found.
     * @param self The slice to search and modify.
     * @param needle The text to search for.
     * @return `self`.
     */
    function find(
        slice memory self,
        slice memory needle
    ) internal pure returns (slice memory) {
        uint256 ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr);
        self._len -= ptr - self._ptr;
        self._ptr = ptr;
        return self;
    }

    /*
     * @dev Modifies `self` to contain the part of the string from the start of
     *      `self` to the end of the first occurrence of `needle`. If `needle`
     *      is not found, `self` is set to the empty slice.
     * @param self The slice to search and modify.
     * @param needle The text to search for.
     * @return `self`.
     */
    function rfind(
        slice memory self,
        slice memory needle
    ) internal pure returns (slice memory) {
        uint256 ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr);
        self._len = ptr - self._ptr;
        return self;
    }

    /*
     * @dev Splits the slice, setting `self` to everything after the first
     *      occurrence of `needle`, and `token` to everything before it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and `token` is set to the entirety of `self`.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @param token An output parameter to which the first token is written.
     * @return `token`.
     */
    function split(
        slice memory self,
        slice memory needle,
        slice memory token
    ) internal pure returns (slice memory) {
        uint256 ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr);
        token._ptr = self._ptr;
        token._len = ptr - self._ptr;
        if (ptr == self._ptr + self._len) {
            // Not found
            self._len = 0;
        } else {
            self._len -= token._len + needle._len;
            self._ptr = ptr + needle._len;
        }
        return token;
    }

    /*
     * @dev Splits the slice, setting `self` to everything after the first
     *      occurrence of `needle`, and returning everything before it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and the entirety of `self` is returned.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @return The part of `self` up to the first occurrence of `delim`.
     */
    function split(
        slice memory self,
        slice memory needle
    ) internal pure returns (slice memory token) {
        split(self, needle, token);
    }

    /*
     * @dev Splits the slice, setting `self` to everything before the last
     *      occurrence of `needle`, and `token` to everything after it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and `token` is set to the entirety of `self`.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @param token An output parameter to which the first token is written.
     * @return `token`.
     */
    function rsplit(
        slice memory self,
        slice memory needle,
        slice memory token
    ) internal pure returns (slice memory) {
        uint256 ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr);
        token._ptr = ptr;
        token._len = self._len - (ptr - self._ptr);
        if (ptr == self._ptr) {
            // Not found
            self._len = 0;
        } else {
            self._len -= token._len + needle._len;
        }
        return token;
    }

    /*
     * @dev Splits the slice, setting `self` to everything before the last
     *      occurrence of `needle`, and returning everything after it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and the entirety of `self` is returned.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @return The part of `self` after the last occurrence of `delim`.
     */
    function rsplit(
        slice memory self,
        slice memory needle
    ) internal pure returns (slice memory token) {
        rsplit(self, needle, token);
    }

    /*
     * @dev Counts the number of nonoverlapping occurrences of `needle` in `self`.
     * @param self The slice to search.
     * @param needle The text to search for in `self`.
     * @return The number of occurrences of `needle` found in `self`.
     */
    function count(
        slice memory self,
        slice memory needle
    ) internal pure returns (uint256 cnt) {
        uint256 ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr) +
            needle._len;
        while (ptr <= self._ptr + self._len) {
            cnt++;
            ptr =
                findPtr(
                    self._len - (ptr - self._ptr),
                    ptr,
                    needle._len,
                    needle._ptr
                ) +
                needle._len;
        }
    }

    /*
     * @dev Returns True if `self` contains `needle`.
     * @param self The slice to search.
     * @param needle The text to search for in `self`.
     * @return True if `needle` is found in `self`, false otherwise.
     */
    function contains(
        slice memory self,
        slice memory needle
    ) internal pure returns (bool) {
        return
            rfindPtr(self._len, self._ptr, needle._len, needle._ptr) !=
            self._ptr;
    }

    /*
     * @dev Returns a newly allocated string containing the concatenation of
     *      `self` and `other`.
     * @param self The first slice to concatenate.
     * @param other The second slice to concatenate.
     * @return The concatenation of the two strings.
     */
    function concat(
        slice memory self,
        slice memory other
    ) internal pure returns (string memory) {
        string memory ret = new string(self._len + other._len);
        uint256 retptr;
        assembly {
            retptr := add(ret, 32)
        }
        memcpy(retptr, self._ptr, self._len);
        memcpy(retptr + self._len, other._ptr, other._len);
        return ret;
    }

    /*
     * @dev Joins an array of slices, using `self` as a delimiter, returning a
     *      newly allocated string.
     * @param self The delimiter to use.
     * @param parts A list of slices to join.
     * @return A newly allocated string containing all the slices in `parts`,
     *         joined with `self`.
     */
    function join(
        slice memory self,
        slice[] memory parts
    ) internal pure returns (string memory) {
        if (parts.length == 0) return "";

        uint256 length = self._len * (parts.length - 1);
        for (uint256 i = 0; i < parts.length; i++) length += parts[i]._len;

        string memory ret = new string(length);
        uint256 retptr;
        assembly {
            retptr := add(ret, 32)
        }

        for (uint256 i = 0; i < parts.length; i++) {
            memcpy(retptr, parts[i]._ptr, parts[i]._len);
            retptr += parts[i]._len;
            if (i < parts.length - 1) {
                memcpy(retptr, self._ptr, self._len);
                retptr += self._len;
            }
        }

        return ret;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 2000,
    "details": {
      "yul": true,
      "yulDetails": {
        "stackAllocation": true,
        "optimizerSteps": "dhfoDgvulfnTUtnIf"
      }
    }
  },
  "viaIR": true,
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"_MOSSAIRolesCfgAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"}],"name":"_locationSeed","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"}],"name":"_locationTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"_mintTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"}],"name":"_seedLocation","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"}],"name":"_seedToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_tokenSeed","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"seeds","type":"uint32[]"},{"internalType":"string[]","name":"uris","type":"string[]"},{"internalType":"uint32[]","name":"locations","type":"uint32[]"}],"name":"batchAddNFG","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"seed","type":"uint32"}],"name":"getMintTokens","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"seed","type":"uint32"}],"name":"getSeedOwer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getToken","outputs":[{"internalType":"uint32","name":"","type":"uint32"},{"internalType":"string","name":"","type":"string"}],"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":"to","type":"address"},{"internalType":"uint32","name":"location","type":"uint32"}],"name":"mint","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint32","name":"seed","type":"uint32"}],"name":"mintBySeed","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":"renounceOwnership","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":"address","name":"MOSSAIRolesCfgAddress","type":"address"}],"name":"setMOSSAIRolesCfgAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"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"}]

60806040523462000026576200001462000115565b604051612c30620004448239612c3090f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b90601f01601f191681019081106001600160401b038211176200006357604052565b6200002b565b90620000806200007860405190565b928362000041565b565b6001600160401b0381116200006357602090601f01601f19160190565b90620000b5620000af8362000082565b62000069565b918252565b620000c660116200009f565b704d4f535341495f49736c616e645f4e464760781b602082015290565b620000ed620000ba565b90565b620000fc60036200009f565b6226a4a760e91b602082015290565b620000ed620000f0565b6200008062000123620000e3565b6200012d6200010b565b620001389162000143565b6200008033620003e1565b6200008091829162000351565b634e487b7160e01b600052602260045260246000fd5b906001600283049216801562000189575b60208310146200018357565b62000150565b91607f169162000177565b9160001960089290920291821b911b5b9181191691161790565b620000ed620000ed620000ed9290565b9190620001d3620000ed620001dc93620001ae565b90835462000194565b9055565b6200008091600091620001be565b818110620001fa575050565b806200020a6000600193620001e0565b01620001ee565b9190601f81116200022157505050565b620002356200008093600052602060002090565b906020601f84018190048301931062000259575b6020601f909101040190620001ee565b909150819062000249565b906200026e815190565b906001600160401b038211620000635762000296826200028f855462000166565b8562000211565b602090601f8311600114620002d557620001dc929160009183620002c9575b5050600019600883021c1916906002021790565b015190503880620002b5565b601f19831691620002eb85600052602060002090565b9260005b8181106200032c5750916002939185600196941062000312575b50505002019055565b01516000196008601f8516021c1916905538808062000309565b91936020600181928787015181550195019201620002ef565b90620000809162000264565b90620003636200008092600062000345565b600162000345565b620000ed905b6001600160a01b031690565b620000ed90546200036b565b906001600160a01b0390620001a4565b620000ed9062000371906001600160a01b031682565b620000ed9062000399565b620000ed90620003af565b90620003d9620000ed620001dc92620003ba565b825462000389565b620003ed60076200037d565b90620003fb816007620003c5565b620004326200042b7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093620003ba565b91620003ba565b916200043d60405190565b600090a356fe6080604052600436101561001257600080fd5b60003560e01c806301ffc9a71461020257806306fdde03146101fd578063081812fc146101f8578063095ea7b3146101f35780630e0bc667146101ee57806323b872dd146101e957806342296c8c146101e457806342842e0e146101df57806342966c68146101da578063479f920b146101d55780635378cdf3146101d057806354ba610f146101cb5780635d4bbd1a146101c65780636352211e146101c157806370a08231146101bc578063715018a6146101b75780638da5cb5b146101b257806395d89b41146101ad578063a0273cdd146101a8578063a22cb465146101a3578063a318907b1461019e578063b88d4fde14610199578063c5033f9514610194578063c87b56dd1461018f578063d35e29d71461018a578063d67db1e014610185578063e4b50cb814610180578063e8ec17b21461017b578063e985e9c514610176578063f2fde38b146101715763ffbc144b0361020757610d8b565b610c41565b610c25565b610bdb565b610b46565b610b0b565b610ac6565b610aab565b610a8f565b6109e6565b61097b565b610962565b61090e565b6108d0565b6108b5565b61089d565b610882565b610867565b61084c565b61080e565b6107c8565b610585565b610542565b610529565b6104f7565b61044e565b610406565b6103d4565b610360565b610306565b61025d565b600080fd5b7fffffffff0000000000000000000000000000000000000000000000000000000081165b0361020757565b905035906102448261020c565b565b906020828203126102075761025a91610237565b90565b346102075761028b610278610273366004610246565b6128ec565b6040515b91829182901515815260200190565b0390f35b600091031261020757565b60005b8381106102ad5750506000910152565b818101518382015260200161029d565b6102de6102e76020936102f1936102d2815190565b80835293849260200190565b9586910161029a565b601f01601f191690565b0190565b602080825261025a929101906102bd565b346102075761031636600461028f565b61028b610321611132565b604051918291826102f5565b80610230565b905035906102448261032d565b906020828203126102075761025a91610333565b6001600160a01b031690565b346102075761028b61037b610376366004610340565b61128b565b604051918291826001600160a01b03909116815260200190565b6001600160a01b038116610230565b9050359061024482610395565b91906040838203126102075761025a906103cb81856103a4565b93602001610333565b34610207576103ed6103e73660046103b1565b9061122a565b604051005b906020828203126102075761025a916103a4565b34610207576103ed6104193660046103f2565b612bf1565b90916060828403126102075761025a61043784846103a4565b9361044581602086016103a4565b93604001610333565b34610207576103ed61046136600461041e565b91611354565b63ffffffff8116610230565b9050359061024482610467565b906020828203126102075761025a91610473565b6104a761025a61025a9263ffffffff1690565b63ffffffff1690565b906104ba90610494565b600052602052604060002090565b61025a916008021c6104a7565b9061025a91546104c8565b61025a906104f2600f916000926104b0565b6104d5565b346102075761028b61051261050d366004610480565b6104e0565b6040519182918263ffffffff909116815260200190565b34610207576103ed61053c36600461041e565b91611395565b34610207576103ed610555366004610340565b611a33565b61025a916008021c6001600160a01b031690565b9061025a915461055a565b61025a6000600961056e565b346102075761059536600461028f565b61028b61037b610579565b634e487b7160e01b600052604160045260246000fd5b90601f01601f1916810190811067ffffffffffffffff8211176105d857604052565b6105a0565b906102446105ea60405190565b92836105b6565b67ffffffffffffffff81116105d85760208091020190565b9092919261061e610619826105f1565b6105dd565b938185526020808601920283019281841161020757915b8383106106425750505050565b602080916106508486610473565b815201920191610635565b9080601f830112156102075781602061025a93359101610609565b67ffffffffffffffff81116105d857602090601f01601f19160190565b90826000939282370152565b909291926106af61061982610676565b938185526020850190828401116102075761024492610693565b9080601f830112156102075781602061025a9335910161069f565b9291906106f3610619826105f1565b93818552602080860192028101918383116102075781905b838210610719575050505050565b813567ffffffffffffffff81116102075760209161073a87849387016106c9565b81520191019061070b565b9080601f830112156102075781602061025a933591016106e4565b9160608383031261020757823567ffffffffffffffff8111610207578261078891850161065b565b92602081013567ffffffffffffffff811161020757836107a9918301610745565b92604082013567ffffffffffffffff81116102075761025a920161065b565b34610207576103ed6107db366004610760565b91612a61565b61025a916008021c81565b9061025a91546107e1565b61025a90610809600b916000926104b0565b6107ec565b346102075761028b610829610824366004610480565b6107f7565b6040515b9182918290815260200190565b61025a906104f2600e916000926104b0565b346102075761028b610512610862366004610480565b61083a565b346102075761028b61037b61087d366004610340565b6110fb565b346102075761028b6108296108983660046103f2565b611072565b34610207576108ad36600461028f565b6103ed610dfb565b34610207576108c536600461028f565b61028b61037b610db9565b34610207576108e036600461028f565b61028b61032161113c565b91906040838203126102075761025a9061090581856103a4565b93602001610473565b346102075761028b6108296109243660046108eb565b90612131565b801515610230565b905035906102448261092a565b91906040838203126102075761025a9061095981856103a4565b93602001610932565b34610207576103ed61097536600461093f565b906112b0565b346102075761028b61037b610991366004610480565b612215565b90608082820312610207576109ab81836103a4565b926109b982602085016103a4565b926109c78360408301610333565b92606082013567ffffffffffffffff81116102075761025a92016106c9565b34610207576103ed6109f9366004610996565b929190916113a5565b91906040838203126102075761025a906103cb8185610473565b634e487b7160e01b600052603260045260246000fd5b8054821015610a5557610a4c600191600052602060002090565b91020190600090565b610a1c565b610a68600c916000926104b0565b90610a71825490565b831015610a8c575061025a91610a8691610a32565b906107ec565b80fd5b346102075761028b610829610aa5366004610a02565b90610a5a565b346102075761028b610321610ac1366004610340565b612541565b346102075761028b610512610adc3660046108eb565b90611c1c565b61025a61025a61025a9290565b906104ba90610ae2565b61025a906104f2600a91600092610aef565b346102075761028b610512610b21366004610340565b610af9565b63ffffffff909116815261025a91604082019160208184039101526102bd565b3461020757610b5e610b59366004610340565b61228e565b9061028b610b6b60405190565b92839283610b26565b90610b94610b8d610b83845190565b8084529260200190565b9260200190565b9060005b818110610ba55750505090565b909192610bc2610bbb6001928651815260200190565b9460200190565b929101610b98565b602080825261025a92910190610b74565b346102075761028b610bf6610bf1366004610480565b612bbe565b60405191829182610bca565b91906040838203126102075761025a90610c1c81856103a4565b936020016103a4565b346102075761028b610278610c3b366004610c02565b906112bb565b34610207576103ed610c543660046103f2565b610f29565b634e487b7160e01b600052600060045260246000fd5b634e487b7160e01b600052602260045260246000fd5b9060016002830492168015610ca5575b6020831014610ca057565b610c6f565b91607f1691610c95565b80546000939291610ccc610cc283610c85565b8085529360200190565b9160018116908115610d1e5750600114610ce557505050565b610cf89192939450600052602060002090565b916000925b818410610d0a5750500190565b805484840152602090930192600101610cfd565b92949550505060ff1916825215156020020190565b9061025a91610caf565b90610244610d5792610d4e60405190565b93848092610d33565b03836105b6565b90600010610d6f5761025a90610d3d565b610c59565b61025a90610d86600d916000926104b0565b610d5e565b346102075761028b610321610da1366004610480565b610d74565b61025a90610354565b61025a9054610da6565b61025a6007610daf565b610dcb610e57565b610244610de9565b61035461025a61025a9290565b61025a90610dd3565b610244610df66000610de0565b610f8a565b610244610dc3565b15610e0a57565b60405162461bcd60e51b815280610e53600482016020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b0390fd5b610244610e62610db9565b610e7b610e6e33610354565b916001600160a01b031690565b14610e03565b61024490610e8d610e57565b610f04565b15610e9957565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608490fd5b61024490610df6610f186103546000610de0565b6001600160a01b0383161415610e92565b61024490610e81565b906001600160a01b03905b9181191691161790565b61035461025a61025a926001600160a01b031690565b61025a90610f47565b61025a90610f5d565b90610f7f61025a610f8692610f66565b8254610f32565b9055565b610f946007610daf565b90610fa0816007610f6f565b610fd3610fcd7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610f66565b91610f66565b91610fdd60405190565b80805b0390a3565b15610fec57565b60405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608490fd5b906104ba90610f66565b61025a9081565b61025a9054611061565b6110aa61025a91611081600090565b506110a36110926103546000610de0565b6001600160a01b0383161415610fe5565b6003611057565b611068565b156110b657565b60405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606490fd5b6111089060005b50611450565b61025a6111186103546000610de0565b6001600160a01b03831614156110af565b61025a90610d3d565b61025a6000611129565b61025a6001611129565b1561114d57565b60405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608490fd5b156111bf57565b60405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608490fd5b906102449161127561123b836110fb565b6112596001600160a01b0382166001600160a01b0385161415611146565b336001600160a01b038216811491821561127a575b50506111b8565b611736565b61128492506112bb565b388061126e565b6112ab61025a9161129a600090565b506112a481611862565b6004610aef565b610daf565b6102449190336117ec565b61025a916112d66112db926112ce600090565b506005611057565b611057565b5460ff1690565b156112e957565b60405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f766564000000000000000000000000000000000000006064820152608490fd5b61024492919061136c6113678433611467565b6112e2565b611619565b9061137e61061983610676565b918252565b61025a6000611371565b61025a611383565b9091610244926113a361138d565b925b610244939291906113b96113678433611467565b611431565b156113c557565b6040515b62461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608490fd5b91610244939161144b93611446838383611619565b611910565b6113be565b6112ab61025a9161145f600090565b506002610aef565b611470826110fb565b916001600160a01b0383166001600160a01b038316149283156114bd575b50821561149a57505090565b6114b99192506114ac610e6e9161128b565b926001600160a01b031690565b1490565b6114ca91935082906112bb565b913861148e565b156114d857565b60405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608490fd5b1561154a57565b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608490fd5b91906008610f3d9102916115ce6001600160a01b03841b90565b921b90565b91906115e461025a610f8693610f66565b9083546115b4565b610244916000916115d3565b9060001990610f3d565b9061161261025a610f8692610ae2565b82546115f8565b919061163f611627836110fb565b6116396001600160a01b038616610e6e565b146114d1565b611692600061166461165361035483610de0565b6001600160a01b0385161415611543565b611682611670856110fb565b6116396001600160a01b038816610e6e565b61168d846004610aef565b6115ec565b6116d661169f6001610ae2565b6116c66116cc8460036112d66116b58a83611057565b6116c6876116c283611068565b0390565b90611602565b916102f183611068565b6116ea816116e5846002610aef565b610f6f565b61172661172061171a7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef95610f66565b92610f66565b92610ae2565b9261173060405190565b600090a4565b90611746826116e5836004610aef565b61174f816110fb565b9161172661172061171a7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92595610f66565b1561178757565b60405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606490fd5b9060ff90610f3d565b906117e561025a610f8692151590565b82546117cc565b61180a6001600160a01b0383166001600160a01b0383161415611780565b6118228361181d846112d6856005611057565b6117d5565b610fe06118586118527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3193610f66565b93610f66565b9361027c60405190565b61186e61024491611873565b6110af565b61187e906000611102565b61188e610e6e6103546000610de0565b141590565b905051906102448261020c565b906020828203126102075761025a91611893565b6001600160a01b03918216815291166020820152604081019190915260806060820181905261025a929101906102bd565b6040513d6000823e3d90fd5b3d1561190b576119003d611371565b903d6000602084013e565b606090565b9290919061191d83611a49565b15611a2a57611962600061193a611935602096610f66565b610f66565b9261196d63150b7a029161194b3390565b9661195560405190565b998a988997889660e01b90565b8652600486016118b4565b03925af1600091816119fa575b506119af576119876118f1565b805161199a6119966000610ae2565b9190565b036119a7576040516113c9565b805190602001fd5b6114b97f150b7a02000000000000000000000000000000000000000000000000000000005b917fffffffff000000000000000000000000000000000000000000000000000000001690565b611a1c91925060203d8111611a23575b611a1481836105b6565b8101906118a0565b903861197a565b503d611a0a565b50505050600190565b61024490611a446113678233611467565b6122b7565b3b611a576119966000610ae2565b1190565b905051906102448261092a565b906020828203126102075761025a91611a5b565b15611a8357565b60405162461bcd60e51b815260206004820152600e60248201527f6e6f742061646d696e20726f6c650000000000000000000000000000000000006044820152606490fd5b61025a906104a7565b61025a9054611ac8565b15611ae257565b60405162461bcd60e51b815260206004820152601360248201527f6c6f636174696f6e206e6f7420657869737473000000000000000000000000006044820152606490fd5b15611b2e57565b60405162461bcd60e51b815260206004820152601360248201527f7365656420616c726561647920657869737473000000000000000000000000006044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b6000198114611b985760010190565b611b73565b9063ffffffff90610f3d565b90611bb961025a610f8692610494565b8254611b9d565b91906008610f3d9102916115ce600019841b90565b9190611be661025a610f8693610ae2565b908354611bc0565b90815491680100000000000000008310156105d85782611c1691600161024495018155610a32565b90611bd5565b611c696020611c316119356119356009610daf565b63c395fcb390611c523392611c4560405190565b9586948593849360e01b90565b83526001600160a01b031660048301526024820190565b03915afa8015611d8f5761025a92611c90611d4e92611d2a94600091611d61575b50611a7c565b611d49611cb9611cb4611cac611ca789600d6104b0565b611129565b97600e6104b0565b611ad1565b86611d30611ccc611cc8849a90565b5190565b91611ce5600093611cdf61199686610ae2565b11611adb565b611d04600b93611cfe6119966117206110aa89896104b0565b14611b27565b611d0e6008611068565b97888097611d25611d1e83611b89565b6008611602565b611d94565b8561208c565b611d4482611d3f86600a610aef565b611ba9565b6104b0565b611602565b611d5c61025a84600c6104b0565b611bee565b611d82915060203d8111611d88575b611d7a81836105b6565b810190611a68565b38611c8a565b503d611d70565b6118e5565b61024491611da061138d565b61144b9161024493611db28282611e58565b6114466000610de0565b15611dc357565b60405162461bcd60e51b815280610e53600482016020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b15611e1357565b60405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606490fd5b90611e636000610de0565b91611e826001600160a01b0384166001600160a01b0383161415611dbc565b611e9a611e95611e9184611873565b1590565b611e0c565b611ea9611e95611e9184611873565b6116d6611eb66001610ae2565b6116c66116cc846003611057565b15611ecb57565b60405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201527f6578697374656e7420746f6b656e0000000000000000000000000000000000006064820152608490fd5b61024491600091611bd5565b818110611f4d575050565b80611f5b6000600193611f36565b01611f42565b9190601f8111611f7057505050565b611f8261024493600052602060002090565b906020601f840181900483019310611fa5575b6020601f909101045b0190611f42565b9091508190611f95565b90611fb8815190565b9067ffffffffffffffff82116105d857611fdc82611fd68554610c85565b85611f61565b602090601f831160011461201757610f8692916000918361200c575b5050600019600883021c1916906002021790565b015190503880611ff8565b601f1983169161202c85600052602060002090565b9260005b81811061206a57509160029391856001969410612051575b50505002019055565b01516000196008601f8516021c19169055388080612048565b91936020600181928787015181550195019201612030565b9061024491611faf565b906120b2906120a261209d84611873565b611ec4565b6120ad836006610aef565b612082565b6120e07ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79161082d60405190565b0390a1565b156120ec57565b60405162461bcd60e51b815260206004820152600f60248201527f73656564206e6f742065786973747300000000000000000000000000000000006044820152606490fd5b906121699060206121486119356119356009610daf565b63c395fcb390611c52339261215c60405190565b9687948593849360e01b90565b03915afa918215611d8f5761025a611d2a9261219361025a95611d5c94600091611d615750611a7c565b61220e6121b1611ca76121aa611cb485600f6104b0565b600d6104b0565b96611d49836121be8a5190565b6121d0600091611cdf61199684610ae2565b6121ef600b916121e96119966117206110aa87876104b0565b116120e5565b611d306121fc6008611068565b9b8c9a8b8097611d25611d1e83611b89565b600c6104b0565b61222f6110aa61025a92612227600090565b50600b6104b0565b61087d61223c6000610ae2565b826121e9565b1561224957565b60405162461bcd60e51b815260206004820152601060248201527f746f6b656e206e6f7420657869737473000000000000000000000000000000006044820152606490fd5b906122a061229b83611873565b612242565b61025a6122b1611cb484600a610aef565b92612541565b61024490612492565b61025a9054610c85565b906000196122dc916020036008021c90565b8154169055565b9060009161230e6122f982600052602060002090565b928354600019600883021c1916906002021790565b905555565b919290602082101561237857601f841160011461234257610f86929350600019600883021c1916906002021790565b509061237361024493600161236a61235f85600052602060002090565b92601f602091010490565b82019101611f42565b6122e3565b506123b1829361238f600194600052602060002090565b611f9e6020601f860104820192601f8616806123b9575b50601f602091010490565b600202179055565b6123c5908886036122ca565b386123a6565b9290916801000000000000000082116105d8576020111561242457602081101561240557610f8691600019600883021c1916906002021790565b60019160ff191661241b84600052602060002090565b55600202019055565b60019150600202019055565b90815461243c81610c85565b90818311612465575b818310612453575b50505050565b61245c93612313565b3880808061244d565b612471838383876123cb565b612445565b600061024491612430565b90600003610d6f5761024490612476565b61249b816124de565b60066124b26124ad61025a8484610aef565b6122c0565b906000916124c261199684610ae2565b036124cc57505050565b610244926124d991610aef565b612481565b6124e7816110fb565b506124f1816110fb565b90612502600061168d836004610aef565b61252761250f6001610ae2565b6116c661251d856003611057565b916116c283611068565b612537600061168d836002610aef565b6116ea6000610de0565b61025a9061257f565b6102f16125629260209261255c815190565b94859290565b9384910161029a565b6125799061025a939261254a565b9061254a565b61258881611862565b612596611ca7826006610aef565b61259e61265a565b80516000906125af61199683610ae2565b14612602576125c2611996611720855190565b116125d257505061025a90612609565b61025a92506125f69161025a916125e860405190565b93849260208401928361256b565b908103825203826105b6565b5050905090565b61261281611862565b61261a61265a565b805160009061262b61199683610ae2565b111590506126505761025a6125f69161264661025a946126af565b906125e860405190565b505061025a61138d565b61025a61138d565b369037565b9061024461267d61267784611371565b93610676565b601f190160208401612662565b634e487b7160e01b600052601260045260246000fd5b81156126aa570490565b61268a565b6126b881612748565b906126c86001926102f184610ae2565b91806126d384612667565b936020018401905b6126e6575b50505090565b6127279060001901927f3031323334353637383961626364656600000000000000000000000000000000600a82061a8453612721600a610ae2565b906126a0565b90816127366119966000610ae2565b14612743579091816126db565b6126e0565b6127526000610ae2565b907a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000061277881610ae2565b8210156128ca575b506d04ee2d6d415b85acef810000000061279981610ae2565b8210156128a8575b50662386f26fc100006127b381610ae2565b821015612886575b506305f5e1006127ca81610ae2565b821015612864575b506127106127df81610ae2565b821015612842575b5060646127f381610ae2565b821015612820575b50612809611996600a610ae2565b10156128125790565b61025a906102f16001610ae2565b61283b9161272161283092610ae2565b916102f16002610ae2565b90386127fb565b61285d9161272161285292610ae2565b916102f16004610ae2565b90386127e7565b61287f9161272161287492610ae2565b916102f16008610ae2565b90386127d2565b6128a19161272161289692610ae2565b916102f16010610ae2565b90386127bb565b6128c3916127216128b892610ae2565b916102f16020610ae2565b90386127a1565b6128e5916127216128da92610ae2565b916102f16040610ae2565b9038612780565b61025a9061292d565b61290861290261025a9290565b60e01b90565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b61293d61290863490649066128f5565b7fffffffff0000000000000000000000000000000000000000000000000000000082161490811561296c575090565b61025a91507f80ac58cd000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008216149081156129d2575b81156129c8575090565b61025a9150612a1e565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f5b5e139f000000000000000000000000000000000000000000000000000000001491506129be565b6114b97f01ffc9a7000000000000000000000000000000000000000000000000000000006119d4565b90612a50825190565b811015610a55576020809102010190565b929190612a796020611c316119356119356009610daf565b03915afa8015611d8f57612a9491600091611d615750611a7c565b612a9e6000610ae2565b612aa961025a865190565b811015612b325780612ae4612ac1612b2d9385612a47565b516120ad600d612ade612ad4868a612a47565b5163ffffffff1690565b906104b0565b612b06612af4612ad48389612a47565b611d3f600e612ade612ad4868a612a47565b612b28612b16612ad48387612a47565b611d3f600f612ade612ad4868c612a47565b611b89565b612a9e565b5050509050565b90612b54612b48610b83845490565b92600052602060002090565b9060005b818110612b655750505090565b909192612b89612b82600192612b7a87611068565b815260200190565b9460010190565b929101612b58565b9061025a91612b39565b90610244610d5792612bac60405190565b93848092612b91565b61025a90612b9b565b612bd561025a91612bcd606090565b50600c6104b0565b612bb5565b61024490612be6610e57565b610244906009610f6f565b61024490612bda56fea2646970667358221220989cf4755d5039f58c284c71567d9dd2a6ba68a43298c5fec9dea480b3b1649e64736f6c63430008130033

Deployed Bytecode

0x6080604052600436101561001257600080fd5b60003560e01c806301ffc9a71461020257806306fdde03146101fd578063081812fc146101f8578063095ea7b3146101f35780630e0bc667146101ee57806323b872dd146101e957806342296c8c146101e457806342842e0e146101df57806342966c68146101da578063479f920b146101d55780635378cdf3146101d057806354ba610f146101cb5780635d4bbd1a146101c65780636352211e146101c157806370a08231146101bc578063715018a6146101b75780638da5cb5b146101b257806395d89b41146101ad578063a0273cdd146101a8578063a22cb465146101a3578063a318907b1461019e578063b88d4fde14610199578063c5033f9514610194578063c87b56dd1461018f578063d35e29d71461018a578063d67db1e014610185578063e4b50cb814610180578063e8ec17b21461017b578063e985e9c514610176578063f2fde38b146101715763ffbc144b0361020757610d8b565b610c41565b610c25565b610bdb565b610b46565b610b0b565b610ac6565b610aab565b610a8f565b6109e6565b61097b565b610962565b61090e565b6108d0565b6108b5565b61089d565b610882565b610867565b61084c565b61080e565b6107c8565b610585565b610542565b610529565b6104f7565b61044e565b610406565b6103d4565b610360565b610306565b61025d565b600080fd5b7fffffffff0000000000000000000000000000000000000000000000000000000081165b0361020757565b905035906102448261020c565b565b906020828203126102075761025a91610237565b90565b346102075761028b610278610273366004610246565b6128ec565b6040515b91829182901515815260200190565b0390f35b600091031261020757565b60005b8381106102ad5750506000910152565b818101518382015260200161029d565b6102de6102e76020936102f1936102d2815190565b80835293849260200190565b9586910161029a565b601f01601f191690565b0190565b602080825261025a929101906102bd565b346102075761031636600461028f565b61028b610321611132565b604051918291826102f5565b80610230565b905035906102448261032d565b906020828203126102075761025a91610333565b6001600160a01b031690565b346102075761028b61037b610376366004610340565b61128b565b604051918291826001600160a01b03909116815260200190565b6001600160a01b038116610230565b9050359061024482610395565b91906040838203126102075761025a906103cb81856103a4565b93602001610333565b34610207576103ed6103e73660046103b1565b9061122a565b604051005b906020828203126102075761025a916103a4565b34610207576103ed6104193660046103f2565b612bf1565b90916060828403126102075761025a61043784846103a4565b9361044581602086016103a4565b93604001610333565b34610207576103ed61046136600461041e565b91611354565b63ffffffff8116610230565b9050359061024482610467565b906020828203126102075761025a91610473565b6104a761025a61025a9263ffffffff1690565b63ffffffff1690565b906104ba90610494565b600052602052604060002090565b61025a916008021c6104a7565b9061025a91546104c8565b61025a906104f2600f916000926104b0565b6104d5565b346102075761028b61051261050d366004610480565b6104e0565b6040519182918263ffffffff909116815260200190565b34610207576103ed61053c36600461041e565b91611395565b34610207576103ed610555366004610340565b611a33565b61025a916008021c6001600160a01b031690565b9061025a915461055a565b61025a6000600961056e565b346102075761059536600461028f565b61028b61037b610579565b634e487b7160e01b600052604160045260246000fd5b90601f01601f1916810190811067ffffffffffffffff8211176105d857604052565b6105a0565b906102446105ea60405190565b92836105b6565b67ffffffffffffffff81116105d85760208091020190565b9092919261061e610619826105f1565b6105dd565b938185526020808601920283019281841161020757915b8383106106425750505050565b602080916106508486610473565b815201920191610635565b9080601f830112156102075781602061025a93359101610609565b67ffffffffffffffff81116105d857602090601f01601f19160190565b90826000939282370152565b909291926106af61061982610676565b938185526020850190828401116102075761024492610693565b9080601f830112156102075781602061025a9335910161069f565b9291906106f3610619826105f1565b93818552602080860192028101918383116102075781905b838210610719575050505050565b813567ffffffffffffffff81116102075760209161073a87849387016106c9565b81520191019061070b565b9080601f830112156102075781602061025a933591016106e4565b9160608383031261020757823567ffffffffffffffff8111610207578261078891850161065b565b92602081013567ffffffffffffffff811161020757836107a9918301610745565b92604082013567ffffffffffffffff81116102075761025a920161065b565b34610207576103ed6107db366004610760565b91612a61565b61025a916008021c81565b9061025a91546107e1565b61025a90610809600b916000926104b0565b6107ec565b346102075761028b610829610824366004610480565b6107f7565b6040515b9182918290815260200190565b61025a906104f2600e916000926104b0565b346102075761028b610512610862366004610480565b61083a565b346102075761028b61037b61087d366004610340565b6110fb565b346102075761028b6108296108983660046103f2565b611072565b34610207576108ad36600461028f565b6103ed610dfb565b34610207576108c536600461028f565b61028b61037b610db9565b34610207576108e036600461028f565b61028b61032161113c565b91906040838203126102075761025a9061090581856103a4565b93602001610473565b346102075761028b6108296109243660046108eb565b90612131565b801515610230565b905035906102448261092a565b91906040838203126102075761025a9061095981856103a4565b93602001610932565b34610207576103ed61097536600461093f565b906112b0565b346102075761028b61037b610991366004610480565b612215565b90608082820312610207576109ab81836103a4565b926109b982602085016103a4565b926109c78360408301610333565b92606082013567ffffffffffffffff81116102075761025a92016106c9565b34610207576103ed6109f9366004610996565b929190916113a5565b91906040838203126102075761025a906103cb8185610473565b634e487b7160e01b600052603260045260246000fd5b8054821015610a5557610a4c600191600052602060002090565b91020190600090565b610a1c565b610a68600c916000926104b0565b90610a71825490565b831015610a8c575061025a91610a8691610a32565b906107ec565b80fd5b346102075761028b610829610aa5366004610a02565b90610a5a565b346102075761028b610321610ac1366004610340565b612541565b346102075761028b610512610adc3660046108eb565b90611c1c565b61025a61025a61025a9290565b906104ba90610ae2565b61025a906104f2600a91600092610aef565b346102075761028b610512610b21366004610340565b610af9565b63ffffffff909116815261025a91604082019160208184039101526102bd565b3461020757610b5e610b59366004610340565b61228e565b9061028b610b6b60405190565b92839283610b26565b90610b94610b8d610b83845190565b8084529260200190565b9260200190565b9060005b818110610ba55750505090565b909192610bc2610bbb6001928651815260200190565b9460200190565b929101610b98565b602080825261025a92910190610b74565b346102075761028b610bf6610bf1366004610480565b612bbe565b60405191829182610bca565b91906040838203126102075761025a90610c1c81856103a4565b936020016103a4565b346102075761028b610278610c3b366004610c02565b906112bb565b34610207576103ed610c543660046103f2565b610f29565b634e487b7160e01b600052600060045260246000fd5b634e487b7160e01b600052602260045260246000fd5b9060016002830492168015610ca5575b6020831014610ca057565b610c6f565b91607f1691610c95565b80546000939291610ccc610cc283610c85565b8085529360200190565b9160018116908115610d1e5750600114610ce557505050565b610cf89192939450600052602060002090565b916000925b818410610d0a5750500190565b805484840152602090930192600101610cfd565b92949550505060ff1916825215156020020190565b9061025a91610caf565b90610244610d5792610d4e60405190565b93848092610d33565b03836105b6565b90600010610d6f5761025a90610d3d565b610c59565b61025a90610d86600d916000926104b0565b610d5e565b346102075761028b610321610da1366004610480565b610d74565b61025a90610354565b61025a9054610da6565b61025a6007610daf565b610dcb610e57565b610244610de9565b61035461025a61025a9290565b61025a90610dd3565b610244610df66000610de0565b610f8a565b610244610dc3565b15610e0a57565b60405162461bcd60e51b815280610e53600482016020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b0390fd5b610244610e62610db9565b610e7b610e6e33610354565b916001600160a01b031690565b14610e03565b61024490610e8d610e57565b610f04565b15610e9957565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608490fd5b61024490610df6610f186103546000610de0565b6001600160a01b0383161415610e92565b61024490610e81565b906001600160a01b03905b9181191691161790565b61035461025a61025a926001600160a01b031690565b61025a90610f47565b61025a90610f5d565b90610f7f61025a610f8692610f66565b8254610f32565b9055565b610f946007610daf565b90610fa0816007610f6f565b610fd3610fcd7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610f66565b91610f66565b91610fdd60405190565b80805b0390a3565b15610fec57565b60405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608490fd5b906104ba90610f66565b61025a9081565b61025a9054611061565b6110aa61025a91611081600090565b506110a36110926103546000610de0565b6001600160a01b0383161415610fe5565b6003611057565b611068565b156110b657565b60405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606490fd5b6111089060005b50611450565b61025a6111186103546000610de0565b6001600160a01b03831614156110af565b61025a90610d3d565b61025a6000611129565b61025a6001611129565b1561114d57565b60405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608490fd5b156111bf57565b60405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608490fd5b906102449161127561123b836110fb565b6112596001600160a01b0382166001600160a01b0385161415611146565b336001600160a01b038216811491821561127a575b50506111b8565b611736565b61128492506112bb565b388061126e565b6112ab61025a9161129a600090565b506112a481611862565b6004610aef565b610daf565b6102449190336117ec565b61025a916112d66112db926112ce600090565b506005611057565b611057565b5460ff1690565b156112e957565b60405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f766564000000000000000000000000000000000000006064820152608490fd5b61024492919061136c6113678433611467565b6112e2565b611619565b9061137e61061983610676565b918252565b61025a6000611371565b61025a611383565b9091610244926113a361138d565b925b610244939291906113b96113678433611467565b611431565b156113c557565b6040515b62461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608490fd5b91610244939161144b93611446838383611619565b611910565b6113be565b6112ab61025a9161145f600090565b506002610aef565b611470826110fb565b916001600160a01b0383166001600160a01b038316149283156114bd575b50821561149a57505090565b6114b99192506114ac610e6e9161128b565b926001600160a01b031690565b1490565b6114ca91935082906112bb565b913861148e565b156114d857565b60405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608490fd5b1561154a57565b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608490fd5b91906008610f3d9102916115ce6001600160a01b03841b90565b921b90565b91906115e461025a610f8693610f66565b9083546115b4565b610244916000916115d3565b9060001990610f3d565b9061161261025a610f8692610ae2565b82546115f8565b919061163f611627836110fb565b6116396001600160a01b038616610e6e565b146114d1565b611692600061166461165361035483610de0565b6001600160a01b0385161415611543565b611682611670856110fb565b6116396001600160a01b038816610e6e565b61168d846004610aef565b6115ec565b6116d661169f6001610ae2565b6116c66116cc8460036112d66116b58a83611057565b6116c6876116c283611068565b0390565b90611602565b916102f183611068565b6116ea816116e5846002610aef565b610f6f565b61172661172061171a7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef95610f66565b92610f66565b92610ae2565b9261173060405190565b600090a4565b90611746826116e5836004610aef565b61174f816110fb565b9161172661172061171a7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92595610f66565b1561178757565b60405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606490fd5b9060ff90610f3d565b906117e561025a610f8692151590565b82546117cc565b61180a6001600160a01b0383166001600160a01b0383161415611780565b6118228361181d846112d6856005611057565b6117d5565b610fe06118586118527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3193610f66565b93610f66565b9361027c60405190565b61186e61024491611873565b6110af565b61187e906000611102565b61188e610e6e6103546000610de0565b141590565b905051906102448261020c565b906020828203126102075761025a91611893565b6001600160a01b03918216815291166020820152604081019190915260806060820181905261025a929101906102bd565b6040513d6000823e3d90fd5b3d1561190b576119003d611371565b903d6000602084013e565b606090565b9290919061191d83611a49565b15611a2a57611962600061193a611935602096610f66565b610f66565b9261196d63150b7a029161194b3390565b9661195560405190565b998a988997889660e01b90565b8652600486016118b4565b03925af1600091816119fa575b506119af576119876118f1565b805161199a6119966000610ae2565b9190565b036119a7576040516113c9565b805190602001fd5b6114b97f150b7a02000000000000000000000000000000000000000000000000000000005b917fffffffff000000000000000000000000000000000000000000000000000000001690565b611a1c91925060203d8111611a23575b611a1481836105b6565b8101906118a0565b903861197a565b503d611a0a565b50505050600190565b61024490611a446113678233611467565b6122b7565b3b611a576119966000610ae2565b1190565b905051906102448261092a565b906020828203126102075761025a91611a5b565b15611a8357565b60405162461bcd60e51b815260206004820152600e60248201527f6e6f742061646d696e20726f6c650000000000000000000000000000000000006044820152606490fd5b61025a906104a7565b61025a9054611ac8565b15611ae257565b60405162461bcd60e51b815260206004820152601360248201527f6c6f636174696f6e206e6f7420657869737473000000000000000000000000006044820152606490fd5b15611b2e57565b60405162461bcd60e51b815260206004820152601360248201527f7365656420616c726561647920657869737473000000000000000000000000006044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b6000198114611b985760010190565b611b73565b9063ffffffff90610f3d565b90611bb961025a610f8692610494565b8254611b9d565b91906008610f3d9102916115ce600019841b90565b9190611be661025a610f8693610ae2565b908354611bc0565b90815491680100000000000000008310156105d85782611c1691600161024495018155610a32565b90611bd5565b611c696020611c316119356119356009610daf565b63c395fcb390611c523392611c4560405190565b9586948593849360e01b90565b83526001600160a01b031660048301526024820190565b03915afa8015611d8f5761025a92611c90611d4e92611d2a94600091611d61575b50611a7c565b611d49611cb9611cb4611cac611ca789600d6104b0565b611129565b97600e6104b0565b611ad1565b86611d30611ccc611cc8849a90565b5190565b91611ce5600093611cdf61199686610ae2565b11611adb565b611d04600b93611cfe6119966117206110aa89896104b0565b14611b27565b611d0e6008611068565b97888097611d25611d1e83611b89565b6008611602565b611d94565b8561208c565b611d4482611d3f86600a610aef565b611ba9565b6104b0565b611602565b611d5c61025a84600c6104b0565b611bee565b611d82915060203d8111611d88575b611d7a81836105b6565b810190611a68565b38611c8a565b503d611d70565b6118e5565b61024491611da061138d565b61144b9161024493611db28282611e58565b6114466000610de0565b15611dc357565b60405162461bcd60e51b815280610e53600482016020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b15611e1357565b60405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606490fd5b90611e636000610de0565b91611e826001600160a01b0384166001600160a01b0383161415611dbc565b611e9a611e95611e9184611873565b1590565b611e0c565b611ea9611e95611e9184611873565b6116d6611eb66001610ae2565b6116c66116cc846003611057565b15611ecb57565b60405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201527f6578697374656e7420746f6b656e0000000000000000000000000000000000006064820152608490fd5b61024491600091611bd5565b818110611f4d575050565b80611f5b6000600193611f36565b01611f42565b9190601f8111611f7057505050565b611f8261024493600052602060002090565b906020601f840181900483019310611fa5575b6020601f909101045b0190611f42565b9091508190611f95565b90611fb8815190565b9067ffffffffffffffff82116105d857611fdc82611fd68554610c85565b85611f61565b602090601f831160011461201757610f8692916000918361200c575b5050600019600883021c1916906002021790565b015190503880611ff8565b601f1983169161202c85600052602060002090565b9260005b81811061206a57509160029391856001969410612051575b50505002019055565b01516000196008601f8516021c19169055388080612048565b91936020600181928787015181550195019201612030565b9061024491611faf565b906120b2906120a261209d84611873565b611ec4565b6120ad836006610aef565b612082565b6120e07ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79161082d60405190565b0390a1565b156120ec57565b60405162461bcd60e51b815260206004820152600f60248201527f73656564206e6f742065786973747300000000000000000000000000000000006044820152606490fd5b906121699060206121486119356119356009610daf565b63c395fcb390611c52339261215c60405190565b9687948593849360e01b90565b03915afa918215611d8f5761025a611d2a9261219361025a95611d5c94600091611d615750611a7c565b61220e6121b1611ca76121aa611cb485600f6104b0565b600d6104b0565b96611d49836121be8a5190565b6121d0600091611cdf61199684610ae2565b6121ef600b916121e96119966117206110aa87876104b0565b116120e5565b611d306121fc6008611068565b9b8c9a8b8097611d25611d1e83611b89565b600c6104b0565b61222f6110aa61025a92612227600090565b50600b6104b0565b61087d61223c6000610ae2565b826121e9565b1561224957565b60405162461bcd60e51b815260206004820152601060248201527f746f6b656e206e6f7420657869737473000000000000000000000000000000006044820152606490fd5b906122a061229b83611873565b612242565b61025a6122b1611cb484600a610aef565b92612541565b61024490612492565b61025a9054610c85565b906000196122dc916020036008021c90565b8154169055565b9060009161230e6122f982600052602060002090565b928354600019600883021c1916906002021790565b905555565b919290602082101561237857601f841160011461234257610f86929350600019600883021c1916906002021790565b509061237361024493600161236a61235f85600052602060002090565b92601f602091010490565b82019101611f42565b6122e3565b506123b1829361238f600194600052602060002090565b611f9e6020601f860104820192601f8616806123b9575b50601f602091010490565b600202179055565b6123c5908886036122ca565b386123a6565b9290916801000000000000000082116105d8576020111561242457602081101561240557610f8691600019600883021c1916906002021790565b60019160ff191661241b84600052602060002090565b55600202019055565b60019150600202019055565b90815461243c81610c85565b90818311612465575b818310612453575b50505050565b61245c93612313565b3880808061244d565b612471838383876123cb565b612445565b600061024491612430565b90600003610d6f5761024490612476565b61249b816124de565b60066124b26124ad61025a8484610aef565b6122c0565b906000916124c261199684610ae2565b036124cc57505050565b610244926124d991610aef565b612481565b6124e7816110fb565b506124f1816110fb565b90612502600061168d836004610aef565b61252761250f6001610ae2565b6116c661251d856003611057565b916116c283611068565b612537600061168d836002610aef565b6116ea6000610de0565b61025a9061257f565b6102f16125629260209261255c815190565b94859290565b9384910161029a565b6125799061025a939261254a565b9061254a565b61258881611862565b612596611ca7826006610aef565b61259e61265a565b80516000906125af61199683610ae2565b14612602576125c2611996611720855190565b116125d257505061025a90612609565b61025a92506125f69161025a916125e860405190565b93849260208401928361256b565b908103825203826105b6565b5050905090565b61261281611862565b61261a61265a565b805160009061262b61199683610ae2565b111590506126505761025a6125f69161264661025a946126af565b906125e860405190565b505061025a61138d565b61025a61138d565b369037565b9061024461267d61267784611371565b93610676565b601f190160208401612662565b634e487b7160e01b600052601260045260246000fd5b81156126aa570490565b61268a565b6126b881612748565b906126c86001926102f184610ae2565b91806126d384612667565b936020018401905b6126e6575b50505090565b6127279060001901927f3031323334353637383961626364656600000000000000000000000000000000600a82061a8453612721600a610ae2565b906126a0565b90816127366119966000610ae2565b14612743579091816126db565b6126e0565b6127526000610ae2565b907a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000061277881610ae2565b8210156128ca575b506d04ee2d6d415b85acef810000000061279981610ae2565b8210156128a8575b50662386f26fc100006127b381610ae2565b821015612886575b506305f5e1006127ca81610ae2565b821015612864575b506127106127df81610ae2565b821015612842575b5060646127f381610ae2565b821015612820575b50612809611996600a610ae2565b10156128125790565b61025a906102f16001610ae2565b61283b9161272161283092610ae2565b916102f16002610ae2565b90386127fb565b61285d9161272161285292610ae2565b916102f16004610ae2565b90386127e7565b61287f9161272161287492610ae2565b916102f16008610ae2565b90386127d2565b6128a19161272161289692610ae2565b916102f16010610ae2565b90386127bb565b6128c3916127216128b892610ae2565b916102f16020610ae2565b90386127a1565b6128e5916127216128da92610ae2565b916102f16040610ae2565b9038612780565b61025a9061292d565b61290861290261025a9290565b60e01b90565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b61293d61290863490649066128f5565b7fffffffff0000000000000000000000000000000000000000000000000000000082161490811561296c575090565b61025a91507f80ac58cd000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008216149081156129d2575b81156129c8575090565b61025a9150612a1e565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f5b5e139f000000000000000000000000000000000000000000000000000000001491506129be565b6114b97f01ffc9a7000000000000000000000000000000000000000000000000000000006119d4565b90612a50825190565b811015610a55576020809102010190565b929190612a796020611c316119356119356009610daf565b03915afa8015611d8f57612a9491600091611d615750611a7c565b612a9e6000610ae2565b612aa961025a865190565b811015612b325780612ae4612ac1612b2d9385612a47565b516120ad600d612ade612ad4868a612a47565b5163ffffffff1690565b906104b0565b612b06612af4612ad48389612a47565b611d3f600e612ade612ad4868a612a47565b612b28612b16612ad48387612a47565b611d3f600f612ade612ad4868c612a47565b611b89565b612a9e565b5050509050565b90612b54612b48610b83845490565b92600052602060002090565b9060005b818110612b655750505090565b909192612b89612b82600192612b7a87611068565b815260200190565b9460010190565b929101612b58565b9061025a91612b39565b90610244610d5792612bac60405190565b93848092612b91565b61025a90612b9b565b612bd561025a91612bcd606090565b50600c6104b0565b612bb5565b61024490612be6610e57565b610244906009610f6f565b61024490612bda56fea2646970667358221220989cf4755d5039f58c284c71567d9dd2a6ba68a43298c5fec9dea480b3b1649e64736f6c63430008130033

[ 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.