Calls to ERC20::transfer method should always be checked.
Some ERC20 tokens do not revert on failure in transfer
but instead return false
as a return value (for example ZRX). Because of this it has become a common practice to use OpenZeppelin's SafeERC20 to handle such weird tokens. If transfer
fails, but does not revert it can leave tokens stuck in the contract. For example, function LiduidationPool#claimRewards()
using non-checked transfer
, but if it failed the tokens would get stuck, before its mapping is already deleted:
if (_rewardAmount > 0) {
delete rewards[abi.encodePacked(msg.sender, _token.symbol)]; // <----
Potentially permanently lost (stuck) value for users of the protocol.
Manual review
Using SafeTransfer from OpenZeppelin's SafeERC20 library to handle such tokens
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.