First Flight #21: KittyFi

First Flight #21
Beginner FriendlyDeFiFoundry
100 EXP
View results
Submission Details
Severity: medium
Invalid

Inaccurate Collateral Check Due to Token Transfers

Summary

The _hasEnoughMeowllateral function relies on a mapping (kittyCoinMeownted) to check if a user has sufficient collateral. However, this mapping does not reflect transfers of KittyCoin tokens to other addresses, potentially leading to incorrect collateral assessments.

Vulnerability Details

The _hasEnoughMeowllateral function calculates whether a user has enough collateral by comparing the total collateral in euros with the required collateral, which is derived from the kittyCoinMeownted mapping. This mapping tracks the amount of KittyCoin tokens minted but does not account the actual balanceOf value. As a result, the function might assess collateral based on outdated or incorrect information, leading to inaccurate checks.

Impact

Incorrect collateral checks could lead to over-collateralization or under-collateralization, exposing the contract to potential financial risks and attacks.

Tools Used

Manual Code Review

Recommendations

Update the kittyCoinMeownted mapping to reflect changes in user token balances. Implement additional logic to ensure it accurately reflects the user's true token holdings and calculate collateral requirements accordingly.

Updates

Lead Judging Commences

shikhar229169 Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.