Stratax Contracts

First Flight #57
Beginner FriendlyDeFi
100 EXP
Submission Details
Impact: medium
Likelihood: medium

Return Value of `aavePool.repay` Ignored, Potentially Miscomputing Withdrawn Collateral

Author Revealed upon completion

Return Value of aavePool.repay Ignored, Potentially Miscomputing Withdrawn Collateral

Description:
repay() returns the actual amount repaid, but the contract ignores this value and assumes _amount was fully repaid when computing collateral withdrawal.

Impact:
If the repaid amount is lower than _amount, the contract may attempt to withdraw more collateral than allowed, causing reverts or incorrect accounting.

Recommended Mitigation:

- aavePool.repay(_asset, _amount, 2, address(this));
+ uint256 repaid = aavePool.repay(_asset, _amount, 2, address(this));
+ require(repaid == _amount, "Partial repay");

Support

FAQs

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

Give us feedback!