Some major tokens went live before ERC20 was finalized, resulting in a discrepancy whether the transfer functions should (A) return a boolean or (B) revert/fail on error. The current best practice is that they should revert, but return “true” on success. However, not every token claiming ERC20-compatibility is doing this — some only return true/false; some revert, but do not return anything on success.
This protocol doesn't use SafeERC20 transfer wrapper, could potentially cause issue when interacting with non standard ERC20.
depositCollateral
and _redeemCollateral
not use ERC20 safeTransfer wrapper :
https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/main/src/DSCEngine.sol#L282-L291
https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/main/src/DSCEngine.sol#L149-L161
This can cause issue for some token that doesn't support standard ERC20, potentially lock the token on the contract.
Manual review
Use OpenZeppelin’s SafeERC20
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.