The addAuthorizedSablierSender function in the smart contract lacks a conditional check before adding an address to the authorizedSablierSenders mapping. This could lead to redundant state changes and unnecessary gas consumption if the address is already authorized.
The function addAuthorizedSablierSender directly sets the _address in the authorizedSablierSenders mapping to true, regardless of whether the address was previously authorized. Without a conditional check, the function may result in unnecessary gas costs due to redundant state writes.
This function doesn't check if the address is already authorized (authorizedSablierSenders[_address] == true). If the address is already authorized, writing the same value again wastes gas unnecessarily.
Gas Inefficiency: Repeatedly setting an already authorized address to true incurs unnecessary gas costs, especially in scenarios where this function is called frequently or in bulk operations.
State Redundancy: The function increases state redundancy by not distinguishing between new authorizations and repeated authorizations.
Manual code review
Add a conditional check before updating the authorizedSablierSenders mapping to ensure that only new authorizations are added:
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.