The updateEmissionRate
function in the RAACMinter contract emits an event indicating that the emission rate has been updated, even when the newly calculated rate (newRate
) is identical to the current rate. This behavior can mislead off-chain monitoring systems and analytics.
Within the updateEmissionRate
function, the new emission rate is calculated using the calculateNewEmissionRate
function and then assigned to the state variable emissionRate
. Regardless of whether newRate
differs from the current emissionRate
, the function emits the EmissionRateUpdated
event. As a result, observers relying on these events might mistakenly believe that a change in the emission rate has occurred when, in reality, no update has taken place. This unnecessary event emission can lead to incorrect assumptions and misleading data in external systems that track protocol changes.
Misleading Monitoring Data: Off-chain monitoring services and dashboards that rely on emitted events for tracking protocol metrics might register false updates, leading to confusion regarding the current emission rate.
Data Inconsistency: Inaccurate event logs can result in incorrect historical data analysis, potentially affecting decision-making and the perceived stability of the protocol.
Manual code review
Modify the updateEmissionRate
function to emit the EmissionRateUpdated
event only when the new emission rate is different from the current rate. For example, before updating and emitting, add a check such as:
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.