The receive() function allows participants to contribute ETH to the contract. However, it does not update the participant mapping, which is critical for tracking contributors and enabling features like being the new host. As a result, ETH contributors are effectively excluded from the contract's participant management system.
The function records the ETH contribution by updating etherBalance[msg.sender] and It emits the NewSignup event, suggesting that the sender is considered a participant.
However, it does not update the participant mapping (participant[msg.sender] = true), leaving ETH contributors untracked in this system.
Append the following line of code at the end of the test_depositEther function in the test suite:
Exclusion from Participant-Specific Features: ETH contributors may be unable to participate in functionalities relying on the participant mapping (ex. choosing a new host).
Event Log Misrepresentation: Emitting the NewSignup event without registering the sender as a participant creates a discrepancy between the event logs and the contract’s internal state, which could mislead other entities, relying on the emissions.
Manual code review, Behavioral analysis of contract logic
Modify the receive() function to include the sender in the participant mapping, similar to ChristmasDinner::deposit function :
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.