Hardcoded values can be a bottleneck for other users of the protocol deploying without making the needed updates.
The GaugeController contract is a critical component of the RAAC protocol, responsible for managing gauge weights and reward distribution for RWA and RAAC emissions. It implements a Curve-style gauge voting and reward distribution system, allowing users to vote with veRAACToken to allocate weights to gauges. These weights determine emission rates for each gauge, and boost multipliers are calculated based on veToken holdings. The contract also includes revenue sharing and emergency controls.
Within this contract, the functions _calculateRWAEmission() and _calculateRAACEmission() are responsible for calculating the emission rates for RWA and RAAC gauges, respectively. However, these functions contain hardcoded values for the emission rates, specifically 1000000 * 10**18 for RWA and 250000 * 10**18 for RAAC. These hardcoded values limit the flexibility of the contract, as they do not allow for dynamic adjustment of emission rates based on changing tokenomics or protocol requirements.
The highest impact scenario occurs when the protocol's tokenomics change, requiring an adjustment to the emission rates. With the current hardcoded values, any such change would necessitate a contract upgrade, which can be costly and time-consuming. Additionally, the lack of flexibility could lead to suboptimal reward distribution, potentially affecting the economic balance of the system and user satisfaction.
The inflexibility caused by hardcoded emission rates can lead to several issues:
Inability to adapt to changing tokenomics without a contract upgrade.
Potential imbalances in reward distribution, affecting user satisfaction and protocol stability.
Increased costs and time associated with contract upgrades.
Manual Review
To address this issue, the emission rate calculations should be made dynamic, allowing for adjustments based on protocol requirements. This can be achieved by introducing state variables for the emission rates and providing functions to update these values. Here is a suggested code fix:
This approach allows for dynamic adjustment of emission rates, enhancing the flexibility and adaptability of the GaugeController contract.
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.