Beginner FriendlyFoundryGameFi
100 EXP
View results
Submission Details
Severity: low
Invalid

For Loops Reading from storage results in high gas cost for owner

Summary

The for loops in MartenitsaVoting::announceWinner and MartenitsaEvent::stopEvent
read from storage _tokenIds.length and participants.length respectively which consumes a lot of gas

Impact

The owner has to pay a lot of gasfee when he calls these functions

Recommendations

Instead of Reading from storage, creating Local Variables for array Lengths and using those Local Variables in the for loops will mitigate this issue.

Updates

Lead Judging Commences

bube Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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