Closed github-actions[bot] closed 1 year ago
DevABDee
medium
AuctionHouse.bid() doesn't allow bidders to bid equal to the Bid-Increment (Prev Highest Bid + increment)
This check in the AuctionHouse.bid() function, will not gonna allow users to bid equal to the Bid-Increment
AuctionHouse.bid()
assert _amount > self.highest_bid * (100 + MIN_INCREMENT_PCT) / 100 , "bid not high enough"
Assume:
highest_bid
100
self.highest_bid * (100 + MIN_INCREMENT_PCT) / 100
102
103
https://github.com/sherlock-audit/2023-02-fair-funding/blob/main/fair-funding/contracts/AuctionHouse.vy#L151 OR https://github.com/sherlock-audit/2023-02-fair-funding/blob/main/fair-funding/contracts/AuctionHouse.vy#L151
Manual Review
Use >= to make sure that users are allowed to bid equal to the Bid-Increment (Prev Highest Bid + increment)
>=
- assert _amount > self.highest_bid * (100 + MIN_INCREMENT_PCT) / 100 , "bid not high enough" + assert _amount >= self.highest_bid * (100 + MIN_INCREMENT_PCT) / 100 , "bid not high enough"
Of by one is correct although the unit is WEI, not WETH.
https://github.com/Unstoppable-DeFi/fair-funding/pull/4
This issue can be considered informational,
DevABDee
medium
[M-01] Users should be allowed to bid equal to the Bid-Increment (Prev Highest Bid + increment)
Summary
AuctionHouse.bid() doesn't allow bidders to bid equal to the Bid-Increment (Prev Highest Bid + increment)
Vulnerability Detail
This check in the
AuctionHouse.bid()
function, will not gonna allow users to bid equal to the Bid-IncrementAssume:
highest_bid
=100
Tokens.self.highest_bid * (100 + MIN_INCREMENT_PCT) / 100
, the least the next user can bid will be102
102
Tokens, the function will reject their offer. Instead, they must bid at least103
Tokens.Impact
Code Snippet
https://github.com/sherlock-audit/2023-02-fair-funding/blob/main/fair-funding/contracts/AuctionHouse.vy#L151 OR https://github.com/sherlock-audit/2023-02-fair-funding/blob/main/fair-funding/contracts/AuctionHouse.vy#L151
Tool used
Manual Review
Recommendation
Use
>=
to make sure that users are allowed to bid equal to the Bid-Increment (Prev Highest Bid + increment)