The current implementation of the tokenURI function in the smart contract disallows NFT owners from viewing their NFTs. This is due to the conditional check on whether the owner of the token with the given tokenId is the zero address. If it is, the transaction reverts with the error message MondrainWallet__InvalidTokenId. This check effectively prevents legitimate NFT owners from accessing the URI associated with their tokens.
Steps to Reproduce:
Deploy the smart contract implementing the ERC721 standard for NFTs.
Mint one or more NFTs to different addresses.
Attempt to retrieve the URI associated with any of the minted NFTs using the tokenURI function while being the owner of the NFT.
Expected Behavior:
NFT owners should be able to view the URI associated with their NFTs using the tokenURI function without encountering any errors.
Actual Behavior:
NFT owners are unable to view the URI associated with their NFTs due to the conditional check in the tokenURI
function. The transaction reverts with the error message MondrainWallet__InvalidTokenId
, indicating an invalid token ID
.
This issue prevents NFT owners from accessing important metadata associated with their NFTs, such as name, image, and other attributes. It also disrupts the intended functionality of the ERC721 standard, which is to provide a standardized interface for non-fungible tokens, including the ability for owners to access metadata via the tokenURI
function.
Manual
Modify the tokenURI function to remove the conditional check that prevents access for NFT owners. Instead of reverting the transaction when the owner of the token is the zero address, consider implementing a different error handling mechanism that allows legitimate NFT owners to access the URI associated with their tokens. This could involve returning an empty string or emitting an event to notify the caller of the invalid token ID without reverting the transaction.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.