Christmas Dinner

First Flight #31
Beginner FriendlyFoundrySolidity
100 EXP
View results
Submission Details
Severity: medium
Valid

receive() doesn't set participant to true

Summary

Differing from the procedure from deposit(), the receive() function doesn't set participant[msg.sender] to true after depositing. For the participant to be able to be selected as host, the participant has to call also changeParticipationStatus().

Impact

Participants who deposit Ether are initially unable to be selected as hosts, while they should be.

Recommendations

Set participant to true on the receive() function:

receive() external payable {
++ participant[msg.sender] = true;
etherBalance[msg.sender] += msg.value;
emit NewSignup(msg.sender, msg.value, true);
}
Updates

Lead Judging Commences

0xtimefliez Lead Judge 11 months ago
Submission Judgement Published
Validated
Assigned finding tags:

receive does not update participation status

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.