Beginner FriendlyFoundryGameFi
100 EXP
View results
Submission Details
Severity: low
Invalid

Improper revert results in misleading the user

Summary

Improper revert results in misleading the user

Vulnerability Details

In MartenitsaMarketplace::collectReward function, if the (count / requiredMartenitsaTokens) is less than _collectedRewards[msg.sender], the function will always revert and users will not be able to know the reason of reverting.

Impact

Users will not be able to identify the reason of reverting of their transactions.

Tools Used

Manual Review

Recommendations

Add code in MartenitsaMarketplace::collectReward function:

- uint256 amountRewards = (count / requiredMartenitsaTokens) - _collectedRewards[msg.sender];
+ uint256 amount = (count / requiredMartenitsaTokens);
+ require( amount > _collectedRewards[msg.sender], "Cannot collect rewards!");
Updates

Lead Judging Commences

bube Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

underflow

Support

FAQs

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