Sparkn

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

No check on COMMISSION_FEE being less than BASIS_POINTS

Summary

COMMISSION_FEE can be set greater than BASIS_POINTS, causing protocol to always revert when organizer or owner tries to distribute rewards.

Vulnerability Details

In future when the SPARKN team deploys a new version of Deployer.sol, the COMMISSION_FEE could erroneously be set greater than or equal to BASIS_POINTS causing distribution of reward by every organizer/owner to revert here.

This will not only cause waste of gas in the deployment but also disrupt the protocol's availability, and the only remedy would be to correct the code and redeploy again.

Impact

  • Bad user experience

  • Protocol will be not be usable

  • Gas wastage due to erroneous deployment

Tools Used

Manual audit

Recommendations

In the constructor of Distributor.sol, just like there is a check for factoryAddress != address(0) & stadiumAddress != address(0), add a check:

require(COMMISSION_FEE < BASIS_POINTS);

Also, better to change this line of code:

// remove this
- if (totalPercentage != (10000 - COMMISSION_FEE)) {
// add this
+ if (totalPercentage != (BASIS_POINTS - COMMISSION_FEE)) {

Support

FAQs

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

Give us feedback!