DatingDapp

First Flight #33
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: low
Invalid

`SoulboundProfileNFT::tokenURI` function Reverts Incorrectly

Description:

The tokenURI function checks ownerOf(tokenId) == address(0) to validate token existence. However, ERC721’s ownerOf already reverts for non-existent tokens, making this check unreachable.

Impact:

The custom error ERC721Metadata__URI_QueryFor_NonExistentToken is never thrown. Queries for non-existent tokens revert with the default ERC721 error instead.

Recommended Mitigation:

Replace the ownerOf check with the ERC721 _exists function.

Reccomendation
if (!_exists(tokenId)) revert ERC721Metadata__URI_QueryFor_NonExistentToken();
Updates

Appeal created

n0kto Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational or Gas

Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.