The end
function contains an assertion that prevents the auction from being concluded if no bids have been placed. Specifically, the end
function includes the following line:
If no bids have been placed, the highest_bid
will remain at its initial value, which is equal to the starting_price
value set by the owner in the start
function. This will cause the assertion to fail, reverting the transaction. As a result, the auction owner will not be able to end the auction, leaving the NFT stuck in the contract without a means of recovery.
The inability to close the auction with no bids exposes the auction owner to significant risk, as the NFT could be permanently locked into the contract, potentially resulting in significant financial loss to the owner.
Manual Code Review, VSCode
To address this vulnerability, the following changes are recommended to the end
function:
This would allow the auction to be ended even if no bids have been placed.
If there are no placed bids in the auction, the `end` function will always revert. The owner can not receive back the nft ant it will be locked in the contract.
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.