Beginner FriendlyFoundryGameFi
100 EXP
View results
Submission Details
Severity: high
Valid

Wrong HealthToken logic for minting

Summary

More than allowed Health Tokens can be minted due to incorrect Logic

Vulnerability Details

In MartenitsaMarketplace.sol::collectReward(), there is incorrect logic in the line

_collectedRewards[msg.sender] = amountRewards;

This line is incorrect as the amountRewards should be added to the _collectedRewards[msg.sender] array in order for Health Token minting calculation to work properly. This flaw in logic can be exploited to mint more Health Tokens than deserved.

Impact

Funds in the form of HealthTokens can be stolen/minted.

Tools Used

Manual Review

Recommendations

Change the line to

_collectedRewards[msg.sender] += amountRewards;
Updates

Lead Judging Commences

bube Lead Judge
over 1 year ago
bube Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

_collectedRewards is not updated correctly

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.