Pieces Protocol

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

Unhandled ERC20 Transfer Failures: Potential Loss of Funds in TokenDivider Contract

Summary

In TokenDivider, there are token transfer function in transferErcTokens(),sellErc20()and buyOrder(), it does not check the return value.

Vulnerability Details

IERC20.transferFrom()has return value to check if the transfer is failed. However, it does not apply in transferErcTokens(), sellErc20()and buyOrder(). Some tokens (e.g., USDT) return false instead of reverting on failure. Contract logic might continue as if the transfer succeeded, leading to unintended behavior.

Impact

Potential unauthorized token transfers

Tools Used

Manual Review

Recommendations

Use SafeERC20 from Openzepplin , or ensure that the transfer/transferFrom return value is checked.

Updates

Lead Judging Commences

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

Support

FAQs

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