I ran in to Solidity problem Need some help

I was Trying it for 3days to fixed it
itā€™s Hashlips contracts/NFT/NFT_FULL.sol
The Problem it was I put in https://remix.ethereum.org He show an erro in (using Strings for uint256;) Strings
and I fixed it (import ā€œ@openzeppelin/contracts/utils/Strings.solā€:wink: itā€™s become ok but He show onther erro
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
require(
_exists(tokenId),
ā€œERC721Metadata: URI query for nonexistent tokenā€
);

_exists(tokenId), exists it;s The erro

Please I need some Help

[quote=ā€œshihab dollartreecompass, post:1, topic:25441, full:trueā€]
I was Trying it for 3days to fixed it
itā€™s Hashlips contracts/NFT/NFT_FULL.sol
The Problem it was I put in https:// remix . ethereum. org He show an erro in (using Strings for uint256;) Strings
and I fixed it (import ā€œ@openzeppelin/contracts/utils/Strings.solā€:wink: itā€™s become ok but He show onther erro
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
require(
_exists(tokenId),
ā€œERC721Metadata: URI query for nonexistent tokenā€
);

_exists(tokenId), exists it;s The erro

Please I need some Help
[/quote]

Hello, @shihab

To address this error, ensure that the _exists(tokenId) function call within the tokenURI function is correctly checking for the existence of the token with the given tokenId. The _exists function should return true if the token exists and false otherwise.

function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
require(_exists(tokenId), ā€œERC721Metadata: URI query for nonexistent tokenā€);

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

}

Ensure that _exists function is correctly implemented and returns true when the token exists. If youā€™re using a standard ERC721 contract, this function should already be provided by the OpenZeppelin library or by your contract implementation.

I hope my suggestion is helpful to you.

Best Regard,
angela683