The calculation of matchingFees
in the contract contains two key issues
Solidity performs integer division, meaning any fractional result is truncated (rounded down).
If totalRewards
is a small value (e.g., less than 100) and FIXEDFEE = 10
, the calculated fee will incorrectly round to zero, causing fees to be bypassed.
Suppose totalRewards = 5
and FIXEDFEE = 10
Since Solidity truncates decimal values, small totalRewards
values will result in a zero fee. making the contrat having no earning.
manual review
Use Basis Points for More Precise Fee Calculation
Modify the calculation to use basis points (1/10,000) instead of percent (1/100):
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.