The RAACMinter contract manages the dynamic emission of RAAC tokens, and its behavior is influenced by an emission update interval. The function setEmissionUpdateInterval is intended to allow administrators (with the UPDATER_ROLE) to adjust how frequently emission rates are updated. However, the function only checks that the new interval is non-zero and does not exceed the maximum allowed interval; it omits a crucial validation to ensure that the new interval is not lower than the BASE_EMISSION_UPDATE_INTERVAL. Without this check, an administrator could set an interval that is shorter than the base threshold, potentially leading to excessively frequent updates and erratic emission behavior, which can cause operational instability and inefficient gas usage.
The function setEmissionUpdateInterval is implemented as follows:
Issue:
The function lacks a check that enforces:
Minimum Interval Validation: The new update interval must not be less than BASE_EMISSION_UPDATE_INTERVAL.
This oversight means that an administrator with the UPDATER_ROLE could set the emission update interval to a value lower than the base (which is intended to be the minimum acceptable interval), leading to overly frequent emission rate updates.
Excessive Emission Updates:
Setting an interval below the base threshold could result in the system recalculating and updating emission rates too frequently. This may lead to unpredictable token emission behavior, potentially destabilizing the protocol's economic model.
Increased Gas Costs:
Overly frequent updates can significantly increase gas consumption, affecting both the protocol’s efficiency and user experience.
Operational Instability:
Erratic emission updates can create a misalignment between the intended emissions schedule and the actual minting behavior, potentially leading to unexpected token inflation or deflation.
Initial State:
The contract defines a constant BASE_EMISSION_UPDATE_INTERVAL (e.g., 1 day) that represents the minimum allowable interval for updating emission rates.
Faulty Parameter Update:
An administrator calls setEmissionUpdateInterval with a value lower than BASE_EMISSION_UPDATE_INTERVAL (e.g., 12 hours). Because the function only checks for zero and a maximum limit, it accepts the value.
Resulting Behavior:
The emission update interval is set to an undesirably low value, resulting in frequent recalculations of the emission rate, which could lead to operational inefficiencies and unpredictable token minting behavior.
Below is a simplified Foundry test case that demonstrates the vulnerability:
Initialize a Foundry Project:
Place Contract Files:
Ensure that RAACMinter.sol and RAACToken.sol are in the src directory.
Create a Test Directory:
Create a test directory adjacent to src and add the test file (e.g., RAACMinterEmissionTest.t.sol).
Run the Test:
Expected Outcome:
The test should not revert, confirming that the function should accepts intervals below the base threshold. (In the current implementation, this check is missing.)
Erratic Emission Behavior:
Without enforcing a minimum update interval, the protocol may experience too frequent emission updates, leading to inconsistent token minting and potential market instability.
Increased Operational Costs:
Overly frequent updates can increase gas usage and computational overhead, impacting the protocol’s efficiency.
Unpredictable Economic Outcomes:
The dynamic emissions strategy relies on a stable update interval. Allowing an interval below the base threshold may result in misaligned token supply and unexpected inflation/deflation effects.
Manual Review
Foundry
To resolve this vulnerability, update the setEmissionUpdateInterval function to enforce that the new interval is not below the BASE_EMISSION_UPDATE_INTERVAL.
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.