DeFiFoundrySolidity
16,653 OP
View results
Submission Details
Severity: low
Invalid

No Check For Transfer Failure After Swap

Summary

After performing the swap, the function does not explicitly check that the transfer tokens (alETH) were received by the contract

Vulnerability Details

This can possibly be an issue if the swap was successful, for some reasons, (e.g. Insufficient liquidity in the pool, improper path configuration e.t.c.) the tokens were not properly transferred to the contract's balance.

Impact

Financial risk:
If transfer fails and the function does not validate the contract's balance, the strategy may proceed as if the the swap was successful potentially causing

  • Loss of tokens intended for the swap.

  • Incorrect accounting for assets in the strategy

Tools Used

Unit testing

Recommendations

Explicitly check the contract's balance after the swap to ensure it received the correct amount of alETH

uint256 balanceAfter = underlying.balanceOf(address(this));
require(balanceAfter >= underlyingBalance, "Swap failed to transfer tokens");
Updates

Appeal created

inallhonesty Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
inallhonesty Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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