The end
function doesn't handle the case where no bids were placed, potentially locking the NFT in the contract.
https://github.com/Cyfrin/2024-10-starknet-auction/blob/main/src/starknet_auction.cairo#L139-L155
The end
function doesn't handle the case where no bids were placed. It only checks if the highest bid is greater than the starting price:
If no bids were placed, the highest bid would equal the starting price, causing this assertion to fail but not handling the return of the NFT to the original owner.
If no bids are placed, the NFT could be locked in the contract indefinitely, causing loss of the asset for the original owner.
Manual Review
Modify the end
function to return the NFT to the original owner if no bids were 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.