The FjordAuctionFactory
creates FjordAuction
contracts using the CREATE2 opcode. Users can bid FjordPoints
in these auctions to receive tokens proportional to their bids. If no bids are placed and the auction ends, the allocated tokens are returned to the owner of the FjordAuction
contract. The owner of the FjordAuction
is set in its constructor to msg.sender
, which makes the FjordAuctionFactory
the owner. However, the FjordAuctionFactory
lacks the functionality to withdraw these returned tokens, causing them to become permanently stuck in the contract.
The FjordAuctionFactory
contract allows its owner
to create new FjordAuction
contracts using the createAuction
function:
This function deploys a new FjordAuction
contract using CREATE2 and transfers totalTokens
from msg.sender
to the newly created auctionAddress
.
The FjordAuction contract includes an auctionEnd
function that can be called by anyone to finalize the auction. If no bids have been placed (totalBids == 0), this function transfers all auctionToken
tokens back to the owner
:
Since the owner of the FjordAuction
is set to msg.sender
in its constructor, the msg.sender
in this context will be the FjordAuctionFactory
contract:
However, the FjordAuctionFactory
does not have a mechanism to withdraw these returned tokens, leaving them permanently locked within the factory contract.
The lack of functionality in the FjordAuctionFactory
to withdraw ERC20 tokens results in any tokens returned from auctions where no bids are placed becoming permanently inaccessible. This effectively locks up potentially large amounts of arbitrary ERC20 tokens within the factory contract, which cannot be recovered or used again.
Manual Review
Add a withdrawReturnedTokens
function to enable the owner
of the FjordAuctionFactory
contract to recover ERC20 tokens that are returned from auctions with no bids. This function should allow the owner to transfer the tokens from the factory contract to their own address, making it possible to redistribute or use these tokens in future auctions.
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.