Sparkn

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

Miscalulation of total token and Potential Division by Zero

Summary

In the _distribute function, the calculation of amount for token distribution involves a division operation (totalAmount * percentages[i] / BASIS_POINTS). If the value of BASIS_POINTS is set to 0, it will result in a division by zero error during execution.

Vulnerability Details

uint256 amount = totalAmount * percentages[i] / BASIS_POINTS;

Impact

If the BASIS_POINTS constant is inadvertently set to 0, it will trigger a division by zero error during the token distribution calculation. This will lead to a transaction failure and halt the contract's execution.

Tools Used

Manual

Recommendations

Ensure that the BASIS_POINTS constant is never set to 0 and validate its value before performing division operations. This will prevent division by zero errors and maintain the correct execution of the contract.

Support

FAQs

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