MyCut

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

Missing validation if transfer failed.

Summary

The transfer logic assumes that it will never face failure when transfering.

Vulnerability Details

The method Pot::_transferReward is responsible for sending rewards to claimants. However, it does not check if the transfer was successful.
The documentation does not specify which exact ERC20 tokens will be used, so this leads to the opportunity of using tokens that do not revert in case of failure and return false.

Impact

Funds could remain locked, uncertainness of the funds transfer status

Tools Used

Manual Review, Slither

Recommendations

Consider one of the following approaches

  • Validate the returned result:

- i_token.transfer(player, reward);
+ bool success = i_token.transfer(player, reward);
+ require(success, "Transfer failed");
  • Track which transfer failed and for those users who for some reason cannot receive reward, let the manager take their price instead to void funds lock.

Updates

Lead Judging Commences

equious Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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