Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 416f144

Browse files
bowenli860xClandestine
authored andcommittedMay 21, 2025
feat: simplify removeDepositShares in StrategyManager (#1373)
**Motivation:** the _removeDepositShares() returns a bool which is not of any meaning. simplify removeDepositShares in StrategyManager by removing that returned value **Modifications:** simplify _removeDepositShares() by removing returned extra bool **Result:** _removeDepositShares() is simplified and binary size is reduced
1 parent 6e89a71 commit 416f144

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)
Please sign in to comment.