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

transfer() function can be used

Summary

According to the documents HealthToken is defined as below:

"HealthToken is an ERC-20 token with additional functionality. The primary purpose of this token is to serve as a reward mechanism for participants who have more than 3 MartenitsaTokens. For every 3 different MartenitsaTokens they receive 1 HealthToken. This token is also a reward for the winner of the voting. These should be the two eligible ways to receive a HealthToken in this protocol."

Vulnerability Details

But in reality HealthToken can be transferred with transfer() function.

Impact

HealthToken is used to join the event and become a producer once it transferred receiving party can join the events.

function testHTCanBeTransferred() public activeEvent eligibleForReward {
vm.startPrank(bob);
marketplace.collectReward();
healthToken.transfer(makeAddr("wallet1"), 10 ** 18);
}

Tools Used

foundry
vs code

Recommendations

It's recommended to overwrite the transfer function to avoid being used.

Updates

Lead Judging Commences

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

ERC20 `transfer` not overriden

Support

FAQs

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