diff --git a/src/contracts/interfaces/IDelegationManager.sol b/src/contracts/interfaces/IDelegationManager.sol index 18f79d5617..17c9c703ba 100644 --- a/src/contracts/interfaces/IDelegationManager.sol +++ b/src/contracts/interfaces/IDelegationManager.sol @@ -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. @@ -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. @@ -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. diff --git a/src/contracts/libraries/SlashingLib.sol b/src/contracts/libraries/SlashingLib.sol index a404e4cfc2..b7e06e5e91 100644 --- a/src/contracts/libraries/SlashingLib.sol +++ b/src/contracts/libraries/SlashingLib.sol @@ -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