The `checkTwice` function doesn't explicitly validate that an address was actually checked once before being checked twice. While it checks if statuses match, it doesn't verify that a check actually occurred, relying on enum default behavior which may be confusing and error-prone.
### Root + Impact
**Description:**
* The normal behavior is that `checkTwice` should only work if someone was first checked once, and the statuses should match.
* The issue is that the function only checks if statuses match, but doesn't explicitly verify that the address was checked once. This relies on enum default values and implicit behavior, making the code less clear and potentially error-prone.
```solidity
// @> SantasList.sol:133-139
function checkTwice(address person, Status status) external onlySanta {
if (s_theListCheckedOnce[person] != status) { // @> Doesn't explicitly check if person was checked once
revert SantasList__SecondCheckDoesntMatchFirst();
}
s_theListCheckedTwice[person] = status;
emit CheckedTwice(person, status);
}
```
Likelihood:
* This occurs when Santa tries to check someone twice, as there's no explicit validation
* The code relies on implicit enum default behavior
Impact:
* Less clear code intent and potential for confusion
* Relies on enum default values which may not be obvious to developers
* Could lead to unexpected behavior if enum order changes
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.