The buyNow logic of placeBid function finalizes the NFT transfer and disables listing, but it does not update the auctionEnd timestamp. This creates a mismatch between the auction’s actual status (ended) and the auctionEnd value. Such inconsistent state can confuse off-chain indexers, marketplaces, and analytics that rely on accurate auction timing data.
The normal behavior in auction systems is to maintain consistent state values for all auction properties when the auction status changes, including setting appropriate end times.
The specific issue is that when a user executes the "Buy Now" option in the placeBid function, the listing.listed status is updated to false, but the listing.auctionEnd value is never updated, leaving it in an inconsistent state.
Likelihood: Medium
This issue occurs in every instance where the Buy Now option is used, which is a core feature of the marketplace.
*The inconsistency is systematic and will happen consistently with normal usage.
Impact: Low
The contract state becomes inconsistent, with listing.listed = false (indicating auction is over) but auctionEnd potentially remaining at 0 or a future timestamp.
Off-chain systems or analytics tools querying the auction end time might receive confusing or incorrect information.
No direct financial loss occurs, but it creates potential logical inconsistencies in the contract's state representation.
This demonstrates that:
When a listing is created, auctionEnd is set to 0
After a Buy Now purchase, the listed status is updated to false
However, the auctionEnd value remains at 0, creating an inconsistent state
This inconsistency could confuse systems that rely on both values to determine auction status
This simple change:
State Consistency: Ensures all auction state variables are updated properly when an auction ends via Buy Now.
Accurate Timing Information: Sets the auction end time to the actual time the auction ended, which is useful for historical data and analytics.
Reliable Querying: Makes sure that both listed and auctionEnd values consistently reflect the ended state of the auction.
Clear Data Model: Maintains a clear and consistent data model where "not listed" auctions always have a non-zero, past timestamp in auctionEnd.
By making this change, the contract state will be more consistent and reliable, especially for off-chain systems that may rely on the auctionEnd value for analytics or displaying auction status to users.
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.