The matchRewards
function in the LikeRegistry contract suffers from potential precision loss during fee calculations due to integer division rounding down. This occurs when calculating the protocol fees using percentage-based arithmetic.
The issue arises because:
The fee calculation uses integer division (totalRewards * FIXEDFEE) / 100
Any remainder from the division is truncated
For small transactions or when the total amount isn't perfectly divisible by 100, the protocol loses fee revenue
Protocol loses fee revenue due to rounding down
Manual Review
Implement a precision-based calculation using basis points (bps) instead of percentages:
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.