Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/contracts/core/StrategyManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ contract StrategyManager is
expiry: expiry
});
// Increment the nonce for the staker.
require(nonce < type(uint256).max, "NonceOverflow");
unchecked {
nonces[staker] = nonce + 1;
}
Expand Down Expand Up @@ -365,6 +366,10 @@ contract StrategyManager is
function _removeStrategyFromStakerStrategyList(address staker, IStrategy strategy) internal {
//loop through all of the strategies, find the right one, then replace
uint256 stratsLength = stakerStrategyList[staker].length;

// Additional safety check for empty array
require(stratsLength > 0, "EmptyStrategyList");

uint256 j = 0;
for (; j < stratsLength; ++j) {
if (stakerStrategyList[staker][j] == strategy) {
Expand Down