The FjordAuction contract attempts to transfer auction tokens that it does not possess.
In a case where there are no bids, and the owner or anyone else calls auctionEnd
, the auctionToken.transfer(owner, totalTokens)
line is executed.
In the context of the transfer
function, msg.sender
is the FjordAuction contract address. Here's Solmate ERC20 transfer function:
Note that the transfer function in use is that of the Solmate library because the tokens are minted using the Solmate's library.
Openzeppelin's ERC20 interface was only used in the Fjordauction contract.
Now the transfer
function attempts to deduct totalTokens
from the balance of the FjordAuction contract.
balanceOf[msg.sender] -= amount;
Then it adds totalTokens
to the owner's balance.
This is a bug and here's why:
The FjordAuction contract is attempting to transfer tokens that it doesn't own. No tokens were deposited into the contract initially.
Since the FjordAuction contract doesn't have any balance of auction tokens, the transfer will fail.
This same issue arise in the claimTokens function:
Here's the buggy line:
auctionToken.transfer(msg.sender, claimable);
Where there were bids and end auction function called successfully, when it's time for users to claim tokens and claimTokens() is called, the function would revert. This is because the Fjordauction contract has no token balance.
The transfer would fail making it impossible to end the auction.
It would be impossible for users to claim their tokens.
Manual review
The auction contract should be designed to hold the auction tokens from the start.
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.