Pieces Protocol

First Flight #32
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: medium
Invalid

Not Checking if the receiver handles transferring of ERC20 tokens, transfer()

Summary

The Contract contains the famous ERC20 transfer() and transferFrom() , which risks the loss of funds of contract accounts that do not handle ERC20 tokens.

Vulnerability Details

Contracts that are not aware that they will receive ERC-20 tokens will result in a loss of those tokens sent. The transfer() and transferFrom() methods exists in src/TokenDivider.sol :

148 --> bool transferSuccess = IERC20(erc20).transfer(msg.sender, amount);
326 --> IERC20(order.erc20Address).transfer(msg.sender, order.amount);

Impact

The user will loose their tokens permanently and they will be lost for ever.

Tools Used

Manual inspection.

Recommended Mitigation

  • Use pull pattern instead of push, i.e. make the user withdraw his funds by himself.

  • Use a different EIP.

Updates

Lead Judging Commences

fishy Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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