Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N-14 [Oval] Possible Duplicate Event Emission #26

Merged

Conversation

Reinis-FRP
Copy link
Collaborator

Addresses audit issue: N-14 [Oval] Possible Duplicate Event Emission

When a setter function does not check if the value has changed, it opens up the possibility of
spamming events indicating that the value has changed when it has not. Spamming the same
values can potentially confuse off-chain clients.

Within MutableUnlockersController.sol , the setUnlocker function sets the
unlockers state variable and emits an event without checking if the value has changed.

Consider adding a check to revert the transaction if the value remains unchanged.

This implements the recommended fix by requiring unlockers state to be changed when calling setUnlocker in mutable controllers.

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
Copy link

linear bot commented Jun 17, 2024

@Reinis-FRP Reinis-FRP requested review from chrismaree and md0x June 17, 2024 15:09
Copy link
Collaborator

@md0x md0x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@chrismaree chrismaree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is silly feedback as only the owner can make this change. an alternative(you don't have to change it) would be to only emit if there is a diff that way it does not revert and we don't pollute the logs. either way, this is fine.

@Reinis-FRP Reinis-FRP merged commit 6f53172 into master Jun 18, 2024
3 checks passed
@Reinis-FRP Reinis-FRP deleted the reinis/uma-2656-n-14-oval-possible-duplicate-event-emission branch June 18, 2024 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants