The ChristmasDinner::receive function does not update the participant status when a user signs up via an ETH transfer. This can lead to inconsistencies in the participant status and prevent the host from tracking the number of participants that signed up via ETH.
Based on the docs, users can sign up for the Christmas dinner by sending ETH to the contract. The ChristmasDinner::receive function is used to receive the ETH and update the participant status. However, the implementation of the receive function does not set the partipant's status in the participants mapping to true. This means that the host does not know who signed up via ETH unless they review the transaction history manually.
The following scenario can lead to inconsistencies in the participant status:
User signs up for the Christmas dinner by sending ETH to the contract.
The receive function is called when the ETH is received but the participant status is not updated.
The user's partipant status is still set to false.
Code:
To demonstrate the failing of ETH signups place following code into ChristmasDinnerTest.t.sol:
The impact of this issue is medium as it can significantly affect the functionality of the protocol but no funds are at risk. The main purpose of the protocol is to track participant signups and collect funds for the event. If the protocol consistently fails to consider partipants that sign up via ETH, the host will not have the correct number of partipants for the event and may not be able to plan accordingly. Since the protocol states that signups with ETH are possible it is also highly likely that some users will use this option.
Manual review, custom test
Update the ChristmasDinner::receive function to set the participant status to true when a user signs up via an ETH transfer. This will ensure that the host can track all participants that signed up for the event and plan accordingly. Alternatively, ETH transfers could be treated solely as generous additional contributions which should be indicated as such through a GenerousAdditionalContribution event instead of a NewSignup event.
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.