Skip to content

Commit c75b790

Browse files
committed
feat: simplify removeDepositShares in StrategyManager
1 parent 0c182e5 commit c75b790

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/contracts/core/StrategyManager.sol

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ contract StrategyManager is
118118
IStrategy strategy,
119119
uint256 depositSharesToRemove
120120
) external onlyDelegationManager nonReentrant returns (uint256) {
121-
(, uint256 sharesAfter) = _removeDepositShares(staker, strategy, depositSharesToRemove);
122-
return sharesAfter;
121+
return _removeDepositShares(staker, strategy, depositSharesToRemove);
123122
}
124123

125124
/// @inheritdoc IShareManager
@@ -280,7 +279,7 @@ contract StrategyManager is
280279
address staker,
281280
IStrategy strategy,
282281
uint256 depositSharesToRemove
283-
) internal returns (bool, uint256) {
282+
) internal returns (uint256) {
284283
// sanity checks on inputs
285284
require(depositSharesToRemove != 0, SharesAmountZero());
286285

@@ -298,12 +297,9 @@ contract StrategyManager is
298297
// if no existing shares, remove the strategy from the staker's dynamic array of strategies
299298
if (userDepositShares == 0) {
300299
_removeStrategyFromStakerStrategyList(staker, strategy);
301-
302-
// return true in the event that the strategy was removed from stakerStrategyList[staker]
303-
return (true, userDepositShares);
304300
}
305-
// return false in the event that the strategy was *not* removed from stakerStrategyList[staker]
306-
return (false, userDepositShares);
301+
302+
return userDepositShares;
307303
}
308304

309305
/**

0 commit comments

Comments
 (0)