Starknet Auction

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

Incorrect Event Emission in bid Function

Summary

The NewHighestBid event emits the previous highest bid amount instead of the new bid amount.

Vulnerability Details

The event uses self.highest_bid.read(), which holds the previous highest bid before it is updated.

Code Reference:

// In bid function
self.emit(NewHighestBid { amount: self.highest_bid.read(), sender: sender });
// Emits previous highest bid instead of the new amount

Impact

  • Inaccurate Event Data: Event logs will display incorrect bid amounts.

  • Data Integrity Concerns: May affect systems relying on these events for real-time updates or analytics.

Recommendations

  • Emit Correct Bid Amount: Use the amount parameter:

self.emit(NewHighestBid { amount: amount, sender: sender });
Updates

Lead Judging Commences

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

Incorrectly emitted parameter in `NewHighestBid` event

The `bid` function emits `NewHighestBid` event with wrong parameter. The `amount` parameter is `self.highest_bid.read()` that is called before the update of the `highest_bid` variable.

Support

FAQs

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