Normal Behavior:
A contract should handle unexpected ETH transfers gracefully, either by accepting them (so they can be withdrawn) or by reverting with a clear error message to prevent accidental loss or confusion.
Issue:
The FestivalPass contract does not implement a receive() or fallback() function. If someone sends ETH directly to the contract (not via buyPass), the transaction reverts with no clear reason. This can confuse users and integrators, and is not best practice.
Likelihood:
This will occur if a user or contract mistakenly sends ETH directly to the contract address, which is a common mistake in the Ethereum ecosystem.
Impact:
The transaction will revert, potentially confusing users and causing failed transactions. There is no clear error message or handling for such cases, which can lead to poor user experience and support issues. In some cases, users may believe their ETH was accepted when it was not.
The following test demonstrates that sending ETH directly to the contract reverts, with no clear reason provided:
Add a receive() function to the contract to explicitly handle direct ETH transfers.
You can either revert with a clear message, or accept ETH if that is desired. Or, to allow ETH deposits:
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.