NFT Dealers

First Flight #58
Beginner FriendlyFoundry
100 EXP
Submission Details
Impact: low
Likelihood: low

Raw `transferFrom` Calls Are Used Instead Of `SafeERC20`

Author Revealed upon completion

Raw transferFrom Calls Are Used Instead Of SafeERC20

Description

The contract calls usdc.transferFrom(...) directly in mintNft() and buy() and manually checks the return value. This is less robust than using SafeERC20.safeTransferFrom, since some ERC20 implementations do not return values consistently.

require(usdc.transferFrom(msg.sender, address(this), lockAmount), "USDC transfer failed");
bool success = usdc.transferFrom(msg.sender, address(this), listing.price);
require(success, "USDC transfer failed");

Risk

Likelihood:

  • The issue appears whenever the contract interacts with a token that does not strictly follow the standard ERC20 return-value behavior.

Impact:

  • Token transfers may behave unexpectedly or fail to integrate cleanly with non-standard ERC20 implementations.

Proof of Concept

The issue is visible directly in mintNft() and buy(), where raw transferFrom calls are used instead of SafeERC20.safeTransferFrom.

Recommended Mitigation

Use SafeERC20.safeTransferFrom consistently for inbound token transfers.

-require(usdc.transferFrom(msg.sender, address(this), lockAmount), "USDC transfer failed");
+usdc.safeTransferFrom(msg.sender, address(this), lockAmount);
-bool success = usdc.transferFrom(msg.sender, address(this), listing.price);
-require(success, "USDC transfer failed");
+usdc.safeTransferFrom(msg.sender, address(this), listing.price);

Support

FAQs

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

Give us feedback!