When users attempt to participate in the event by sending native ETH, the ChristmasDinner:receive function is triggered. While the function updates the user's balance, it fails to update their participation status, leaving them improperly registered as participants in the event.
When users pay with native ETH, their participation status is not updated, which undermines trust in the protocol and creates frustration for users.
The below is the POC
Add the above code in the ChristmasDinnerTest.t.sol:ChristmasDinnerTest.
shell forge test --match-test test_POC_receive -vv
You will get output as folowing
Participation status before call : false
Participation status after call : false
Update the participation status within the receive() function to ensure that users who send native ETH are properly registered as participants. This will prevent the issue of unregistered participants and help maintain trust in the protocol.
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.