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

getActivePlayerIndex function inefficiency

Summary

We want to avoid using for loops to iterate over arrays as it is expensive computation.

Vulnerability Details

Line 110 - 117 in PuppRaffle.Sol is using a for loop when a mapping is much more suitable.

Impact

Uneccesary gas cost

Tools Used

Manual inspection

Recommendations

Use a mapping instead of for loop

Updates

Lead Judging Commences

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

getActivePlayerIndex can say a player is both entered at slot 0 and inactive

Support

FAQs

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