Sparkn

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

Potential Calculation Error

Summary

In the _Distribute function of the Distributor contract, there is an error while checking if the totalPercentage calculated is correct

Vulnerability Details

while checking if the totalPercentage calculated is correct != operator is being used, which will only check if the value calculated is not equal to BASIS_POINTS - COMMISSION_FEE but will not check for if totalPercentage is greater than BASIS_POINTS - COMMISSION_FEE.

Impact

if the totalPercentage calculated is greater than the BASIS_POINTS - COMMISSION_FEE, it will create a potential vulnerability, which will affect the calculation of the amount transferred to winners and stadium fee

Tools Used

Manual Analysis

Recommendations

use < or <= operators in

if (totalPercentage != (10000 - COMMISSION_FEE)) {
revert Distributor__MismatchedPercentages();
}

Support

FAQs

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