https://github.com/Cyfrin/2024-08-fjord/blob/main/src/FjordAuctionFactory.sol#L58-L60
https://github.com/Cyfrin/2024-08-fjord/blob/main/src/FjordAuction.sol#L134
https://github.com/Cyfrin/2024-08-fjord/blob/main/src/FjordAuction.sol#L192-L193
In the FjordAuction
contract, the owner
is set as msg.sender
in the constructor, but when doing so, the owner
becomes the FjordAuctionFactory
itself instead of the transaction initiator. Since there is no way to withdraw tokens from the FjordAuctionFactory
, when there are no bids and tokens are sent to the owner
via auctionEnd
, the auction tokens become permanently stuck.
Below is the constructor of the FjordAuction
contract;
The sender of the call is actually the FjordAuctionFactory
contract and msg.sender
will be FjordAuctionFactory
, the Proof-Of-Concept below demonstrates this;
To run this test, a setUp
is also required, so you can copy it from this Gist and create a file under the test/unit directory to paste it.
If there is no bid or bids are unbid and totalBids
is now 0, all auction tokens will be stuck forever.
Foundry
Update the constructor as follows and you can give msg.sender
for the owner in the createAuction
function (that time the address who starts the tx from the factory will be the owner) or you can take it as a parameter in createAuction
and enter it manually.
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.