After the CHRISTMAS_2023_BLOCK_TIME
arrives, any user can call SantaList::collectPresent
to get the NFT without the need of Santa's eligibility.
Enums in Solidity are initialized with the first member of the list. Currently the enum Status
is declared as such:
Due to this ordering, all accounts in the mappings s_theListCheckedOnce
and s_theListCheckedTwice
have a NICE
status by default.
Paste the following test in SantaListTest.t.sol
to test the vulnerability.
Users don't need their eligibility to be set by Santa to collect a present.
Foundry and VS Code.
Reorder the members of the enum as such:
With this order users will need to get their eligibility from Santa to claim presents.
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.