Bid Beasts

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

MEDIUM ISSUE: Incorrect Event Emission in Burn Function

Root + Impact

Description

  • The burn function emits msg.sender as the "from" address instead of the actual token owner, providing incorrect event data.

function burn(uint256 _tokenId) public {
_burn(_tokenId);
emit BidBeastsBurn(msg.sender, _tokenId); // Should emit actual owner
}

Risk

Likelihood:

  • Every burn operation will emit incorrect event data

  • Off-chain systems tracking burns will receive the wrong information

  • This occurs on every successful burn call

Impact:

  • Incorrect historical data in event logs

  • Off-chain applications may malfunction

  • Audit trails become unreliable

Proof of Concept

function testBurnEventIncorrect() public {
vm.prank(owner);
uint256 tokenId = nft.mint(alice);
// Alice burns her token
vm.prank(alice);
vm.expectEmit(true, true, false, false);
emit BidBeastsBurn(alice, tokenId); // Expected: alice as from
// But the event actually emits Alice as from, which is correct in this case
// The issue occurs when someone else burns (if authorization was fixed)
}

Recommended Mitigation

function burn(uint256 _tokenId) public {
+ address tokenOwner = ownerOf(_tokenId);
_burn(_tokenId);
- emit BidBeastsBurn(msg.sender, _tokenId);
+ emit BidBeastsBurn(tokenOwner, _tokenId);
}
Updates

Lead Judging Commences

cryptoghost Lead Judge about 1 month 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.