The contract fails to update the participant status after a refund and lacks a mechanism to prevent refunded participants from rejoining, leading to potential inconsistencies and exploitation.
Missing participant Update: The refund() function does not set participant[msg.sender] = false after a user has been refunded. This allows a user to be refunded but still be considered a participant.
No Prevention to Rejoin: There's no mechanism to prevent a user who has already called refund() from calling changeParticipationStatus() to set their status back to true before the deadline.
Inconsistent State: A user can be refunded but still appear as a participant in the contract's state.
Potential Exploitation: A user could refund, rejoin, and withdraw again after the deadline, effectively double-spending.
Manual Code Review
Update participant Status in refund(): Add participant[msg.sender] = false; after the refund logic in the refund() function.
Add a Check in changeParticipationStatus(): Modify changeParticipationStatus() to prevent users who have been refunded from returning their status to true. This could involve adding a new mapping to track refunded users or modifying the existing participant mapping.
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.