A user that has already bought 3 Martenitsa Tokens and collected a reward with collectReward(), could transfer his 3 Martenitsa tokens to another address and collect the reward again.
User Bob, who has 3 Martenitsa Tokens, could collect a Health Token Reward and afterward transfer the 3 Martenitsa Tokens to another address, and collect this Health Token Reward again. He can perform this operation multiple times to collect Health Token Rewards.
Add this code to the Contract and run the command:
we get the output
Users can get more Health Token Rewards than they deserve.
Manual Review
When a Martenitsa Token is used to collect a Reward, it should be added to a mapping and flagged as alreadyUsed = true to collect for this user. So the next time a user tries to collect a Reward again, the function collectReward should only count id with alreadyUsed = false
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.