DeFiFoundry
20,000 USDC
View results
Submission Details
Severity: high
Invalid

Unchecked Token Transfer in Auction Creation

Vulnerability Details:

The createAuction function assumes that the ERC20 token transfer will always succeed. However, some tokens (like USDT) can fail silently, potentially leading to auctions created without the correct token amount transferred.

Impact:

This could result in auctions being created without the specified token amount, leading to discrepancies between the expected and actual token amounts in the auction contract.

Proof of Concept:

Link to code

IERC20(auctionToken).transferFrom(msg.sender, auctionAddress, totalTokens);

This line assumes the transfer will always succeed, but it may fail silently for some tokens.

Tools Used:

Recommendations:

  1. Use SafeERC20 for token transfers:

    import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
    contract FjordAuctionFactory {
    using SafeERC20 for IERC20;
    function createAuction(...) external onlyOwner {
    // ...
    IERC20(auctionToken).safeTransferFrom(msg.sender, auctionAddress, totalTokens);
    }
    }
  2. Alternatively, check the return value of transferFrom and revert if it's false.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

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