Lesson 14: DeclarationError: Undeclared identifier. (require(_exists(tokenId), "URI Query for nonexistent token"); #6311
Unanswered
mrMorningstar96
asked this question in
Q&A
Replies: 2 comments
-
I don't know why the _exists function is not in the ERC721.sol or wherever it's supposed to be. So I proceed and add this into the ERC721.sol
|
Beta Was this translation helpful? Give feedback.
0 replies
-
require(_exists(tokenId), "URI Query for nonexistent token"); that above is only avaliable for version 4 of openzellian/contracts
/** address owner = _ownerOf(tokenId);
if (owner == address(0)) {
revert ERC721NonexistentToken(tokenId);
} @LukaNikolic96 @PatrickAlphaC remeber to mark this as anwer |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
This is my code:
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "base64-sol/base64.sol";
contract DynamicSvgNft is ERC721 {
// Gonna show 2 different images based on price of ETH
}
`
I am getting this error:
Any help will be appreciated.
Thank you :D
Beta Was this translation helpful? Give feedback.
All reactions