Bid and Unbid function of FjordAuction.sol allows bidding and unbidding with an amount of 0, which may lead to DOS or gas wasting.
Function bid does not check if the bid amount is 0, this allows a user to bid and more importantly transferFrom with 0 amount. Calling transferFrom with an amount of 0 still incurs gas costs, even though no tokens are transferred.
Emitting the BidAdded event with an amount of 0 also consumes gas.
If a malicious user can thus call Bid many times with just amount 0 this would be costly and also might cause a DOS.
Same issue can be seen from here although it checks if userBids is equal to 0 it does not check if amount is 0. This means an attacker can bid a very small amount (miniumum bid) and then call unbid many times to cause a DOS or waste gas.
Medium
Source code review
Add a check to make sure cannot bid amount 0 and cannot unbid amount 0. if (amount == 0) {
revert InvalidBidAmount();
}
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.