Sparkn

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

Use BASIS_POINTS instead of 10000

Summary

Not using constants as intended leads to code inconsistency.

Vulnerability Details

When checking if totalPercentage equals 10000(100%) - COMMISSION_FEE we use 10000 (magic number) instead of the predefined BASIS_POINTS variable.

src/Distibutor.sol
if (totalPercentage != (10000 - COMMISSION_FEE)) {
revert Distributor__MismatchedPercentages();
}

Impact

Using magic numbers will confuse people who read the code.

Tools Used

Manual

Recommendations

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

Support

FAQs

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