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

`Puppy Raffle::selectWinner()` check not present

Summary

Puppy Raffle::selectWinner() if a check is not added for entrance fee. total fees can be 0, which can lead to function fail

Vulnerability Details

@> uint256 totalAmountCollected = players.length * entranceFee;
uint256 prizePool = (totalAmountCollected * 80) / 100;
uint256 fee = (totalAmountCollected * 20) / 100;
totalFees = totalFees + uint64(fee);

Impact

Function fail

Tools Used

Manual Review

Recommendations

add a check before totalAmountCollected ofPuppy Raffle::selectWinner()

- uint256 totalAmountCollected = players.length * entranceFee;
+ require(entranceFee>0,"inadequate entrance fee");
+ uint256 totalAmountCollected = players.length * entranceFee;
Updates

Lead Judging Commences

patrickalphac Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: User experience and design improvement

Support

FAQs

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