The MysteryBox contract emits no events for any of the functions where key actions of the owner and players are executed.
These core functions update the state of the smart contract and it is imperative that these are stored as a log to ensure the protocol is auditable, transparent and can be monitored efficiently.
Events are integral for smart contracts, as it facilitates the logging of state changes. The logs built by emitting events are immutable and can be indexed and queried off-chain. The absence of such logs greatly hinders the ability to audit, debug, monitor and trace transactions and state changes.
There are several functions in the MysteryBox contract that update state and would be expected to emit an event to log these changes. These functions are listed below:
setBoxPrice
addReward
buyBox
openBox
transferReward
withdrawFunds
claimAllRewards
claimSingleReward
changeOwner
Omitting events from key functions in the MysteryBox contract greatly affects the following:
Auditability & Transparency: Events build a historical immutable record of previous transactions. This allows external parties to audit previous activity and ensures all activity is visible and transparent for past and new participants.
Efficient Data Retrieval: Events facilitate off-chain data lookups, which is quicker and more efficient. Additionally, when events are indexed by specific parameters, queries can be filtered by these parameters, further improving query efficiency.
Real-time Feedback for Frontends: Often frontends rely on a function emitting an event to update the interface for the interaction the user has completed.
Debugging & Development: When trying to diagnose or debug an issue, it will be more difficult to replicate or analyse without a history of transactions that led up to the issue. Thus the developer and auditor experience is negatively affected.
Manual review & Aderyn
Add the following events to the contract:
Emit the events in the corresponding functions:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.