Omniscia Colony Lab Audit

RewardingStaking Static Analysis Findings

RewardingStaking Static Analysis Findings

RSG-01S: Inexplicable Loss of Precision

Description:

The linked statement can cause a significant loss of precision as the 1e18 offset is applied after the division.

Example:

contracts/StakingV2/RewardingStaking.sol
150return (reward + leftover) / rewardsDuration * 1e18;

Recommendation:

We advise the multiplication to be performed first to ensure the maximum degree of accuracy in the operations.

Alleviation:

The contract's logic was relocated to the StakingV2.sol file and the recommended precision adjustment was properly alleviated.