MartenitsaEvent::stopEvent ends an event. However, it does not clean/reset this 3 variables:
participants array.
_participants mapping.
producers array.
When a new event will be launched, all these variables will contains the previous event data.
Here is several unexpected behavior:
Users won't be able to participate anymore due to this line in joinEvent: require(!_participant[msg.sender],"You have already joined the event");
After several events, participants array will become too big and the loop in stopEvent will revert before finishing (out-of-gas / exceeding block gas limit)
After several event, producers array will be huge and the getAllProducers function will revert returning it.
Likelyhood: High
From the second event and for all others
Impact: High
Previous participants cannot join new events
stopEvent will revert after some events leading all the users to stay producers
Clean also the _participants mapping, delete the participants array in stopEvent function.
Don't push any participant in the producers array since the same data is in the participants array.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.