The deposit function in the ChristmasDinner contract sets a user's participant status to true before verifying that the token transfer was successful. This could lead to users being registered as participants even if their token transfer fails.
In the deposit function, when a new participant attempts to join, the following sequence occurs:
The participant status is set to true
The balance is updated
The token transfer is attempted
It can be seen here
If the safeTransferFrom call fails (e.g., due to insufficient allowance or balance), the transaction will revert, but in a scenario where the contract is called by another contract that catches the revert, the participant status could remain set without any actual deposit.
Users could be registered as participants without making any deposit
This could lead to inaccurate participant counting
Could potentially allow participation in event coordination without financial commitment
Manual review
Implement Checks-Effects-Interactions pattern by moving the state changes after the token transfer:
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.