Skip to content

Commit

Permalink
remove DM diff
Browse files Browse the repository at this point in the history
  • Loading branch information
gpsanant committed Sep 25, 2024
1 parent 64681f8 commit 97aec34
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 13 deletions.
43 changes: 34 additions & 9 deletions src/contracts/interfaces/IDelegationManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,24 @@ import "../libraries/SlashingLib.sol";
* - enabling a staker to undelegate its assets from the operator it is delegated to (performed as part of the withdrawal process, initiated through the StrategyManager)
*/
interface IDelegationManager is ISignatureUtils {
/// @dev Thrown when msg.sender is not allowed to call a function
error UnauthorizedCaller();
/// @dev Thrown when msg.sender is not the EigenPodManager
error OnlyEigenPodManager();

/// Delegation Status

/// @dev Thrown when an account is currently delegated.
error AlreadyDelegated();
/// @dev Thrown when an account is not currently delegated.
error NotCurrentlyDelegated();
/// @dev Thrown when an operator attempts to undelegate.
error OperatorsCannotUndelegate();
/// @dev Thrown when `operator` is not a registered operator.
error OperatorDoesNotExist();

/// Invalid Inputs

/// @dev Thrown when an account is actively delegated.
error ActivelyDelegated();
/// @dev Thrown when attempting to execute an action that was not queued.
Expand All @@ -32,20 +50,27 @@ interface IDelegationManager is ISignatureUtils {
error OperatorNotRegistered();
/// @dev Thrown when caller is neither the StrategyManager or EigenPodManager contract.
error OnlyStrategyManagerOrEigenPodManager();
/// @dev Thrown when caller is not the EigenPodManager contract.
error OnlyEigenPodManager();
/// @dev Thrown when an operator attempts to undelegate.
error OperatorsCannotUndelegate();

/// @dev Thrown when an account is not actively delegated.
error NotActivelyDelegated();
/// @dev Thrown when attempting to spend a spent eip-712 salt.
error SaltSpent();
/// @dev Thrown when attempting to use an expired eip-712 signature.
error SignatureExpired();
/// @dev Thrown when provided `stakerOptOutWindowBlocks` cannot decrease.
error StakerOptOutWindowBlocksCannotDecrease();
/// @dev Thrown when provided `stakerOptOutWindowBlocks` exceeds maximum.
error StakerOptOutWindowBlocksExceedsMax();
/// @dev Thrown when provided delay exceeds maximum.
error WithdrawalDelayExceedsMax();

/// Signatures

/// @dev Thrown when attempting to spend a spent eip-712 salt.
error SaltSpent();
/// @dev Thrown when attempting to use an expired eip-712 signature.
error SignatureExpired();

/// Withdrawal Processing

/// @dev Thrown when attempting to execute an action that was not queued.
error WithdrawalDoesNotExist();
/// @dev Thrown when attempting to withdraw before delay has elapsed.
error WithdrawalDelayNotElapsed();
/// @dev Thrown when provided delay exceeds maximum.
Expand Down Expand Up @@ -339,7 +364,7 @@ interface IDelegationManager is ISignatureUtils {
OwnedShares addedOwnedShares
) external;

/**
/**
* @notice Decreases a native restaker's delegated share balance in a strategy due to beacon chain slashing. This updates their beaconChainScalingFactor.
* Their operator's stakeShares are also updated (if they are delegated).
* @param staker The address to increase the delegated stakeShares for their operator.
Expand Down
4 changes: 0 additions & 4 deletions src/contracts/libraries/SlashingLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ import "@openzeppelin/contracts/utils/math/Math.sol";
/// and divide to represent as 1
uint64 constant WAD = 1e18;

/// @dev Delay before deallocations are completable and can be added back into freeMagnitude
/// This is also the same delay for withdrawals to be completable
uint32 constant DEALLOCATION_DELAY = 17.5 days;

/*
* There are 3 types of shares:
* 1. shares
Expand Down

0 comments on commit 97aec34

Please sign in to comment.