In the StakingPool::_updateStrategyRewards function, there is a potential issue of precision loss during the calculation of fees based on rewards and shares. The fee amounts are calculated by multiplying the rewards with a basis point value, which can lead to loss of precision, particularly when dealing with large amounts or significant scaling of token values. Although this issue may not severely affect normal operations, it can result in minor discrepancies in share minting.
The issue arises when rewards are distributed to strategies and fee amounts are calculated. Specifically, the multiplication and division operations, such as:
and the minting of shares:
can cause precision loss due to Solidity's integer math operations. Since Solidity does not handle floating-point arithmetic, any fractional values from the division are truncated, resulting in slightly inaccurate fee amounts and shares calculations.
The precision loss could lead to:
Potential under-allocation or over-allocation of shares.
Discrepancies in the total fee amounts and rewards calculated across strategies.
Implemente a more precise reward distribution mechanism that minimizes rounding errors could improve the overall accuracy.
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.