Optimization (Gas)
Inside collectPresent there are Status checks for first Status and second Status connected with logical AND.
There is no need for first Status check because second status can't be NICE or EXTRA_NICE without first Status equal to NICE or EXTRA_NICE.
s_theListCheckedOnce - first Status
s_theListCheckedTwice - second Status
There is no need for first Status check because second status can't be NICE or EXTRA_NICE without first Status equal to NICE or EXTRA_NICE.
https://github.com/Cyfrin/2023-11-Santas-List/blob/main/src/SantasList.sol#L154
https://github.com/Cyfrin/2023-11-Santas-List/blob/main/src/SantasList.sol#L158-L159
When Santa sets second Status with checkTwice function, there is a check for first Status to be the same value.
https://github.com/Cyfrin/2023-11-Santas-List/blob/main/src/SantasList.sol#L134-L135
Therefore, there are no need to check second AND first statuses. Only second status check would be enough.
One exclusion would be if Santa for some reason end with checkList function call, e.g:
checkList (NICE)
checkTwice (NICE)
checkList (NAUGHTY)
But this is invalid case and should not be taken into account.
Optimization (Gas)
Manual
Remove first Status checks.
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.