Starknet Auction

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

Unsafe ERC721 Transfers

Description:

  • Location in Code: The start and end functions.

  • The contract uses transfer_from instead of safe_transfer_from for transferring NFTs.

  • transfer_from does not check if the recipient can handle ERC721 tokens.

Impact:

  • NFTs may be transferred to addresses or contracts that cannot manage them, effectively locking the NFT.

Recommendation:

  • Use safe_transfer_from to ensure the recipient can handle ERC721 tokens.

Proof of Code:

fn start(ref self: ContractState, bidding_duration: u64, starting_bid: u64) {
// ...
erc721_dispatcher.transfer_from(caller, receiver, self.nft_id.read().into());
// ...
}
fn end(ref self: ContractState) {
// ...
erc721_dispatcher.transfer_from(sender, self.highest_bidder.read(), self.nft_id.read().into());
// ...
}

Corrected Code:

fn start(ref self: ContractState, bidding_duration: u64, starting_bid: u64) {
// ...
erc721_dispatcher.safe_transfer_from(caller, receiver, self.nft_id.read().into());
// ...
}
fn end(ref self: ContractState) {
// ...
erc721_dispatcher.safe_transfer_from(sender, recipient, self.nft_id.read().into());
// ...
}
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.