First Flight #21: KittyFi

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

Return value of `Withdraw()` is not checked.

Description:

Inside of the KittyVault::purrrCollateralFromAave a i_aavePool.withdraw() performs a call to the aave pool to send the user's collateral back to the Vault. But it does not check the return value if the call suceeded.

function purrrCollateralFromAave(uint256 _ameowntToWhiskdraw) external onlyMeowntainer {
totalMeowllateralInVault += _ameowntToWhiskdraw;
@> i_aavePool.withdraw( { asset: i_token, amount: _ameowntToWhiskdraw, to: address(this) } );
}

Impact:

If the call fails, the collateral didnt manage to get back to the specified vault, and users may end up losing their collateral.

Tools Used:

Manual Review.

Recommended Mitigation:

Revert the entire call if the withdraw call fails by checking that the success return value of the i_aavePool.withdraw() returns true.

function purrrCollateralFromAave(uint256 _ameowntToWhiskdraw) external onlyMeowntainer {
totalMeowllateralInVault += _ameowntToWhiskdraw;
- i_aavePool.withdraw( { asset: i_token, amount: _ameowntToWhiskdraw, to: address(this) } );
+ (bool success,) = i_aavePool.withdraw( { asset: i_token, amount: _ameowntToWhiskdraw, to: address(this) } );
}
+ if(!success){
+ revert("Withdraw failed !")
+ }
Updates

Lead Judging Commences

shikhar229169 Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Appeal created

oxenzo Submitter
10 months ago
shikhar229169 Lead Judge
10 months ago
oxenzo Submitter
10 months ago
shikhar229169 Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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