This repository has been archived by the owner on Jun 2, 2024. It is now read-only.
lil.eth - Gauges cannot be added back to gaugeController #112
Labels
Non-Reward
This issue will not receive a payout
lil.eth
medium
Gauges cannot be added back to gaugeController
Summary
Convergence protocol allows to add gauges contracts that gets distributed CVG inflations tokens regarding how many votes are allocated on them.
Gauges can be killed using
gaugeController.vy#kill_gauge()
but types mapping is not cleared when removing a gauge, which prevents the same gauge from being added back later andkilled_gauges
mapping cannot be toggled to False when adding a gauge which could prevent user from voting to a re-added gauge.Vulnerability Detail
The
kill_gauge()
function marks a gauge as killed by settingkilled_gauges[addr] = True
:but there is no functionality to toggle this back to False, even if the gauge is re-added.
Moreover the
gauge_types_[addr]
is also maintained to the set-up value of the gauge on gauge addition which also render impossible to re-add due to the check onadd_gauge()
function :Impact
The
add_gauge()
function is broken in the edge case when the updater tries to add the gauge back into the registry after removing it. It affects all the operations of the protocol that rely on the gauge registry.POC
Add this on 01_integration-test.spec.ts :
Code Snippet
https://github.com/sherlock-audit/2023-11-convergence/blob/main/sherlock-cvg/contracts/Locking/GaugeController.vy#L396
Tool used
Manual Review
Old Tokemak report : sherlock-audit/2023-06-tokemak-judging#674
Recommendation
Toggle back to false the killed gauge mapping when adding a gauge and set gauge_types_[addr] to 0 when killing it :
Duplicate of #187
The text was updated successfully, but these errors were encountered: