-
Notifications
You must be signed in to change notification settings - Fork 8
lil.eth - Delegation Limitation in Voting Power Management #142
Comments
Hello, Thanks a lot for your attention. After an in-depth review, we have to consider your issue as Invalid. Regards, |
Hi @0xR3vert @shalbe-cvg @walk-on-me, Could point me to the existing function you are pointing to that is present during the time of the audit? |
Hello, this is the function |
Agree with sponsor, since |
Escalate
The The only way for the owner to remove delegation from ONE delegate is using the Perhaps recommendations from #202 and #206 reports will help to better understand this problem. This problem is described in this report and in #202, #206 reports. Other reports describe different problems. They are hardly duplicates of this issue. |
You've created a valid escalation! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
@shalbe-cvg @walk-on-me @0xR3vert @ChechetkinVV I think I agree with watsons in the sense that it seems not intended to remove all delegations once max delegation number is reached just to adjust voting power or to remove a single delegatee, for both mgCVG and veCVG. I think what the watsons are mentioning is that this would then open up a scenario of potential front-running for delegatees themselves to permanently always have max delegated mgCVG or veCVG, so it would permanently DoS the original delegator from updating/removing delegatee. |
From my understanding, this issue presents an issue of breaking core functionality (despite the contracts working according to the design, core intended functionality is impacted). I believe this is sufficient to warrant medium severity for the issue. @nevillehuang which issues should and which shouldn't be duplicated with this one? Do you agree with the escalation? |
@Czar102, As I understand, there are two current impacts
This is what I think are duplicates:
Both impact arises from the |
Thank you for the summary @nevillehuang. I'm planning to consider all other issues (apart from #142, #202, #206) low, hence they will not be considered duplicates anymore (see docs). The three issues describing a Medium severity impact will be considered duplicates and be rewarded. |
Result: |
Escalations have been resolved successfully! Escalation status:
|
lil.eth
medium
Delegation Limitation in Voting Power Management
Summary
MgCVG Voting power delegation system is constrained by 2 hard limits, first on the number of tokens delegated to one user (
maxTokenIdsDelegated = 25
) and second on the number of delegatees for one token (maxMgDelegatees = 5
). Once this limit is reached for a token, the token owner cannot modify the delegation percentage to an existing delegated user. This inflexibility can prevent efficient and dynamic management of delegated voting power.Vulnerability Detail
Observe these lines :
if either
maxMgDelegatees
ormaxTokenIdsDelegated
are reached, delegation is no longer possible.The problem is the fact that this function can be either used to delegate or to update percentage of delegation or also to remove a delegation but in cases where we already delegated to a maximum of users (
maxMgDelegatees
) OR the user to who we delegated has reached the maximum number of tokens that can be delegated to him/her (maxTokenIdsDelegated
), an update or a removal of delegation is no longer possible.6 scenarios are possible :
maxTokenIdsDelegated
is set to 5, Alice is the third to delegate her voting power to Bob and choose to delegate 10% to him. Bob gets 2 other people delegating their tokens to him, Alice wants to increase the power delegated to Bob to 50% but she cannot due to Bob reachingmaxTokenIdsDelegated
maxTokenIdsDelegated
is set to 25, Alice is the 10th to delegate her voting power to Bob and choose to delegate 10%, DAO decreasemaxTokenIdsDelegated
to 3, Alice wants to increase the power delegated to Bob to 50%, but she cannot due to thismaxTokenIdsDelegated
is set to 5, Alice is the third to delegate her voting power to Bob and choose to delegate 90%. Bob gets 2 other people delegating their tokens to him, Alice wants to only remove the power delegated to Bob using this function, but she cannot due to thismaxMgDelegatees
is set to 3, Alice delegates her voting power to Bob,Charly and Donald by 20% each, Alice reachesmaxMgDelegatees
and she cannot update her voting power for any of Bob,Charly or DonaldmaxMgDelegatees
is set to 5, Alice delegates her voting power to Bob,Charly and Donald by 20% each,DAO decreasesmaxMgDelegatees
to 3. Alice cannot update or remove her voting power delegated to any of Bob,Charly and DonaldmaxMgDelegatees
is set to 3, Alice delegates her voting power to Bob,Charly and Donald by 20% each, Alice wants to only remove her delegation to Bob but she reachedmaxMgDelegatees
so she cannot only remove her delegation to BobA function is provided to remove all user to who we delegated but this function cannot be used as a solution to this problem due to 2 things :
delegateMgCvg()
is clearly defined to allow to delegate OR to remove one delegation OR to update percentage of delegation but in some cases it's impossible which is not acceptablemaxTokenIdsDelegated
and would render impossible for Alice to re-delegate to BobPOC
You can add it to test/ut/delegation/balance-delegation.spec.ts :
Impact
In some cases it is impossible to update percentage delegated or to remove only one delegated percentage then forcing users to remove all their voting power delegatations, taking the risk that someone is faster then them to delegate to their old delegated users and reach threshold for delegation, making impossible for them to re-delegate
Code Snippet
https://github.com/sherlock-audit/2023-11-convergence/blob/main/sherlock-cvg/contracts/Locking/LockingPositionDelegate.sol#L278
Tool used
Manual Review
Recommendation
Separate functions for new delegations and updates : Implement logic that differentiates between adding a new delegatee and updating an existing delegation to allow updates to existing delegations even if the maximum number of delegatees is reached
The text was updated successfully, but these errors were encountered: