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.
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.
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
.
Manual Review
Implement the SafeERC20 library from OpenZeppelin.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.