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

Participant are not deleted from the producers array after the event is finished in `MartenitsaEvent`

Summary

Details

We add participants in the MartenitsaEvent in the producers array via this function:

function _addProducer(address _producer) internal {
isProducer[_producer] = true;
producers.push(_producer);
}

However when the event is stopped, the participants are not removed from the array:

function stopEvent() external onlyOwner {
require(block.timestamp >= eventEndTime, "Event is not ended");
for (uint256 i = 0; i < participants.length; i++) {
isProducer[participants[i]] = false;
}
}

Impact

When calling MartenitsaToken::getAllProducers will return wrong information.

function getAllProducers() external view returns (address[] memory) {
return producers;
}

Tools Used

Manual Review

Recommendations

Don't add the event participant in the array.

function _addProducer(address _producer) internal {
isProducer[_producer] = true;
-producers.push(_producer);
}
Updates

Lead Judging Commences

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

Producers array not updated

Support

FAQs

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