The BaseGauge
contract contains an unused distributionCap
state variable and associated setter function that appear to be deprecated in favor of the emission
system, creating unnecessary gas costs and potential confusion.
The contract includes:
A state variable: uint256 public distributionCap
A setter function: setDistributionCap(uint256 newCap)
Associated events for cap updates
However, this functionality is never used in any validation logic. Meanwhile, a newer emission
system in PeriodState
handles reward distribution limits, suggesting that distributionCap
is legacy code that was replaced but not removed.
Code snippet:
Increased gas costs due to unnecessary storage variable and function
Potential confusion for developers and auditors
Misleading contract interface suggesting functionality that isn't actually used
Risk of future developers incorrectly assuming the cap is enforced
Manual review
Remove the unused distributionCap
related code:
- Delete the `distributionCap` state variable
- Remove the `setDistributionCap()` function
- Remove the `DistributionCapUpdated` event
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.