Pieces Protocol

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

Wrong order of the event TokensTransfered in transferErcTokens function

Summary

The function is reposnible for the transfer of ERC20 tokens associated with a specific NFT (non-fungible token) address.

Vulnerability Details

In the function is wrong order of the event. The event TokensTransferedis before transferFromfunction.

emit TokensTransfered(amount, tokenInfo.erc20Address);
IERC20(tokenInfo.erc20Address).transferFrom(msg.sender,to, amount);

Impact

It might lead to a situation where the event log indicates that a transfer has occurred, even though it may have failed. This can result in misleading records about the state of the contract.

Tools Used

manual review

Recommendations

Please change order

IERC20(tokenInfo.erc20Address).transferFrom(msg.sender,to, amount);
emit TokensTransfered(amount, tokenInfo.erc20Address);
Updates

Lead Judging Commences

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

Support

FAQs

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