Skip to content

Commit fb73721

Browse files
Gajesh2007gpsanant
authored andcommitted
added back comments
1 parent a6434fa commit fb73721

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/contracts/core/DelegationManager.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,19 @@ contract DelegationManager is Initializable, OwnableUpgradeable, Pausable, Deleg
230230
);
231231

232232
// Gather strategies and shares to remove from staker/operator during undelegation
233+
// Undelegation removes ALL currently-active strategies and shares
233234
(IStrategy[] memory strategies, uint256[] memory shares) = getDelegatableShares(staker);
234235

236+
// emit an event if this action was not initiated by the staker themselves
235237
if (msg.sender != staker) {
236238
emit StakerForceUndelegated(staker, operator);
237239
}
238240

241+
// undelegate the staker
239242
emit StakerUndelegated(staker, operator);
240243
delegatedTo[staker] = address(0);
241244

245+
// if no delegatable shares, return zero root, and don't queue a withdrawal
242246
if (strategies.length == 0) {
243247
withdrawalRoots = new bytes32[](0);
244248
} else {

0 commit comments

Comments
 (0)