MyCut

First Flight #23
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: medium
Invalid

Unhandled return values of transfer and transferFrom

Impact

ERC20 implementations are not always consistent. Some implementations of transfer and transferFrom could return ‘false’ on failure instead of reverting. It is safer to wrap such calls into require() statements or use safe wrapper functions implementing return value/data checks to handle these failures. For reference, see similar Medium-severity finding from Consensys Diligence Audit of Aave Protocol V2: https://consensys.net/diligence/audits/2020/09/aave-protocol-v2/#unhandled-return-values-of-transfer-and-transferfrom

Proof of Concept

Pot.sol:55@> i_token.transfer(msg.sender, managerCut);
Pot.sol:65@> i_token.transfer(player, reward);
ContestManager.sol:37@> token.transferFrom(msg.sender, address(pot), totalRewards);

Tools Used

Manual Analysis

Recommendation

Check the return value and revert on 0/false or use safeERC20 library.

Updates

Lead Judging Commences

equious Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

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