Auctions run for less time than intended causing them to be not economically efficient for the lenders, thus causing a suboptimal credit of liquidation funds to them.
Vulnerability Detail
From the documentation/comments, we can infer that firstBidTime is supposed to be // The time of the first bid and duration is supposed to be // The length of time to run the auction for, after the first bid was made.
However, when an auction is created in createAuction(), the auction's firstBidTime is incorrectly initialized as block.timestamp.safeCastTo64() instead of 0. This is premature initialization because the auction was only created here and no bid has been made yet via createBid(). The code in createBid() which check for firstBidTime == 0is more evidence that the initialization in createAuction() is incorrect.
Impact
This causes auctions to run for less time than intended if the first bid comes at a much later time after the auction was created. A shorter auction time could potentially allow fewer bids and cause it to be not economically efficient for the lenders, thus causing a suboptimal credit of liquidation funds to them.
0xRajeev
medium
Auctions run for less time than intended
Summary
Auctions run for less time than intended causing them to be not economically efficient for the lenders, thus causing a suboptimal credit of liquidation funds to them.
Vulnerability Detail
From the documentation/comments, we can infer that
firstBidTime
is supposed to be// The time of the first bid
and duration is supposed to be// The length of time to run the auction for, after the first bid was made.
However, when an auction is created in
createAuction()
, the auction'sfirstBidTime
is incorrectly initialized asblock.timestamp.safeCastTo64()
instead of0
. This is premature initialization because the auction was only created here and no bid has been made yet viacreateBid()
. The code increateBid()
which check forfirstBidTime == 0
is more evidence that the initialization increateAuction()
is incorrect.Impact
This causes auctions to run for less time than intended if the first bid comes at a much later time after the auction was created. A shorter auction time could potentially allow fewer bids and cause it to be not economically efficient for the lenders, thus causing a suboptimal credit of liquidation funds to them.
Code Snippet
Tool used
Manual Review
Recommendation
createAuction()
should initializefirstBidTime = 0
.