Variable shadowing [totalVotes] in BaseGauge.
The processVote() function in the BaseGauge contract has a potential issue with variable shadowing. The function takes a parameter named totalVotes, which is also the name of a state variable in the contract. This can lead to confusion about which totalVotes is being referred to within the function, especially when performing operations like totalVotes - vote.weight + votingPower.
Variable shadowing can lead to unintended behavior if the wrong variable is used in calculations or logic, potentially affecting the accuracy of vote processing and the integrity of the voting system.
Reduces code readability.
Manual Review
To avoid confusion and potential errors, rename the function parameter to something distinct, such as currentTotalVotes, to clearly differentiate it from the state variable. This will help ensure that the correct variable is used in calculations and improve code readability.
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.