Platform: Code4rena
Start Date: 12/08/2022
Pot Size: $35,000 USDC
Total HM: 10
Participants: 126
Period: 3 days
Judge: Justin Goro
Total Solo HM: 3
Id: 154
League: ETH
Rank: 11/126
Findings: 1
Award: $541.65
π Selected for report: 1
π Solo Findings: 0
π Selected for report: PwnedNoMore
Also found by: CertoraInc, ak1, scaraven
541.6482 USDC - $541.65
increaseUnlockTime
missing _checkpoint
for delegated values.In the VotingEscrow contract, users can increase their voting power by:
Specifically, when users are delegated by other users through the delegate
function, the delegated user gains control over the delegate funds from the delegating user.
The delegated user can further increase this power by increasing the time that the delegated funds are locked by calling increaseUnlockTime
, resulting in ALL the delegated funds controlled by the delegated user, including those that do not originate from the delegated user, being used to increase the voting power of the user.
The issue lies in the following scenario: If user A delegates to user B, and then user B delegates to user C, user B loses the ability to extend his or her voting power by increaseUnlockTime
due to a missing _checkpoint
operation. If user B calls the increaseUnlockTime
function, the _checkpoint
operation will not proceed, as user B is delegating to user C. However, B still owns delegated funds, in the form of the funds delegated from user A. Therefore, user B should still gain voting power from increaseUnlockTime
, even though user B is delegating.
Assume three users, Alice, Bob, and Carol, who each possess locks
with 10 units of delegate
value. Also assume that the unlock time is 1 week.
delegate
, value, Bob has 10 delegate
value, and Carol has 20 delegate
value.increaseUnlockTime
to 2 weeks, resulting in _checkpoint
raising her voting power accordingly.increaseUnlockTime
to 2 weeks, resulting in no change in his voting power, even though he has 10 units of delegate
value.Move the _checkpoint
outside of the if
statement on line 514.
#0 - lacoop6tu
2022-08-17T10:46:51Z
As most of wardens reported in duplicated, this is Medium finding 2 β Med: Assets not at direct risk, but the function of the protocol or its availability could be impacted, or leak value with a hypothetical attack path with stated assumptions, but external requirements.