creation_sourcecode: // Sources flattened with hardhat v2.17.4 https://hardhat.org
  
  // SPDX-License-Identifier: GPL-3.0
  
  // File contracts/ERC165/IERC165.sol
  
  // Original license: SPDX_License_Identifier: GPL-3.0
  pragma solidity ^0.8.9;
  
  /**
   * @dev Interface of the ERC165 standard, as defined in the
   * https://eips.ethereum.org/EIPS/eip-165[EIP].
   *
   * Implementers can declare support of contract interfaces, which can then be
   * queried by others ({ERC165Checker}).
   *
   * For an implementation, see {ERC165}.
   */
  interface IERC165 {
  	/**
  	 * @dev Returns true if this contract implements the interface defined by
  	 * `interfaceId`. See the corresponding
  	 * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
  	 * to learn more about how these ids are created.
  	 *
  	 * This function call must use less than 30 000 gas.
  	 */
  	function supportsInterface(bytes4 interfaceId) external view returns (bool);
  }
  
  
  // File contracts/ERC165/ERC165.sol
  
  // Original license: SPDX_License_Identifier: GPL-3.0
  pragma solidity ^0.8.9;
  
  /**
   * @dev Implementation of the {IERC165} interface.
   *
   * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
   * for the additional interface id that will be supported. For example:
   *
   * ```solidity
   * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
   *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
   * }
   * ```
   *
   * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
   */
  abstract contract ERC165 is IERC165 {
  	/**
  	 * @dev See {IERC165-supportsInterface}.
  	 */
  	function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
  		return interfaceId == type(IERC165).interfaceId;
  	}
  }
  
  
  // File contracts/ERC721/IERC721.sol
  
  // Original license: SPDX_License_Identifier: GPL-3.0
  pragma solidity ^0.8.9;
  
  /**
   * @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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
  	 *
  	 * Requirements:
  	 *
  	 * - `from` cannot be the zero address.
  	 * - `to` cannot be the zero address.
  	 * - `tokenId` token must be owned by `from`.
  	 * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
  	 *
  	 * Emits a {Transfer} event.
  	 */
  	function transferFrom(
  		address from,
  		address to,
  		uint256 tokenId
  	) external;
  
  	/**
  	 * @dev Gives permission to `to` to transfer `tokenId` token to another account.
  	 * The approval is cleared when the token is transferred.
  	 *
  	 * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
  	 *
  	 * Requirements:
  	 *
  	 * - The caller must own the token or be an approved operator.
  	 * - `tokenId` must exist.
  	 *
  	 * Emits an {Approval} event.
  	 */
  	function approve(address to, uint256 tokenId) external;
  
  	/**
  	 * @dev 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 contracts/ERC721/IERC721Metadata.sol
  
  // Original license: SPDX_License_Identifier: GPL-3.0
  pragma solidity ^0.8.9;
  
  /**
   * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
   * @dev See https://eips.ethereum.org/EIPS/eip-721
   */
  interface IERC721Metadata is IERC721 {
  	/**
  	 * @dev Returns the token collection name.
  	 */
  	function name() external view returns (string memory);
  
  	/**
  	 * @dev Returns the token collection symbol.
  	 */
  	function symbol() external view returns (string memory);
  
  	/**
  	 * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
  	 */
  	function tokenURI(uint256 tokenId) external view returns (string memory);
  }
  
  
  // File contracts/ERC721/IERC721Receiver.sol
  
  // Original license: SPDX_License_Identifier: GPL-3.0
  pragma solidity ^0.8.9;
  
  /**
   * @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);
  }
  
  
  // File contracts/Library/Address.sol
  
  // Original license: SPDX_License_Identifier: GPL-3.0
  pragma solidity ^0.8.9;
  
  library Address {
  	function isContract(address account) internal view returns (bool) {
  		return account.code.length > 0;
  	}
  }
  
  
  // File contracts/Library/Strings.sol
  
  // Original license: SPDX_License_Identifier: GPL-3.0
  pragma solidity ^0.8.9;
  
  library Strings {
      bytes16 private constant _HEX_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) {
          // Inspired by OraclizeAPI's implementation - MIT licence
          // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
  
          if (value == 0) {
              return "0";
          }
          uint256 temp = value;
          uint256 digits;
          while (temp != 0) {
              digits++;
              temp /= 10;
          }
          bytes memory buffer = new bytes(digits);
          while (value != 0) {
              digits -= 1;
              buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
              value /= 10;
          }
          return string(buffer);
      }
  
      function toString(bytes memory data) internal pure returns (string memory) {
          bytes memory alphabet = "0123456789abcdef";
          bytes memory str = new bytes(2 + data.length * 2);
          str[0] = "0";
          str[1] = "x";
          for (uint i = 0; i < data.length; i++) {
              str[2 + i * 2] = alphabet[uint(uint8(data[i] >> 4))];
              str[3 + i * 2] = alphabet[uint(uint8(data[i] & 0x0f))];
          }
          return string(str);
      }
  
      /// bytes32类型转化为string型转
      function bytes32ToString(bytes32 x) internal pure returns (string memory) {
          bytes memory bytesString = new bytes(32);
          uint charCount = 0;
          for (uint j = 0; j < 32; j++) {
              bytes1 char = bytes1(bytes32(uint(x) * 2 ** (8 * j)));
              if (char != 0) {
                  bytesString[charCount] = char;
                  charCount++;
              }
          }
          bytes memory bytesStringTrimmed = new bytes(charCount);
          for (uint j = 0; j < charCount; j++) {
              bytesStringTrimmed[j] = bytesString[j];
          }
          return string(bytesStringTrimmed);
      }
  }
  
  
  // File contracts/Utils/Context.sol
  
  // Original license: SPDX_License_Identifier: GPL-3.0
  pragma solidity ^0.8.9;
  
  /**
   * @dev Provides information about the current execution context, including the
   * sender of the transaction and its data. While these are generally available
   * via msg.sender and msg.data, they should not be accessed in such a direct
   * manner, since when dealing with meta-transactions the account sending and
   * paying for execution may not be the actual sender (as far as an application
   * is concerned).
   *
   * This contract is only required for intermediate, library-like contracts.
   */
  abstract contract Context {
  	function _msgSender() internal view virtual returns (address) {
  		return msg.sender;
  	}
  
  	function _msgData() internal view virtual returns (bytes calldata) {
  		return msg.data;
  	}
  }
  
  
  // File contracts/ERC721/ERC721.sol
  
  // Original license: SPDX_License_Identifier: GPL-3.0
  pragma solidity ^0.8.9;
  
  
  
  
  
  
  
  /**
   * @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 {
      // Token name
      string public name;
  
      // Token symbol
      string public 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;
  
      string public baseURI;
  
      /**
       * @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 = owners[tokenId];
          require(owner != address(0), "ERC721: invalid token ID");
          return owner;
      }
  
      /**
       * @dev See {IERC721Metadata-tokenURI}.
       */
      function tokenURI(
          uint256 tokenId
      ) public view virtual override returns (string memory) {
          _requireMinted(tokenId);
  
          return
              bytes(baseURI).length > 0
                  ? string(abi.encodePacked(baseURI, Strings.toString(tokenId)))
                  : "";
      }
  
      /**
       * @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 nor 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 nor approved"
          );
  
          _transfer(from, to, tokenId);
      }
  
      /**
       * @dev See {IERC721-safeTransferFrom}.
       */
      function safeTransferFrom(
          address from,
          address to,
          uint256 tokenId
      ) public virtual override {
          safeTransferFrom(from, to, tokenId, "");
      }
  
      /**
       * @dev See {IERC721-safeTransferFrom}.
       */
      function safeTransferFrom(
          address from,
          address to,
          uint256 tokenId,
          bytes memory data
      ) public virtual override {
          require(
              _isApprovedOrOwner(_msgSender(), tokenId),
              "ERC721: caller is not token owner nor approved"
          );
          _safeTransfer(from, to, tokenId, data);
      }
  
      /**
       * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
       * are aware of the ERC721 protocol to prevent tokens from being forever locked.
       *
       * `data` is additional data, it has no specified format and it is sent in call to `to`.
       *
       * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
       * implement alternative mechanisms to perform token transfer, such as signature-based.
       *
       * Requirements:
       *
       * - `from` cannot be the zero address.
       * - `to` cannot be the zero address.
       * - `tokenId` token must exist and be owned by `from`.
       * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
       *
       * Emits a {Transfer} event.
       */
      function _safeTransfer(
          address from,
          address to,
          uint256 tokenId,
          bytes memory data
      ) internal virtual {
          _transfer(from, to, tokenId);
          require(
              _checkOnERC721Received(from, to, tokenId, data),
              "ERC721: transfer to non ERC721Receiver implementer"
          );
      }
  
      /**
       * @dev Returns whether `tokenId` exists.
       *
       * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
       *
       * Tokens start existing when they are minted (`_mint`),
       * and stop existing when they are burned (`_burn`).
       */
      function _exists(uint256 tokenId) internal view virtual returns (bool) {
          return owners[tokenId] != address(0);
      }
  
      /**
       * @dev Returns whether `spender` is allowed to manage `tokenId`.
       *
       * Requirements:
       *
       * - `tokenId` must exist.
       */
      function _isApprovedOrOwner(
          address spender,
          uint256 tokenId
      ) internal view virtual returns (bool) {
          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);
  
          balances[to] += 1;
          owners[tokenId] = to;
  
          emit Transfer(address(0), to, tokenId);
  
          _afterTokenTransfer(address(0), to, tokenId);
      }
  
      /**
       * @dev Destroys `tokenId`.
       * The approval is cleared when the token is burned.
       *
       * Requirements:
       *
       * - `tokenId` must exist.
       *
       * Emits a {Transfer} event.
       */
      function _burn(uint256 tokenId) internal virtual {
          address owner = ERC721.ownerOf(tokenId);
  
          _beforeTokenTransfer(owner, address(0), tokenId);
  
          // Clear approvals
          _approve(address(0), tokenId);
  
          balances[owner] -= 1;
          delete owners[tokenId];
  
          emit Transfer(owner, address(0), tokenId);
  
          _afterTokenTransfer(owner, address(0), tokenId);
      }
  
      /**
       * @dev Transfers `tokenId` from `from` to `to`.
       *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
       *
       * Requirements:
       *
       * - `to` cannot be the zero address.
       * - `tokenId` token must be owned by `from`.
       *
       * Emits a {Transfer} event.
       */
      function _transfer(
          address from,
          address to,
          uint256 tokenId
      ) internal virtual {
          require(
              ERC721.ownerOf(tokenId) == from,
              "ERC721: transfer from incorrect owner"
          );
          require(to != address(0), "ERC721: transfer to the zero address");
  
          _beforeTokenTransfer(from, to, tokenId);
  
          // Clear approvals from the previous owner
          _approve(address(0), tokenId);
  
          balances[from] -= 1;
          balances[to] += 1;
          owners[tokenId] = to;
  
          emit Transfer(from, to, tokenId);
  
          _afterTokenTransfer(from, to, tokenId);
      }
  
      /**
       * @dev Approve `to` to operate on `tokenId`
       *
       * Emits 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 (Address.isContract(to)) {
              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.
       *
       * Calling conditions:
       *
       * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
       * transferred to `to`.
       * - When `from` is zero, `tokenId` will be minted for `to`.
       * - When `to` is zero, ``from``'s `tokenId` will be burned.
       * - `from` and `to` are never both zero.
       *
       * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
       */
      function _beforeTokenTransfer(
          address from,
          address to,
          uint256 tokenId
      ) internal virtual {}
  
      /**
       * @dev Hook that is called after any transfer of tokens. This includes
       * minting and burning.
       *
       * Calling conditions:
       *
       * - when `from` and `to` are both non-zero.
       * - `from` and `to` are never both zero.
       *
       * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
       */
      function _afterTokenTransfer(
          address from,
          address to,
          uint256 tokenId
      ) internal virtual {}
  }
  
  
  // File contracts/ERC721/ERC721URIStorage.sol
  
  // Original license: SPDX_License_Identifier: GPL-3.0
  pragma solidity ^0.8.9;
  
  /**
   * @dev ERC721 token with storage based token URI management.
   */
  abstract contract ERC721URIStorage is ERC721 {
      // Optional mapping for token URIs
      mapping(uint256 => string) private tokenURIs;
  
      /**
       * @dev See {IERC721Metadata-tokenURI}.
       */
      function tokenURI(
          uint256 tokenId
      ) public view virtual override returns (string memory) {
          _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`.
       *
       * Requirements:
       *
       * - `tokenId` must exist.
       */
      function _setTokenURI(
          uint256 tokenId,
          string memory _tokenURI
      ) internal virtual {
          require(
              _exists(tokenId),
              "ERC721URIStorage: URI set of nonexistent token"
          );
          tokenURIs[tokenId] = _tokenURI;
      }
  
      /**
       * @dev 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];
          }
      }
  }
  
  
  // File contracts/WORNFT/StarryVoyages.sol
  
  // Original license: SPDX_License_Identifier: GPL-3.0
  pragma solidity ^0.8.9;
  
  contract StarryVoyages is ERC721URIStorage {
      uint256 constant maxTotalSupply = 100000;
      uint256 public tokenId;
      address public creator;
  
      constructor(
          string memory _name,
          string memory _symbol,
          string memory _baseUri,
          address _creator
      ) {
          name = _name;
          symbol = _symbol;
          baseURI = _baseUri;
          creator = _creator;
      }
  
      function contractURI() public view returns (string memory) {
          return string(abi.encodePacked(baseURI, "contract.json"));
      }
  
      function tokenURI(
          uint256 _tokenId
      ) public view virtual override returns (string memory) {
          _requireMinted(_tokenId);
          return
              string(
                  abi.encodePacked(baseURI, Strings.toString(_tokenId), ".json")
              );
      }
  
      function mint() external {
          uint256 _currentTokenId;
          unchecked {
              _currentTokenId = ++tokenId;
          }
          require(_currentTokenId <= maxTotalSupply, "Over total supply");
          _safeMint(creator, _currentTokenId);
      }
  
      function totalSupply() public view returns (uint256) {
          return tokenId;
      }
  }