Best practice for smart contracts dictates that events should be emitted only after all state changes have been finalized and any external interactions related to the current operation have successfully completed. This ensures that off-chain observers receive event logs that accurately reflect the contract's final, consistent state.
In several functions within FestivalPass.sol (e.g., attendPerformance, buyPass, redeemMemorabilia), external calls are made before their corresponding events are emitted. This means off-chain systems listening to these events might log an event for an action that could subsequently revert (due to the external call failing), leading to a misrepresentation of the contract's true state in off-chain records.
SLITHER OUTPUT:
Likelihood:
This will occur every time the affected functions are successfully executed, and an external call is made.
This will occur consistently, leading to off-chain systems processing events that might not reflect the final on-chain state if the external call (or a re-entry from it) causes a revert.
Impact:
Off-chain services (e.g., analytics dashboards, indexers, block explorers, DApp frontends) may display temporarily or permanently inconsistent information, showing an action as completed when it ultimately failed.
Auditing the history of contract interactions becomes more complex, as event logs might not perfectly align with the final on-chain state if external calls revert.
Can lead to increased complexity in off-chain data reconciliation.
(Similar adjustments should be made for buyPass and redeemMemorabilia, ensuring events are emitted at the very end of the function after all effects and external interactions have concluded.)
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.