Starknet Auction

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

`transfer_from` function used instead of the `transfer` one

Summary

transfer_from function is used to transfer amount of bids to the users instead of the transfer function.

Vulnerability Details

transfer_from will need allowance that is not given by the contract

https://github.com/Cyfrin/2024-10-starknet-auction/blob/main/src/starknet_auction.cairo#L128

https://github.com/Cyfrin/2024-10-starknet-auction/blob/main/src/starknet_auction.cairo#L133

if caller == self.nft_owner.read() {
self.highest_bid.write(0);
@> erc20_dispatcher.transfer_from(sender, caller, amount_owner.into());
}
if amount > 0 {
let sender = get_contract_address();
@> erc20_dispatcher.transfer_from(sender, caller, amount.into());
}

Impact

The two transfer_from functions will fail

Tools Used

Manual review

Recommendations

Call transfer function instead of the transfer_from one.

Updates

Lead Judging Commences

bube Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

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