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

DSCEngine may not work with tokens that are not fully compliant to the ERC-20 specification

Summary

The smart contract fails to account for some ERC20 tokens that do not follow the standard's recommended return pattern, particularly in the transferFrom method. Tokens like USDT which do not return a boolean value can lead to transaction reversion.

Vulnerability Details

In DSCEngine.sol:157, the transferFrom method is expected to return a boolean value to indicate the success or failure of the transfer. However, some tokens like USDT, are not fully compliant with the ERC20 standard and do not return this boolean value. This lack of return causes the success variable to remain false even if the transfer is successful, which consequently leads to the transaction being reverted.

Impact

If a user attempts to use a non-standard ERC20 token, specifically one that does not return boolean values in transferFrom method, this issue will cause the transaction to fail, resulting in users not being able to call depositCollateral.

Tools Used

Manual Review

Recommendations

Implement the SafeERC20 library from OpenZeppelin.

Support

FAQs

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