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

Events are not indexed, makes it difficult to recover incase of some unexpected situations

Summary

Events are necessary to be emitted for front end applications to read on-chain data of a contract or for developers to recover lost contract data due to unexpected situations like serious bugs or rekt.

Vulnerability Details

create and emit enough events for the functions as shown below.

increaseValuesOfParticipants - emit to log when a user challenges to increase nft characteristics and emit if ram is selected.
selectRamIfNotSelected - emit when ram is selected

killRavana - emit when ravana is killed
withdraw - emit when ram withdraws

RamNFT::setChoosingRamContract - emit when ChoosingRam contract address is set.
updateCharacteristics - emit when characteristics of an nft are updated.

Impact

logging is important for any application. failure to do so, will result in not knowing what happened and why behind it hence difficult to debug.

Recommendations

for eg. you can write events like this and emit them. make sure to follow (CEI) design patter to check, emit and then interact

+ event ChoosingRam__RamSelected(address indexed);
function selectRamIfNotSelected() public RamIsNotSelected OnlyOrganiser {
...
uint256 random = uint256(keccak256(abi.encodePacked(block.timestamp, block.prevrandao))) % ramNFT.tokenCounter();
+ emit ChoosingRam__RamSelected(selectedRam);
selectedRam = ramNFT.getCharacteristics(random).ram;
isRamSelected = true;
}
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.