Skip to content

Commit 953ce70

Browse files
committed
fix: remove poc code
1 parent 33d8cf3 commit 953ce70

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

src/contracts/core/DelegationManager.sol

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -529,21 +529,16 @@ contract DelegationManager is
529529
bool receiveAsTokens
530530
) internal {
531531
_checkInputArrayLengths(tokens.length, withdrawal.strategies.length);
532-
if (withdrawal.delegatedTo == address(this)) {
533-
// If this is a redistribution withdrawal // TODO: make this cleaner
534-
require(receiveAsTokens, WithdrawerNotCaller());
535-
} else {
536-
require(msg.sender == withdrawal.withdrawer, WithdrawerNotCaller());
537-
}
532+
533+
require(msg.sender == withdrawal.withdrawer, WithdrawerNotCaller());
538534
bytes32 withdrawalRoot = calculateWithdrawalRoot(withdrawal);
539535
require(pendingWithdrawals[withdrawalRoot], WithdrawalNotQueued());
540536

541537
uint256[] memory prevSlashingFactors;
542538
{
543-
// The slashableUntil block is inclusive, so we verify that the current block number exceeds it
544-
// before allowing the withdrawal to be completed.
545-
uint32 delayBlocks = withdrawal.delegatedTo == address(this) ? 4 days : MIN_WITHDRAWAL_DELAY_BLOCKS;
546-
uint32 slashableUntil = withdrawal.startBlock + delayBlocks;
539+
// slashableUntil is block inclusive so we need to check if the current block is strictly greater than the slashableUntil block
540+
// meaning the withdrawal can be completed.
541+
uint32 slashableUntil = withdrawal.startBlock + MIN_WITHDRAWAL_DELAY_BLOCKS;
547542
require(uint32(block.number) > slashableUntil, WithdrawalDelayNotElapsed());
548543

549544
// Given the max magnitudes of the operator the staker was originally delegated to, calculate
@@ -713,7 +708,9 @@ contract DelegationManager is
713708
// Emit event for operator shares being slashed
714709
emit OperatorSharesSlashed(operator, strategy, totalDepositSharesToBurn);
715710

716-
_getShareManager(strategy).increaseBurnOrRedistributableShares(operatorSet, slashId, strategy, totalDepositSharesToBurn);
711+
_getShareManager(strategy).increaseBurnOrRedistributableShares(
712+
operatorSet, slashId, strategy, totalDepositSharesToBurn
713+
);
717714

718715
return totalDepositSharesToBurn;
719716
}

src/contracts/core/StrategyManager.sol

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,10 @@ contract StrategyManager is
167167
}
168168

169169
/// @inheritdoc IStrategyManager
170-
function decreaseBurnOrRedistributableShares(OperatorSet calldata operatorSet, uint256 slashId) external nonReentrant {
170+
function decreaseBurnOrRedistributableShares(
171+
OperatorSet calldata operatorSet,
172+
uint256 slashId
173+
) external nonReentrant {
171174
EnumerableMap.AddressToUintMap storage burnOrRedistributableShares =
172175
_burnOrRedistributableShares[operatorSet.key()][slashId];
173176

src/contracts/core/StrategyManagerStorage.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ abstract contract StrategyManagerStorage is IStrategyManager {
7979
EnumerableMap.AddressToUintMap internal burnableShares;
8080

8181
/// @notice Returns the amount of `shares` that have been slashed on EigenLayer but not marked for burning or redistribution yet.
82-
mapping(bytes32 operatorSetKey => mapping(uint256 slashId => EnumerableMap.AddressToUintMap)) internal _burnOrRedistributableShares;
82+
mapping(bytes32 operatorSetKey => mapping(uint256 slashId => EnumerableMap.AddressToUintMap)) internal
83+
_burnOrRedistributableShares;
8384

8485
// Construction
8586

src/contracts/interfaces/IStrategyManager.sol

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ interface IStrategyManagerEvents {
5656

5757
/// @notice Emitted when shares are burnt
5858
/// @dev This event is only emitted in the pre-redistribution slash path
59-
event BurnableSharesDecreased(
60-
IStrategy strategy, uint256 shares
61-
);
59+
event BurnableSharesDecreased(IStrategy strategy, uint256 shares);
6260
}
6361

6462
/**

0 commit comments

Comments
 (0)