Cyfrin / 2023-08-sparkn

Other
11 stars 15 forks source link

Magic number is used #860

Closed codehawks-bot closed 1 year ago

codehawks-bot commented 1 year ago

Magic number is used

Severity

Low Risk

Relevant GitHub Links

https://github.com/Cyfrin/2023-08-sparkn/blob/0f139b2dc53905700dd29a01451b330f829653e9/src/Distributor.sol#L135

To improve the code’s readability and facilitate refactoring, consider using BASIS_POINTS constant instead of magic number at the Distributor._distribute function L135:

60:    // a constant value of 10,000 (basis points) = 100%
61:    uint256 private constant BASIS_POINTS = 10000;
...
135:        if (totalPercentage != (10000 - COMMISSION_FEE)) {

https://github.com/Cyfrin/2023-08-sparkn/blob/0f139b2dc53905700dd29a01451b330f829653e9/src/Distributor.sol#L135

PatrickAlphaC commented 1 year ago

informational, closing