The auction contract's logic unintentionally transfers auctionToken
back to the factory contract when no bids are placed during an auction. This is because the auctionEnd()
function transfers auctionToken
to the auction contract's owner, which is the factory contract. However, there is no function in the factory contract to retrieve these tokens, which creates a locked token scenario.
In the event that no bids are placed in the auction, the following code executes within the auctionEnd()
function of the FjordAuction
contract:
Here, the auctionToken
is transferred back to the owner
of the auction, which is the factory contract (AuctionFactory
). This scenario arises because:
When the auction is created using the AuctionFactory
, the factory contract becomes the owner of the auction contract, as demonstrated in the constructor of the FjordAuction
contract:
During the auction creation process in the AuctionFactory
, the following code transfers the auctionToken
to the newly deployed auction contract:
However, if no bids are placed, the auctionEnd()
function will return the tokens to the factory contract. The problem is that there is no function in the AuctionFactory
contract that allows the retrieval of these tokens. This effectively results in the tokens being locked within the factory contract.
When this issue occurs, the auction tokens could be permanently locked in the factory contract, rendering them inaccessible. This results in a loss of auction tokens for the project, especially if the tokens represent valuable assets.
Manual review.
Implement a method in the AuctionFactory
contract that allows the owner to recover the auction tokens in case they are returned due to no bids being placed. This could be done by adding a simple withdrawTokens()
function:
Or another solution can be to allow the original auction creator (or another authorized address) to be the owner of the auction contract, instead of defaulting to the factory contract. This could avoid scenarios where tokens get locked in contracts unintentionally.
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.