The default value for any person in storage variables SantasList::s_theListCheckedOnce
and SantasList::s_theListCheckedTwice
is NICE
. This results in anyone can call SantasList::collectPresent
and mint an NFT. A malicious user can create multiple accounts and mint multiple NFTs.
The default value for a enum type is it's first member, and in this case, the default value is NICE
. SantasList::collectPresent
function allows a user to mint a NFT if their address is marked NICE
in storage variables s_theListCheckedOnce
and s_theListCheckedTwice
. Since the default value is NICE
, anyone can mint a NFT. A malicious user can create multiple accounts and mint multiple NFTs.
Unlimited NFT mints
Forge test case
Foundry
Change first member of enum Status
to NOT_CHECKED_TWICE
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.