First Flight #21: KittyFi

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

The user is not able to withdraw the full amount of collateral

Summary / Vulnerability Details

After depositing via DepawsitMeowllateral, the user is not able to withdraw the same amount again.

Impact

It makes the user to lose the funds

Tools Used

Manual

POC

uint256 toDeposit = 5 ether;
vm.startPrank(user);
IERC20(weth).approve(address(wethVault), toDeposit);
kittyPool.depawsitMeowllateral(weth, toDeposit);
vm.stopPrank();
// now user wants to withdraw
uint256 toWithdraw = 5 ether;
vm.startPrank(user);
kittyPool.whiskdrawMeowllateral(weth, toWithdraw);
vm.stopPrank();
assertEq(wethVault.totalMeowllateralInVault(), toDeposit - toWithdraw);
assertEq(wethVault.totalCattyNip(), toDeposit - toWithdraw);
assertEq(wethVault.userToCattyNip(user), toDeposit - toWithdraw);
assertEq(IERC20(weth).balanceOf(address(wethVault)), toDeposit - toWithdraw);
assertEq(IERC20(weth).balanceOf(user), AMOUNT - toDeposit + toWithdraw);

Recommendations

Ensure the amount can withdraw properly

Updates

Lead Judging Commences

shikhar229169 Lead Judge
about 1 year ago
shikhar229169 Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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