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

Check for (0) address in enterRaffle() - Corrupted players[] array

Summary

The enterRaffle() function does not check input addresses for the (0) address. This can lead to complications in the raffle.

Vulnerability Details

A user can skirt the "4 player minimum" rule by entering array that has (0) addresses

Impact

Medium - This can lead to raffles with less players giving an unfair advantage to those left in the game. This defeats the purpose of having a minimum number of players

Tools Used

Manual inspection

Recommendations

Add a check like so:

for (uint256 i = 0; i < newPlayers.length; i++) {
require(newPlayers[i] != address(0), "PuppyRaffle: Enter with a real address");
// resume logic
}
Updates

Lead Judging Commences

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

zero address can win the raffle

Funds are locked to no one. If someone gets the refund issue, they also got this issue. IMPACT: High Likelihood: High

Support

FAQs

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

Give us feedback!