Users who have 3 or more MartenitsaTokens
and collectRewards
then gift their MartenitsaTokens
and then acquire 3 new MartenitsaTokens
will be denied HealthToken
rewards.
Users can only collect HealthTokens
by owning 3 or more MartenitsaTokens
. The more MartenitsaTokens
the more HealthTokens
a user can acquire. However, this is untrue in the scenario where a user owns 3+MartenitsaTokens
, collects rewards, gifts all their MartenitsaTokens
, and then mints 3+ new MartenitsaTokens
.
This user should be eligible to claim 1 more HealthToken
from their new MartenitsaTokens
. When they go to collect their new rewards they will be unable to because their MartenitsaMarketplace::_collectedRewards
mapping will be equal to 1 from their previous claim.
On their second claim, the users amountRewards
= 0 and they will not be sent the HealthTokens
they are entitled to.
Users are unable to claim HealthTokens
when they should be able to. This issue is compounded with larger MartenitsaToken
holders. In the current implementation, users must accumulate more MartenitsaTokens
to claim more rewards. For example, a MartenitsaTokens
holder had a balance of X and claimed HealthTokens
from all X tokens. That user would only be able to claim more HealthTokens
once they acquired X + 3 more tokens.
Add this test to the MartenitsaMarketplace.t.sol
and run to see it will fail when a user tries to rightfully claim HealthTokens
Manual Review, Foundry
Create a mapping of "eligible rewards" and increment or decrement by the proper amount on transfers of MartenitsaTokens
.
Calculate the actual rewards a user is able to collect based on that mapping eligibleRewards[msg.sender] / 3
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.