sherlock-audit / 2023-02-fair-funding-judging

1 stars 0 forks source link

DevABDee - [M-01] Users should be allowed to bid equal to the Bid-Increment (Prev Highest Bid + increment) #66

Closed github-actions[bot] closed 1 year ago

github-actions[bot] commented 1 year ago

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-Increment

assert _amount > self.highest_bid * (100 + MIN_INCREMENT_PCT) / 100 , "bid not high enough" 

Assume:

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)

- 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" 
Unstoppable-DeFi commented 1 year ago

Of by one is correct although the unit is WEI, not WETH.

Unstoppable-DeFi commented 1 year ago

https://github.com/Unstoppable-DeFi/fair-funding/pull/4

hrishibhat commented 1 year ago

This issue can be considered informational,