Loss of precision when calculating the annualized fee #187
Labels
1 (Low Risk)
Assets are not at risk. State handling, function incorrect as to spec, issues with comments
bug
Something isn't working
duplicate
This issue or pull request already exists
Handle
cmichel
Vulnerability details
The
BasketFacet.calcOutStandingAnnualizedFee
function calculates the pending fee as:The early division by
1e18
will lead to a loss of precision. Slightly fewer fees will be collected.Recommended Mitigation Steps
Generally, it's recommended to first do all multiplications before doing the divisions to not lose precision due to integer divisions.
The text was updated successfully, but these errors were encountered: