Summary:
`ChristmasDinner::recieve` function is not updating participants list for that users who pays ETH to participate in dinner. The Reecieve function is not following doccumentation, as it is not handling user signup properly.
```javascript
receive() external payable {
@> etherBalance[msg.sender] += msg.value;
emit NewSignup(msg.sender, msg.value, true);
}
```
Impact:
ETH payer will assume that thay are not participants, will pay ETh again and again to participate.
Proof of concept:
Add this to `ChristmasDinnerTest.t.sol`.
Code:
```javascript
function testRecieveFunctionDoesNotUpdatingParticipants() public {
address participant = makeAddr("User");
vm.deal(participant, 10e18);
vm.prank(participant);
(bool sent, ) = address(cd).call{value: 1e18}("");
require(sent);
assertEq(cd.getParticipationStatus(participant), false);
}
```
Recommendations:
The `recieve` function shold be like mentioned below.
```diff
receive() external payable {
+ participant[msg.sender] = true;
etherBalance[msg.sender] += msg.value;
emit NewSignup(msg.sender, msg.value, true);
}
```