Platform: Code4rena
Start Date: 07/08/2023
Pot Size: $36,500 USDC
Total HM: 11
Participants: 125
Period: 3 days
Judge: alcueca
Total Solo HM: 4
Id: 274
League: ETH
Rank: 54/125
Findings: 1
Award: $21.60
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: ltyu
Also found by: 0xDING99YA, 3docSec, KmanOfficial, MrPotatoMagic, RED-LOTUS-REACH, Tendency, Yuki, bart1e, bin2chen, carrotsmuggler, cducrest, kaden, mert_eren, pep7siup, popular00, qpzm, seerether, zhaojie
21.6049 USDC - $21.60
https://github.com/code-423n4/2023-08-verwa/blob/9a2e7be003bc1a77b3b87db31f3d5a1bcb48ed32/src/VotingEscrow.sol#L366 https://github.com/code-423n4/2023-08-verwa/blob/9a2e7be003bc1a77b3b87db31f3d5a1bcb48ed32/src/VotingEscrow.sol#L398 https://github.com/code-423n4/2023-08-verwa/blob/9a2e7be003bc1a77b3b87db31f3d5a1bcb48ed32/src/VotingEscrow.sol#L331
User A will not be able to withdraw their tokens even after their lock expires if the delegatee (User B) has -withdrawn their lock.
User A is essentially "orphaned" - their delegatee withdrew so they have no voting power, but their lock still shows a delegation.
User A will not be able to withdraw their tokens even after their lock expires if the delegatee (User B) has withdrawn their lock.
The key parts of the code that lead to this are:
In delegate() - This updates the delegatee address on User A's lock struct to User B : https://github.com/code-423n4/2023-08-verwa/blob/9a2e7be003bc1a77b3b87db31f3d5a1bcb48ed32/src/VotingEscrow.sol#L366
And in _delegate() - This subtracts the delegated amount from User B's lock struct when User B withdraws: https://github.com/code-423n4/2023-08-verwa/blob/9a2e7be003bc1a77b3b87db31f3d5a1bcb48ed32/src/VotingEscrow.sol#L398
However, there is no code that resets User A's delegatee address back to their own address when User B withdraws. So the sequence would be:
Manual
reset the delegator's delegatee address to their own address when the delegatee withdraws their lock
Other
#0 - c4-pre-sort
2023-08-11T11:55:44Z
141345 marked the issue as duplicate of #223
#1 - c4-pre-sort
2023-08-13T11:50:44Z
141345 marked the issue as not a duplicate
#2 - c4-pre-sort
2023-08-13T16:40:24Z
141345 marked the issue as duplicate of #112
#3 - 141345
2023-08-13T16:40:57Z
it's not about delegatee withdraw or not
#4 - c4-pre-sort
2023-08-14T07:18:56Z
141345 marked the issue as not a duplicate
#5 - c4-pre-sort
2023-08-14T07:19:10Z
141345 marked the issue as low quality report
#6 - c4-pre-sort
2023-08-14T07:30:29Z
141345 marked the issue as duplicate of #471
#7 - c4-judge
2023-08-25T11:26:25Z
alcueca marked the issue as not a duplicate
#8 - c4-judge
2023-08-25T11:26:34Z
alcueca changed the severity to 2 (Med Risk)
#9 - c4-judge
2023-08-25T11:27:10Z
alcueca marked the issue as duplicate of #268
#10 - c4-judge
2023-08-25T11:27:14Z
alcueca marked the issue as partial-50
#11 - c4-judge
2023-08-26T21:24:29Z
alcueca changed the severity to 3 (High Risk)