Impact: Low
Likelihood: High
Severity: Low
The SoulboundProfileNFT::ownerOf
function, inherited from the ERC721
contract, is used in SoulboundProfileNFT::tokenURI
. If no owner is found, ownerOf
will revert with an IERC721Errors.ERC721NonexistentToken::ERC721NonexistentToken
error instead of returning 'address(0)'. As a result, the execution will never reach the intended SoulboundProfileNFT::ERC721Metadata__URI_QueryFor_NonExistentToken()
custom error .
Users will receive the default ERC721NonexistentToken error instead of the intended custom error, potentially leading to a less informative or inconsistent error-handling experience.
Add the following test to testSoulboundProfileNFT.t.sol
along with the required import.
Manual Review
Use the internal _ownerOf
function directly to check ownership.
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.
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.