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

Too many participants in the event will lead to never stop the event

Description

MartenitsaEvent::stopEvent go through the all list of new producers (participants).
If there are too many participant the function will go over the block gas limit and would be impossible to call without reverting.

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

Risk

Likelyhood: Medium

  • Only holders of 1 HealthToken can participate, but buying 3 Martenitsa tokens is enough to have this token.

Impact: High

  • Denial of service of stopEvent, all participants will stay Producers for ever, breaking the protocol

Recommended Mitigation

Limit the number of participant.
Alternatively put the mapping cleaning in another function with a starting index and a ending index to proceed even big arrays.

Updates

Lead Judging Commences

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

Unbounded arrays

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

Unbounded arrays

Support

FAQs

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