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

[M-2] GasCost will be too high for the user who joins the raffle which already has some participants.

Summary

Gas cost to join the raffle at a later stage will be too high for the users because of check for duplicate loop.

Vulnerability Details

The enterRaffle() is using nested for loop to check for the duplicates. so if the player's array length is too large then the next player who is joining needs to pay a whole lot of gas to cover for this looping.

Impact

Users will lose huge funds in terms of gas just to join the raffle.

Tools Used

manual review

Recommendations

Mitigation in this case would be to only allow a fixed number of players. Or use alternative way to check for duplicates.

Updates

Lead Judging Commences

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

denial-of-service-in-enter-raffle

Support

FAQs

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

Give us feedback!