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

Optimization and Feedback Enhancement in setSigner Function for Efficient State Management

Summary

The contract includes a setSigner function used to enable or disable a signer. The proposed function enhancements ensure that unnecessary state changes are avoided and emit events to provide feedback when attempting to set the signer's status to the same state.

Vulnerability Details

The previous version of the setSigner function did not account for cases where the signer's status matched the desired state, potentially leading to unnecessary state changes. The updated function prevents redundant state updates and emits events to signify when the signer's status is already aligned with the desired state.

Impact

The impact of the initial vulnerability was minor, primarily concerning inefficient state changes and gas costs due to unnecessary writes. The improved function aims to prevent such inefficiencies by skipping state updates when the signer is already in the desired state.

Tools Used

Manual inspection

Recommendations

The recommended enhancements aim to improve the efficiency of the setSigner function by avoiding unnecessary state changes. By emitting events that provide feedback when the signer's status matches the desired state, it enhances the clarity of the contract's behavior and potentially reduces gas costs.

Updates

Lead Judging Commences

0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

missing events emission

Support

FAQs

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