The refund() function in ChristmasDinner.sol does not remove the caller from the list of participants after returning their funds. This contradicts the expected behavior that a user who has requested a refund before the deadline should no longer be considered a participant.
Currently, there is no state update that sets participant[msg.sender] to false. Consequently, the user remains a participant even though their deposited tokens and Ether have been returned to them.
Running:
forge test --mt test_refundWithinDeadlineAndRemoveParticipation
fails with:
[FAIL: assertion failed: true != false]
**Users Remain Marked as Participants:**Conflicts with the contract’s intended logic of removing attendees once they refund their deposits.
Incorrect Contract State:
On-chain data is misleading, potentially affecting host decisions or other logic (like changing the host or total count of participants).
Manual review, foundry
Set Participant to false in refund()
For example:
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.