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

Users who are already producers can still participate in the event

Summary

Users who are already producers can still participate in the event

Vulnerability Details

POC:

function testProducersCanParticipate() activeEvent public{
//jack is a producer
assert(martenitsaToken.isProducer(jack) == true);
//assume jack have a healthToken
deal(address(healthToken), jack, 10 ** 18);
vm.startPrank(jack);
healthToken.approve(address(martenitsaEvent), 10 ** 18);
martenitsaEvent.joinEvent();
vm.stopPrank();
assert(martenitsaEvent.getParticipant(jack) == true);
}

add this test function in MartenitsaEvent.t.sol,
then run forge test --mt testProducersCanParticipate

Impact

High

Tools Used

Foundry

Recommendations

The MartenitsaEvent Contract and the MartenitsaToken contract should use the same address

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:

MartenitsaToken and MartenitsaEvent have different addresses

Support

FAQs

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