Failure to check _amount
in the ChristmasDinner::deposit()
function means that anyone can sign up for dinner without paying for it.
Code reference in repo: see code
As it says in the documentation:
we directly "force" the attendees to pay upon signup, so the host can plan properly knowing the total budget after deadline.
(known issues) We are aware that we do not require a minimum deposit amount to sign up as participant for this contract. We consider it not necessary and rely here on social conventions.
I understand that the developer assumed that everyone who wanted to go out to dinner would pay a certain amount. What is not taken into account is that you can pay zero to become a participant. Unfortunately, not checking an amount to pay means you can pay zero and be invited to dinner.
Additionally, people who have already registered and contributed 0 again are considered to have contributed Generius Donation
, which is highlighted by the emission of the ChristmasDinner::GenerousAdditionalContribution(address indexed, uint256 indexed)
event.
See function testCanDepositZero()
in the foundry test below:
I think the easiest way is to set constant
for each accepting token and ETH that represent minimum amount that can be deposited. This should then be tested in the deposit()
and receive()
functions.
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.