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

Missing Zero Check on entranceFee

Summary

This project requires an entrance fee to enter a raffle game. However, the constructor did not validate that the
entrance fee is a non-zero amount.

Vulnerability Details

In the absence of a check for zero value, users may set the entrance fee to zero, which can lead to unforeseen issues in
the raffle game mechanics, potentially allowing users to enter without contributing to the prize pool.

Impact

The lack of a zero check on the entrance fee could result in exploitation where users enter the raffle without paying
the fee, undermining the fairness and profitability of the game.

Tools Used

Manual review

Recommendations

To prevent this issue, the following check should be added to the constructor to ensure that the entrance fee cannot be
set to zero:

// add this
require(_entranceFee > 0, "cannot set zero");
entranceFee = _entranceFee;

Alternatively, establish a rule that defines a minimum amount for the entranceFee to further safeguard against
underpricing.

Updates

Lead Judging Commences

Hamiltonite Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Admin Input/call validation

Support

FAQs

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