Starknet Auction

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

Auction owner can withdraw starting bid

Summary

The withdraw function allows the auction owner to withdraw the starting bid if there's no bid.

Vulnerability Details

The value of the highest_bidin the withdraw function for auctions without bids is the starting _bidthat was set by the owner in the function startand should not be withdrawable but the current implementation allows is if there are any existing ERC20 token in the contract

fn withdraw(ref self: ContractState) {
....
let amount_owner = self.highest_bid.read();
if caller == self.nft_owner.read() {
self.highest_bid.write(0);
erc20_dispatcher.transfer_from(sender, caller, amount_owner.into());
}
....
}

Impact

Loss of ERC20 tokens in the contract

Tools Used

Manual

Recommendations

Updates

Lead Judging Commences

bube Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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