The FjordAuction
contracts are deployed from the FjordAuctionFactory
contract via the createAuction
function here: https://github.com/Cyfrin/2024-08-fjord/blob/0312fa9dca29fa7ed9fc432fdcd05545b736575d/src/FjordAuctionFactory.sol#L52-L66
Then the auction creater transfers the auction tokens to the new auction contract as seen below in the function.
The FjordAuction
contract is initialized as ```
as seen here: https://github.com/Cyfrin/2024-08-fjord/blob/0312fa9dca29fa7ed9fc432fdcd05545b736575d/src/FjordAuction.sol#L134
Interestingly, the FjordAuction
contract sets the msg.sender
as the owner
as `
This effectively ensures that the FjordAuctionFactory
contract is the owner
of the newly deployed auction contracts.
Now, in the event an auction ends and auctionEnd
function is called and there is no bids in the auction such that totalBids == 0
then the auction tokens initialized in the auction contract is sent to the owner
address which is the FjordAuctionFactory
contract as seen here: https://github.com/Cyfrin/2024-08-fjord/blob/0312fa9dca29fa7ed9fc432fdcd05545b736575d/src/FjordAuction.sol#L193
The FjordAuctionFactory
contract on the other hand has no mechanism to withdraw any tokens sent to it. This effectively locks these auction tokens sent to the factory contract forever.
In auctions where zero bids are submitted, the auction tokens will be locked in the factory contract with no mechanism to withdraw it.
Consider implementing a withdraw mechanism in the Factory contract to withdraw tokens.
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.