The function KittyVault::getUserVaultMeowllateralInEuros
returns an incorrect value for the user's collateral in euros due to errors in the calculation involving price feeds and precision handling.
The function getUserVaultMeowllateralInEuros
is responsible for converting a user's collateral value from its native currency to euros. However, the calculation incorrectly handles the precision of the price feed data, leading to an inaccurate euro value for the user's collateral.
The problematic code is as follows:
Add the following to KittyFiTest.t.sol
test file:
Incorrect Financial Calculations: The incorrect collateral value in euros could lead to erroneous financial decisions, affecting the accuracy of transactions, risk assessments, and liquidation processes.
Potential Under/Overestimation: Users may either be under-credited or over-credited for their collateral, leading to imbalances in the system and possible financial losses.
Manual review
Foundry (Testing Framework)
Correct Precision Handling: Adjust the calculation to properly handle the precision of price feed values, ensuring accurate conversion from the user's native collateral to euros
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.