Sparkn

CodeFox Inc.
DeFiFoundryProxy
15,000 USDC
View results
Submission Details
Severity: low
Valid

Out of gas error when distributing funds

Summary

If a high number of users win the contest, then you must disburse money to a high number of addresses.

Vulnerability Details

If the number of winners is too high, the function call that loops through both the percentages array and the winners array will cause the tx to fail via out of gas.

Impact

In the case of a high number of winners, potentially no one would win? Or the organizer would have to only reward part of the winners.

Tools Used

Manual Review

Recommendations

Limit the length of the arrays so that there must be a maximum number of winners. Another solution would be to disallow zero value inside of the percentages array, this would in turn implicitly create a maximum number of winners since the percentage values have to add up to 10000 - COMMISION_FEE.

Support

FAQs

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