Description:
When converting the collateral from USD to EUR, the decimal for the minted Kitty Coin
is fixed at 18, but the collateral decimal is not taken into account, which may not be 18, such as 8 for WBTC.
As a result, there is a huge error in the calculation of getUserVaultMeowllateralInEuros
and getTotalMeowllateralInAave
function, resulting in funds loss for users.
The getUserVaultMeowllateralInEuros
function:
The getTotalMeowllateralInAave
function:
Impact:
The decimal of the collateral is not taken into account, which can result in a miscalculation of the result and a huge loss for the user. For example the getUserVaultMeowllateralInEuros
function undervalues WBTC, and users who deposit 1WBTC but cannot borrow any KittyCoin
stable coin.
**Tools Used
Manual Review
Recommended Mitigation:
Taken into account the collateral decimals, provide a correct implementation of getUserVaultMeowllateralInEuros
and getTotalMeowllateralInAave
by not hardcoding it.
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.