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

selectWinner should emit event

Summary

selectWinner function should emit an event containing information such as the winner address, amount won, and tokenId of the nft minted.

Vulnerability Details

N/A

Impact

The impact is low. The public previousWinner variable can be queried to see who the winner was of the previous raffle was.

However it will make it a significantly better experience for the dapp developers to be able to quickly get the results and amounts and nft tokenId's of all past winners. this will not be possible without emitting an event. But this issue will not effect the logic of the contract in any way.

Tools Used

Manual Review

Recommendations

declare an event such as:
event WinnerSelected(address newFeeAddress,uint256 amount,uint tokenId);

and emit this event at the end of the selectWinner() function.

Updates

Lead Judging Commences

Hamiltonite Lead Judge about 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

events are missing or not detailed enough

Support

FAQs

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

Give us feedback!