Description: tokenURI guards against non-existent tokens with if (ownerOf(tokenId) == address(0)). However, OpenZeppelin's ERC721 implementation causes ownerOf to revert for non-existent tokens rather than returning address(0), so the custom error ERC721Metadata__URI_QueryFor_NonExistentToken is unreachable.
Impact: The intended guard is ineffective; the custom error is dead code.
Recommended Mitigation: Use _ownerOf (internal) which returns address(0) for non-existent tokens, or use _exists(tokenId).
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.