The AuctionFactory is designed to create FjordAuction contracts in a deterministic manner using the CREATE2 opcode, which allows the address of each FjordAuction to be known beforehand. Upon creation, auction tokens are sent directly to the FjordAuction contract. The key issue identified in this report arises when the AuctionFactory becomes the owner of the FjordAuction contract, creating a significant risk of token loss if the auction concludes without any bids. Specifically, if the auctionEnd function is called under these circumstances, all auction tokens are transferred to the AuctionFactory, which lacks functionality for recovering or managing these tokens, causing them to become permanently locked.
Auction Tokens and Ownership:
Upon creation, the FjordAuction contract is owned by the AuctionFactory, and auction tokens are sent to the FjordAuction for bidding.
Auction Ending Mechanism:
If an auction ends without receiving any bids, the auctionEnd function can be called, which transfers all remaining tokens to the contract owner—AuctionFactory.
Lack of Token Management in AuctionFactory:
The AuctionFactory does not implement any functionality to withdraw or transfer tokens it holds. This means that once tokens are transferred to the AuctionFactory, they cannot be retrieved, leading to a permanent loss.
Admin approves 1000 ether to AuctionFactory
Admin calls createAuction, which creates a new FjordAuction and sends 1000 ether of auction tokens to the newly created FjordAuction
AuctionFactory becomes the owner of the FjordAuction
Auction starts
Auction ends with no bids
Admin or anyone else calls auctionEnd
All auction tokens are sent to the owner of the FjordAuction which is the AuctionFactory
AuctionFactory does not have any function to withdraw or transfer auction tokens
Auction tokens are stuck in AuctionFactory
If the auction ends without any bids, the resulting transfer of tokens to the AuctionFactory could result in the permanent loss of those tokens, as the factory contract does not support any mechanism to withdraw or manage these tokens.
Manual Review
Implement a Token Recovery Mechanism
The AuctionFactory should be equipped with a function that allows the recovery of tokens. This function should be restricted to authorized entities to prevent misuse.
Adjust the Ownership Structure
Consider revising the ownership model so that the auction tokens are not automatically transferred to the AuctionFactory. The FjordAuction contract could include a feature to return tokens to the original owner if no bids are placed.
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.