Lack of Precision Check in increaseCollateral and decreaseCollateral Functions
The contract fails to verify whether the specified amount in the increaseCollateral and decreaseCollateral functions aligns with the precision limits of the underlying asset. This oversight may result in rounding discrepancies during the conversion of the amount to the asset's smallest unit for storage or computations.
It could potentially impact the accuracy of the contract's state and the balances of the users.
Manual
To resolve this issue, you should add a precision check in the increaseCollateral
and decreaseCollateral
functions. This check should ensure that the specified amount
aligns with the precision limits of the underlying asset.
Here is a sample implementation:
In this example, 1e18
is used as the precision for Ether. If the underlying asset has a different precision, you should replace 1e18
with the appropriate value. This will ensure that the amount
is always a multiple of the smallest unit of the asset, preventing any rounding discrepancies.
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.