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

Potential DoS based on how players are stored

Summary

As just an array is used for players, it can lead to higher gas costs, and sometimes even lead to DoS if the players array becomes too long.

Vulnerability Details

As an array is used for storing players, in certain cases like finding duplicates, a nested for loop is used which is highly inefficient, which can also lead to DoS if the array grows to a large number.

Impact

  • DoS in certain cases

  • Increased Gas Cost

Tools Used

Manual Review

Recommendations

Instead of arrays, maybe an array and a mapping (round > address > playerIndex) combination can be used, along with a round detail (uint256). Thus after each round, you can delete the array, and increment the round variable. This will also make the function _isActivePlayer(...) consume less gas (Will return non-zero value, i.e. the index for active player) and also the function getActivePlayerIndex(...).

Updates

Lead Judging Commences

patrickalphac 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.