The receive() function, which handles ETH deposits, incorrectly updates the participant status and lacks a deadline check, leading to inconsistencies and allowing deposits after the deadline.
The receive() function has two major flaws:
Incorrect participant Update: It does not set participant[msg.sender] = true when a user sends ETH. This means users who send ETH are not considered participants.
Missing deadline Check: It does not check if block.timestamp is before the deadline, allowing users to send ETH even after the deadline has passed.
Inconsistent State: Users who send ETH are not marked as participants, leading to inconsistencies in the contract's state.
Deposits After Deadline: Users can deposit ETH after the deadline, which should not be allowed.
Manual Code Review
Update participant Status: Add participant[msg.sender] = true; to correctly mark ETH senders as participants.
Add deadline Check: Add require(block.timestamp <= deadline, "Deadline passed"); to prevent ETH deposits after the deadline.
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.