The calculateNewEmissionRate function in the RAACMinter contract is responsible for dynamically adjusting the RAAC token emission rate based on system utilization. When the utilization rate exceeds the target, the function increases the emission rate by adding an adjustment. However, the function incorrectly determines the "maxRate" by selecting the higher value between the increased rate and the benchmark rate. According to the provided @info comment ("wrong maxRate pickup"), this logic is reversed—likely, the intended behavior is to pick the lower value to prevent an excessive emission rate increase. This error can lead to inaccurate emissions, which in turn may cause erratic token minting, potential economic imbalances, and inefficiencies in the protocol's dynamic emissions schedule.
The relevant portion of the function is as follows:
Issue Identified:
When utilization is above target, the function calculates an increasedRate by adding an adjustment. It then uses a ternary operator to set maxRate as:
This expression picks the higher of increasedRate and benchmarkRate. However, based on the @info comment ("wrong maxRate pickup"), the intended behavior is likely to select the lower value between the two. This would help to moderate the emission rate increase and prevent overshooting the target, maintaining a more controlled emission schedule.
The function then caps the value at maxEmissionRate, but the error in selecting maxRate can result in an emission rate that is too high or inconsistent with the intended benchmark.
Incorrectly choosing the higher rate when utilization is high may:
Over-inflate the Emission Rate:
Leading to token oversupply if the increased rate far exceeds the benchmark.
Destabilize the Emission Schedule:
Result in erratic changes to the emission rate, undermining the protocol's dynamic adjustments.
Create Economic Imbalances:
Overly Aggressive Emission Increases:
Selecting the higher value between increasedRate and benchmarkRate can lead to an emission rate that overshoots the intended target, potentially resulting in an excessive token supply.
Unpredictable Emission Behavior:
Erratic adjustments in the emission rate may destabilize the protocol, affecting lending, borrowing, and overall economic incentives.
Economic Instability:
Incorrect emissions may distort token valuation, undermining user confidence and potentially leading to market manipulation.
Manual Review
Foundry
To address this issue, update the max rate selection logic in the calculateNewEmissionRate function. The function should choose the lower value between the increased rate and the benchmark rate when utilization exceeds the target.
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.