Loss of Tokens Backed from Auction When No Bids Are Received
In the FjordAuction contract, the owner is set to msg.sender during initialization. However, msg.sender in this context is the FjordAuctionFactory contract , which does not have a mechanism to handle the return of tokens if no bids are placed.
here we deploy and create an auction through create2 opcode, and setting msg.sender which equal to FjordAuctionFactory to the owner of Auction contract.
Here, totalTokens are transferred back to the owner if totalBids is zero. Since owner is the FjordAuctionFactory, and the FjordAuctionFactory does not have a function to manage the returned tokens properly, this results in a loss of tokens.
Tokens backed by the auction are lost if no bids are received. The tokens are transferred to FjordAuctionFactory that does not have a proper function to handle or manage them, leading to potential loss of funds.
Manual code review
To mitigate this issue, the FjordAuctionFactory contract should include a function to handle tokens returned from the auction. Here is a recommended function to be added to the FjordAuctionFactory.sol:
An auction with 0 bids will get the `totalTokens` stuck inside the contract. Impact: High - Tokens are forever lost Likelihood - Low - Super small chances of happening, but not impossible
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.