By default, everyone is assigned the NICE
status and hence can receive NFT by calling collectPresent()
.
The NICE
status has a value 0 since it is the first element of Status
.
In solidity, the mappings s_theListCheckedOnce
and s_theListCheckedTwice
would also return 0 for any address which does not have an entry in it. Thus, by default every uninitialized address has value 0 and thus, NICE
. They would be therefore eligible to claim a NFT via collectPresent() due to the check being satisfied at L154.
Anyone in the world can collectPresent(), if they have not been explicitly marked as NAUGHTY
or NOT_CHECKED_TWICE
by Santa.
Foundry
Change the order here so that the default status is NOT_CHECKED_TWICE
( you can also choose to keep it as NAUGHTY
so that it matches the error message on L165 more closely):
In Solidity the first element of an enum is the default value. In Santa's List, the means each person is mapped by default to 'NICE'.
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.