Mystery Box

First Flight #25
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

Missing Event Emission After Ownership Change Makes It Harder To Track Ownership Changes

Summary

The changeOwner function in the MysteryBox contract updates the contract's owner state without emitting an event to notify external systems or users of the ownership change.

Vulnerability Details

An ownership change in changeOwner occurs without emitting an event:

function changeOwner(address _newOwner) public {
@> owner = _newOwner; // No event emitted
}

Impact

Without an event, external systems and users cannot easily track when ownership changes occur. This reduces the auditability of the contract’s operations and makes it harder to detect unauthorized ownership changes.

Tools Used

Manual Review

Recommendations

Consider emitting events to notify users about any modifications of such importance in the contracts’ business logic.

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function changeOwner(address _newOwner) public {
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
Updates

Appeal created

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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