Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: low
Invalid

Missing check of `tokenId` existance in `RamNFT::getCharacteristics`

Summary

RamNFT::getCharacteristics expects the tokenId of an NFT as an input parameter.
However, the function does not check whether the specified tokenId actually exists. Instead, for non-existent tokenIds, it will return a CharacteristicsOfRam struct with the following default values:

CharacteristicsOfRam.ram = 0x0000000000000000000000000000000000000000 isJitaKrodhah = false isDhyutimaan = false isVidvaan = false isAatmavan = false isSatyavaakyah = false

Impact

The function returns without an error, potetially leading to confusion.

Tools Used

Manual review.

Recommendations

function getCharacteristics(uint256 tokenId) public view returns (CharacteristicsOfRam memory) {
+ require(_ownerOf(tokenId) != address(0), "TokenID does not exist.");
return Characteristics[tokenId];
}
Updates

Lead Judging Commences

bube Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Info/Gas/Invalid according to docs

Support

FAQs

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