Starknet Auction

First Flight #26
Beginner FriendlyNFT
100 EXP
View results
Submission Details
Severity: medium
Valid

End function will revert for auctions with no bids

Summary

The end function allows the owner of the contract to finalize the auction, however, if there's no bid for the auction, endwill always revert and the auction NFT will be stuck in the contract

Vulnerability Details

This line asserts that the auction's starting price is less than the highest bid. This only holds for auctions with bids, the value for the starting price will be equal to the highest bid for auctions with no bids.

fn end(ref self: ContractState) {
.....
assert(self.starting_price.read() < self.highest_bid.read(), 'No bids');
.....
}

Impact

The auction NFT will be stuck in the contract

Tools Used

Manual

Recommendations

The assertcheck should be removed

Updates

Lead Judging Commences

bube Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

The NFT will be locked if there are no bids

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.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.