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

Missing Token Existence Check in updateCharacteristics Function

Summary

The updateCharacteristics function in the RamNFT contract lacks a check to validate the existence of the specified token (tokenId) before updating its characteristics. Without this validation step, there is a risk of manipulating non-existing tokens or encountering errors related to token absence.

Impact

The lack of token existence validation opens up the possibility of unauthorized manipulation of non-existent tokens within the contract.

Tools Used

manual code review

Recommendations

function updateCharacteristics(
uint256 tokenId,
bool _isJitaKrodhah,
bool _isDhyutimaan,
bool _isVidvaan,
bool _isAatmavan,
bool _isSatyavaakyah
) public onlyChoosingRamContract {
require(_tokenExists(tokenId), "Token does not exist.");
Characteristics[tokenId] = CharacteristicsOfRam({
ram: Characteristics[tokenId].ram,
isJitaKrodhah: _isJitaKrodhah,
isDhyutimaan: _isDhyutimaan,
isVidvaan: _isVidvaan,
isAatmavan: _isAatmavan,
isSatyavaakyah: _isSatyavaakyah
});
}```
Updates

Lead Judging Commences

bube Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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