Starknet Auction

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

Incorrect Use Of transfer() In bid()

Summary

transfer() is incorrectly being used within bid() to deposit tokens from bidders.

Vulnerability Details

On line 113 transfer() is being used to deposit ERC20 tokens from bidders into the contract. This means that the sender is actually the smart contract and not the bidder who is trying to deposit tokens.

Impact

If the contract has no preexisting balance this will result in the call failing with an INSUFFICIENT_BALANCE error. This means that all calls to bid() would fail. However, if the contract had a preexisting balance, it means that bidders would be able to bid using the contracts balance and not use their own tokens. This would essentially allow them to withdraw this amount from the contract upon completion of the auction. Also, it would allow the winning bidder to win the NFT and have the contract pay for it.

Tools Used

Manual Review

Recommendations

Update line 113 to the following: erc20_dispatcher.transferFrom(sender, receiver, amount.into());

Updates

Lead Judging Commences

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

Appeal created

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

`transfer` instead of `transfer_from`

In the `bid` function is wrongly used `transfer` function instead `transfer_from`.

Support

FAQs

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