while calculating fee in calculateAmountsFromFee
in Helpers.sol the code returns the value by rounding down.
In the above snippet, the fee is calculated as a percentage of the totalAmount
. This fee could represent a protocol fee applied when a user withdraws or a broker fee. The issue here is that the fee calculation rounds down towards zero, resulting in small losses for the protocol. Although this may seem minor initially, as the protocol grows and this rounding occurs repeatedly, the accumulated loss could become significant due to the consistent rounding down.
This vulnerability leads to cumulative financial losses for the protocol due to repeated rounding down of fees. Over time, these small discrepancies add up, reducing revenue, impacting financial sustainability, and potentially requiring adjustments to fee rates to compensate.
Manual Review
Roundup while calculating fee
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.