Pieces Protocol

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

Unchecked Return Values

Summary

TokenDivider:: transferErcTokens Unchecked Return Values

Vulnerability Details

return values of the IERC20 functions transferFrom and transfer are ignored.ERC20's transfer and transferFrom functions return a boolean indicating success. Ignoring the return value can lead to missed error handling if the transfer fails.

Impact

This could leave the contract or user funds in an inconsistent state.And this make a conflict with docs.
/**
*
* @param nftAddress The nft address pegged to the erc20
* @param to The reciver of the erc20
* @param amount The amount of erc20 to transfer
*
* @dev you can use this function to transfer nft franctions 100% securily and registered by te contract
*/

Tools Used

Slither

Recommendations

Check the return value of these functions and handle any failure cases

+ require(IERC20(tokenInfo.erc20Address).transferFrom(msg.sender, to, amount), "Transfer failed");
Updates

Lead Judging Commences

fishy Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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