15,000 USDC
View results
Submission Details
Severity: medium

Missing Check for Self-Transfer Allows Funds to be Lost

Summary

See Details

Vulnerability Details

The vulnerability in the code stems from the absence of a check to prevent self-transfers.
This oversight allows the transfer function to erroneously transfer funds to the same address.
This vulnerability undermines the correctness of fund transfers within the contract and poses a risk
to the integrity of user balances.

bool success = IERC20(tokenCollateralAddress).transfer(to, amountCollateral);

Impact

Funds are lost as the code fails to deduct the transferred amount from the sender's balance.

Tools Used

Manual code review

Recommendations

Add condition to prevent transfer between same addresses. Reference

Support

FAQs

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