The contract README clearly states that auctions will last for 3 days. However, the BidBeastMarketPlace contract does not implement a 3-day limit anywhere.
When an NFT is first listed, auctionEnd is set to zero, which is acceptable. However, when the first bid is placed, the NFT listing should update the auctionEnd date to block.timestamp + 3 days.
On the first bid, this should be set, and then on every successful bid, the contract should compare the current time with the auctionEnd time. If block.timestamp < auctionEnd, the person can bid; otherwise, it should revert with "auction ended".
Instead, the current code just increases the auction end time by S_AUCTION_EXTENSION_DURATION which is only 15 minutes, making no sense in the context of a 3-day auction period.
The first bidder can place a bid equal to the minPrice, and the protocol sets the auction end time to listing.auctionEnd + S_AUCTION_EXTENSION_DURATION (only +15 minutes, not 3 days).
After just 15 minutes, this user can call the settleAuction function. Since the auction has ended (after only 15 minutes), all conditions will be met and they will get the NFT at the minimum price.
There would be no competition. If other users want to bid, they cannot because the auction duration was only 15 minutes and not 3 days.
This is where the contract sets listing.auctionEnd = listing.auctionEnd + S_AUCTION_EXTENSION_DURATION when the first bid is done.
The test below demonstrates that user1 can bid on the NFT, but if after only 1 day another bidder tries to bid, they won't be able to because the auction has ended in 15 minutes only, not 3 days:
Create an immutable variable with value = 3 days:
On the first bid only, set
On subsequent bids, simply check:
Remove the current logic that increases the auctionEnd by 15 minutes on every bid:
Documentation for BidBeasts Marketplace is incomplete or inaccurate, potentially leading to misconfigurations or security misunderstandings.
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.