The Auction contract fails to properly end when all tokens are sold (totalRemaining = 0). According to the documentation, the auction should conclude in one of two ways:
When all ZENO tokens are purchased
When the auction reaches its predetermined end time
However, the current implementation only checks for the end time in checkAuctionEnded() and does not update the auction state when all tokens are sold.
This issue leads to several incorrect behaviors:
getPrice() continues to calculate and return a linearly decreasing price even though no tokens are available for purchase
checkAuctionEnded() incorrectly reports the auction as still active
Users may be misled about the auction status and current token price
While the buy() function prevents purchasing when totalRemaining = 0, the incorrect auction state could cause confusion and potentially impact integrating protocols that rely on accurate auction status information.
Update the buy() function to end the auction immediately when all tokens are sold:
Also, update getPrice() to explicitly handle the case when all tokens are sold:
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.