'getTotalMeowllateralInAave' function of the KittyVault
contract calls the 'getUserAccountData' of the Aave pool contract. It returns the total collateral of the vault held by the Aave protocol, including the interest earned from the supply. The value retrieved is in ETH.
The getTotalMeowllateralInAave
calculates the value Aave holds in terms of token by dividing the total value in ETH returned by getUserAccountData
, with the value of 1 token in USD. This results in incorrect valuation of the collateral held in Aave in terms of tokens.
The getTotalMeowllateralInAave
function correctly retrieves the total collateral value in ETH from the Aave protocol using getUserAccountData, but then incorrectly calculates the token-denominated value by dividing the ETH value by the price of 1 token in USD.
The calculated total collateral value held in the Aave protocol in terms of tokens will be inaccurate, leading to incorrect accounting, risk management, or other business logic that relies on this value.
VS code
Get the priceFeed address of the ETH / USD and then convert the value retrieved in ETH to USD . Followed by that, divide the total value in USD / 1 token value in USD. This returns the correct value of tokens held in Aave.
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.