Skip to content

Latest commit

 

History

History
29 lines (14 loc) · 1.29 KB

122.md

File metadata and controls

29 lines (14 loc) · 1.29 KB

Crazy Jetblack Pigeon

Medium

The undelegation array of a delegator can cause a DoS when calling claimUndelegation

Description and Vulnerability Detail

claimUndelegation is used to claim all undelegations of msg.sender. It iterates over the undelegation array, which is unbounded. This means the array can grow over time if the user doesn't consistently claim their undelegations.

Scenario: Let's say that whenever a new staker is added to the list, the delegator always delegates. If the delegator continues doing this for a long time and eventually undelegates when the staker is removed but doesn't claim the undelegation, the undelegation array can grow too large. This could lead to a DoS, preventing the delegator from claiming their undelegations.

Impact

Delegator will not be able to claim his undelegations.

Tool used

Manual Review

Recommendation

My recommendation is to implement a function that allows claiming a specific index of the undelegation array. By claiming individual indixes, users can reduce the size of the undelegation array, making it possible to call the claimUndelegation function and claim the remaining undelegations in a single call.

References

https://github.com/sherlock-audit/2024-08-morphl2/blob/main/morph/contracts/contracts/l2/staking/L2Staking.sol#L406