This repository has been archived by the owner on Jun 2, 2024. It is now read-only.
ZanyBonzy - change_gauge_weight
can be front ran to gain extra voting power
#96
Labels
Non-Reward
This issue will not receive a payout
ZanyBonzy
medium
change_gauge_weight
can be front ran to gain extra voting powerSummary
Users can front-run calls to the
change_gauge_weight
and gain extra voting power.Vulnerability Detail
In a case where the admin decides to increase/decrease gauge weight, a user actively monitoring the mempool can front run the call. He can remove his votes from the gauge, reducing the weight prior to the admin changing gauge weight. Once admin changes gauge weight, the user then votes for the gauge, increasing the gauge weight to more than was expected to be.
change_gauge_weight
function with a value of 500 weight;Impact
Code Snippet
https://github.com/sherlock-audit/2023-11-convergence/blob/e894be3e36614a385cf409dc7e278d5b8f16d6f2/sherlock-cvg/contracts/Locking/GaugeController.vy#L593
Tool used
Manual Review
Recommendation
Use increase/decrease methods to change weight instead of a set value.
Duplicate of #122
The text was updated successfully, but these errors were encountered: