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

enterRaffle() may fail due to exceed Gas Limit

Summary

There are some unbounded loops that can lead to a Denial of Service (DoS) attack.

Vulnerability Details

The the enterRaffle() function iterates through all players to check if any player is already registered (duplicate address). The function performs certain checks to add the player's address to the players array. However, with all these operations taking place, the loop and gas consumption may cause a contract revert due to exceeding the block's gas limit.

Impact

Players cannot enter the raffle, and the primary service of this contract will be denied.

Tools Used

Manual Review

Recommendations

To avoid this issue, limit the size of the players array.

Updates

Lead Judging Commences

Hamiltonite Lead Judge almost 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.