Skip to content

Commit

Permalink
chore: comment out block to be refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
8sunyuan committed Sep 13, 2024
1 parent 857da0f commit af89ed3
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions src/contracts/core/DelegationManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -709,25 +709,27 @@ contract DelegationManager is
*/
if (withdrawal.strategies[i] == beaconChainETHStrategy) {
// TODO: REFACTOR EPM AND NEGATIVE SHARES

address staker = withdrawal.staker;
/**
* Update shares amount depending upon the returned value.
* The return value will be lower than the input value in the case where the staker has an existing share deficit
*/
(shares, existingShares) = eigenPodManager.addShares({podOwner: staker, shares: shares});
address podOwnerOperator = delegatedTo[staker];
// Similar to `isDelegated` logic
if (podOwnerOperator != address(0)) {
_increaseOperatorScaledShares({
operator: podOwnerOperator,
// the 'staker' here is the address receiving new shares
staker: staker,
strategy: withdrawal.strategies[i],
shares: shares,
totalMagnitude: totalMagnitudes[i]
});
}
// below commented code will simply be the following:
// eigenPodManager.addShares({podOwner: withdrawal.staker, shares: shares});

// address staker = withdrawal.staker;
// /**
// * Update shares amount depending upon the returned value.
// * The return value will be lower than the input value in the case where the staker has an existing share deficit
// */
// (shares, existingShares) = eigenPodManager.addShares({podOwner: staker, shares: shares});
// address podOwnerOperator = delegatedTo[staker];
// // Similar to `isDelegated` logic
// if (podOwnerOperator != address(0)) {
// _increaseOperatorScaledShares({
// operator: podOwnerOperator,
// // the 'staker' here is the address receiving new shares
// staker: staker,
// strategy: withdrawal.strategies[i],
// shares: shares,
// totalMagnitude: totalMagnitudes[i]
// });
// }
} else {
strategyManager.addShares(msg.sender, tokens[i], withdrawal.strategies[i], shares);
}
Expand Down

0 comments on commit af89ed3

Please sign in to comment.