updateCountMartenitsaTokensOwner is used to update countMartenitsaTokensOwner mapping
The function doesn't have any access controls and can be called by anyone.
marketplace.collectReward() function distribute the Health Tokens based on the countMartenitsaTokensOwner mapping. Since this mapping can be manipulated by anyone limitless Health tokens can be gained by anyone.
foundry
vs code
Calling this function within buyMartenitsa or makePresent doesn't increase/decrease balanceOf(user) which causes mismatch between balanceOf(owner) and countMartenitsaTokensOwner[owner]. Instead of saving the count of MartinitsaTokens in countMartenitsaTokensOwner mapping it would be better to use balanceOf(owner) for tracking the no of NFTs per user... updateCountMartenitsaTokensOwner is called within functions makePresent and buyMartenitsa, they also change balanceOf(owner) accordingly. i.e. safeTransferFrom().
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.