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

`stopEvent` function only sets isProducer mapping to false

Summary

Joining the MartenitsaEvent makes an user producer temporarily by adding them to producers list and setting isProducers[] to true. stopEvent function is used to stop the event and undo the producer status temporarily given to the users. The function implementation sets isProducers[] to false, but does not delete the entry from producers list. Presence of a user's entry in producers list is not intended.

Vulnerability Details

joinEvent function uses _addProducer function to grant users producer status by setting
-> isProducer[_producer] = true; and producers.push(_producer);
stopEvent is intended to revoke producer status of users, sets isProducer[participants[i]] = false; rightly, but does not delete/undo previously added producers.push(_producer).

Impact: Medium

Although the user is revoked his producer status by using isProducer mapping, his address is still present in producers list, which is unintended.

Tools Used

Manual Review

Recommendations

In stopEvent function call, we can add delete producers[participants[i]] or follow any other implementation that is deemed fit.

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.