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

Incorrect Handling of Zero Bids in FjordAuction::claimTokens()

Summary

https://github.com/Cyfrin/2024-08-fjord/blob/main/src/FjordAuction.sol

If no bids are placed during the auction (totalBids == 0), the auctionEnd() function transfers all auction tokens to the owner. However, the claimTokens() function can still be called by users, which could lead to failed transactions or confusion as there are no tokens to claim

Impact

User Confusion: Users may attempt to claim tokens even though no bids were placed, leading to failed transactions.

  • Poor User Experience: Unnecessary interactions could frustrate users.

Tools Used

Manual Review

Recommendations

Add a check in the claimTokens() function to ensure it cannot be called if there are no bids.

function claimTokens() external {
require(totalBids > 0, "No bids placed in the auction");
// Existing code
}
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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