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

`MartenitsaEvent::participants` is an unbounded array which could cause the `stopEvent` function to revert due to reaching the block gas limit.

Summary

The MartenitsaEvent::stopEvent is intended to stop the event and remove the producer
role from the participants.

Inside its definition, the stopEvent function loops over the participants array which is not bounded.
This could result in the gas consumed by the stopEvent function to exceed the gas block limit and thus
reverting the transaction.

Vulnerability Details

function stopEvent() external onlyOwner {
require(block.timestamp >= eventEndTime, "Event is not ended");
// @-audit the loop below is unbounded and therefore the gas consumed is not limited
for (uint256 i = 0; i < participants.length; i++) {
isProducer[participants[i]] = false;
}
}

Impact

The event cannot be stopped and the producer role cannot be removed from the participants.

Tools Used

Manual review.

Recommended Mitigation

Consider running the logic inside the stopEvent function in batches to make sure
the gas consumed is limited.

Updates

Lead Judging Commences

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.