PatrickAlphaC / hardhat-nft-fcc

100 stars 139 forks source link

DeclarationError: Undeclared identifier. (_exists(tokenId)) #107

Closed borailci closed 6 months ago

borailci commented 7 months ago

DeclarationError: Undeclared identifier. --> contracts/DynamicSVG_NFT.sol:79:14: | 79 | if (!_exists(tokenId)) { | ^^^^^^^ Error HH600: Compilation failed

I cannot find this function in ERC721.sol, is it changed or removed?

(Note: The source code of DynamicSVG_NFT.sol is same as the DynamicSVG_NFT.sol in the repo.

stDean commented 6 months ago

Hello, try this line instead

 if (ownerOf(tokenId) != address(0)) {
      revert ERC721Metadata__URI_QueryFor_NonExistentToken();
    }