15,000 USDC
View results
Submission Details
Severity: medium
Valid

[M] Return values of transferFrom() not checked

Summary

Vulnerability Details

Not all IERC20 implementations revert() when there's a failure in transfer()/transferFrom().

Impact

Not all IERC20 implementations revert() when there's a failure in transfer()/transferFrom(). The function signature has a boolean return value and they indicate errors that way instead. By not checking the return value, operations that should have marked as failed, may potentially go through without actually making a payment.

function depositCollateral(address tokenCollateralAddress, uint256 amountCollateral) public
&
function _burnDsc(uint256 amountDscToBurn, address onBehalfOf, address dscFrom) private

Tools Used

Manual Review

Recommendations

The function should check the return value of the transferFrom function and revert the transaction with an appropriate error message if the transfer fails. I would suggest to use Open Zeppelins safeTransferFrom.

Support

FAQs

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