Skip to content

Commit

Permalink
remove first bid time (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgeary authored Oct 11, 2023
1 parent a992efd commit 3cca98f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/PixieChessAuctionMinter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ contract PixieChessAuctionMinter is AccessControl {
uint32 duration;
uint32 startTime;
address highestBidder;
uint32 firstBidTime;
}

address public tokenAddress;
Expand Down Expand Up @@ -60,8 +59,7 @@ contract PixieChessAuctionMinter is AccessControl {
highestBid: 0,
highestBidder: address(0),
duration: duration,
startTime: startTime,
firstBidTime: 0
startTime: startTime
});

emit AuctionCreated(auctionId, tokenId, reservePrice, duration, startTime);
Expand Down Expand Up @@ -98,9 +96,8 @@ contract PixieChessAuctionMinter is AccessControl {
revert("Auction: Auction already ended");
}

if (auction.firstBidTime == 0) {
if (auction.highestBid == 0) {
require(msg.value >= auction.reservePrice, "Auction: Bid must meet reserve");
auction.firstBidTime = uint32(block.timestamp);
} else {
uint256 minBidIncrement = (auction.highestBid * MIN_BID_INCREMENT_PERCENTAGE) / 100;
require(msg.value >= auction.highestBid + minBidIncrement, "Auction: Bid increase too small");
Expand Down

0 comments on commit 3cca98f

Please sign in to comment.