Bid Beasts

First Flight #49
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: low
Valid

Event emitted in the middle of a function

Event emitted in the middle of a function

Description

The function placeBid as an emitted in the middle of the function

function placeBid(uint256 tokenId) external payable isListed(tokenId) {
...
emit AuctionSettled(tokenId, msg.sender, listing.seller, msg.value);
...
}

It will emit a log that informs the Auction is settled even though it could fail the remaining requirements.

Risk

impact (low) : It could emit a wrong log as the bid was not settled, giving wrong information in the blockchain.

likelyhood(Medium) : Could append every time someone failed to bid higher than the previousBid.

Recommended Mitigation

Removing the event is better.

function placeBid(uint256 tokenId) external payable isListed(tokenId) {
...
- emit AuctionSettled(tokenId, msg.sender, listing.seller, msg.value);
...
}
Updates

Lead Judging Commences

cryptoghost Lead Judge 2 months ago
Submission Judgement Published
Validated
Assigned finding tags:

BidBeasts Marketplace: Incorrect Event Emission

placeBid emits AuctionSettled even though the auction hasn’t ended, causing misleading event logs.

Support

FAQs

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

Give us feedback!