Even after Christmas has arrived and the list has been prepared, it can be modified which can lead to a user not being able to collect their present.
The current implementation opens up a possibility that a user will be able to claim his present only if he does so fast enough once Christmas arrives. Imagine the following flow:
Santa marks Alice as EXTRA_NICE
(checked twice)
block.timestamp = CHRISTMAS_2023_BLOCK_TIME (Christmas arrives)
Alice is sick for a few days, so she can not collect her present via collectPresent()
. She does check her status via the view function getNaughtyOrNiceTwice() and is happy to see she has been marked eligible. She plans to collect her present later upon getting better.
A day later, Santa clears his list for the season and marks everyone as NOT_CHECKED_TWICE
. Since there are no events or view functions to check if a person has collected their present, he can't know who all have still not collected their presents.
Alice gets healthy again, only to find that her call to collectPresent()
reverts on L165
User can lose out on their eligible presents.
Manual inspection
Add a constraint that checkList()
and checkTwice()
can be called only until Christmas eve, or maybe until (timestamp: 1_703_635_200), but choose a deadline :
check on block.timestamp only requires that christmas has arrived. The protocol explicitly states that after christmas has passed (give or take 24 hours) collecting shouldn't be possible.
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.