KittyVault::getUserVaultMeowllateralInEuros
Calculates the Price IncorrectlyThe getUserVaultMeowllateralInEuros
function is designed to convert a user's collateral from dollars to euros. However, the calculation is flawed because it multiplies the dollar-denominated collateral value by the Euro to USD exchange rate, rather than dividing these two values.
The getUserVaultMeowllateralInEuros
function performs the incorrect calculation as follows:
The current calculation is:
However, the correct calculation should be:
This error affects the calculation of a user's health status, which is crucial for determining whether liquidation is necessary. Since the calculation results in a value that is always positive, users may remain liquidated longer than intended, posing a risk to the overall stability of the system.
Manual Review
Correct the calculation in the getUserVaultMeowllateralInEuros
function to accurately reflect the conversion from dollars to euros:
This correction ensures that the user's collateral is accurately converted from dollars to euros, allowing for accurate assessments of their health status and timely liquidation decisions.
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.