Handsome Wool Bat
High
https://github.com/sherlock-audit/2024-08-morphl2/blob/main/morph/contracts/contracts/l2/staking/L2Staking.sol#L252-L275 The function startReward performs insertion sort on stakerAddresses. However, the implementation of the sorting algorithm was wrong, causing stakerRankings to not be sorted correctly.
In L2Staking.sol#startReward
, the insertion sort is implemented incorrectly.
- Admin call startReward.
No response
No response
The state of stakerRankings will be incorrect.
No response
Reimplement insertion sort correctly.