Mystery Box

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

`MysteryBox::setBoxPrice` does not emit an event, so it is difficult to track changes in the value of buyPrice off-chain

Summary

The MysteryBox::setBoxPrice function lacks an event emission, making it challenging to monitor changes in the buyPrice off-chain. In the absence of an emitted event, external applications, off-chain services, and users have no straightforward way to detect and log price updates in real-time. This lack of transparency can lead to discrepancies in data tracking, hinder the functionality of analytics tools, and make it more difficult for users to react to price changes, potentially impacting their decision-making when interacting with the protocol.

Impact

Without an event in setBoxPrice, tracking buyPrice changes off-chain becomes difficult, reducing transparency and hindering real-time monitoring of price updates for users and external services.

Tools Used

Manual code review and slither

Recommendations

Add an event for tracking price of a mystery box.

+ event BoxPriceUpdated(uint256 newPrice);
function setBoxPrice(uint256 _price) public {
require(msg.sender == owner, "Only owner can set price");
boxPrice = _price;
+ emit BoxPriceUpdated(_price);
}
Updates

Appeal created

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!