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

Exact Amount Check for Raffle Entry

Summary

The function enterRaffle requires users to send an exact amount of Ether for raffle entry, potentially causing issues if users send slightly more than required.

Vulnerability Details

Requiring an exact Ether amount for raffle entry may lead to DOS as the condition requires sending the exact number of Ether, calculating the exact fee is a difficult thing so if the user sends even 1 wei more or less then the function will revert and will cause DOS every time.

Impact

This approach may result in user unable to enter in the raffle as this function will revert almost everytime

Tools Used

Manual Review

Recommendations

change the condition to as follow

require(msg.value >= entranceFee * newPlayers.length, "PuppyRaffle: Must send enough to enter raffle");

and the return the dust amount to the user

Updates

Lead Judging Commences

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

greifers-send-money-to-contract-to-block-withdrawfees

Support

FAQs

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