diff --git a/src/contracts/core/DelegationManager.sol b/src/contracts/core/DelegationManager.sol index ff779c48a..e47df8135 100644 --- a/src/contracts/core/DelegationManager.sol +++ b/src/contracts/core/DelegationManager.sol @@ -745,7 +745,6 @@ contract DelegationManager is */ /** - * * @notice helper to calculate the new depositScalingFactor after adding shares. This is only used * when a staker is depositing through the StrategyManager or EigenPodManager. A staker's depositScalingFactor * is only updated when they have new deposits and their shares are being increased. @@ -756,7 +755,7 @@ contract DelegationManager is uint64 totalMagnitude, Shares existingShares, OwnedShares addedOwnedShares - ) internal returns (uint256 newDepositScalingFactor) { + ) internal { uint256 newDepositScalingFactor; if (existingShares.unwrap() == 0) { newDepositScalingFactor = WAD / totalMagnitude; diff --git a/src/contracts/interfaces/IDelegationManager.sol b/src/contracts/interfaces/IDelegationManager.sol index 6e2596a4e..18f79d561 100644 --- a/src/contracts/interfaces/IDelegationManager.sol +++ b/src/contracts/interfaces/IDelegationManager.sol @@ -341,18 +341,18 @@ interface IDelegationManager is ISignatureUtils { /** * @notice Decreases a native restaker's delegated share balance in a strategy due to beacon chain slashing. This updates their beaconChainScalingFactor. - * Their operator's scaled shares are also updated (if they are delegated). - * @param staker The address to increase the delegated scaled shares for their operator. - * @param shares The number of shares of beaconChainETHStrategy the staker has, not including scaling factors or - * @param proportionPodBalanceDecrease The proportion of the staker's shares to decrease. This is a fraction of the staker's shares in the strategy. + * Their operator's stakeShares are also updated (if they are delegated). + * @param staker The address to increase the delegated stakeShares for their operator. + * @param existingShares The number of shares the staker already has in the EPM. This does not change upon decreasing shares. + * @param proportionOfOldBalance The current pod owner shares proportion of the previous pod owner shares * - * @dev *If the staker is actively delegated*, then decreases the `staker`'s delegated scaled shares in `strategy` by `scaledShares`. Otherwise does nothing. + * @dev *If the staker is actively delegated*, then decreases the `staker`'s delegated stakeShares in `strategy` by `proportionPodBalanceDecrease` proportion. Otherwise does nothing. * @dev Callable only by the EigenPodManager. */ function decreaseBeaconChainScalingFactor( address staker, - Shares shares, - uint64 proportionPodBalanceDecrease + Shares existingShares, + uint64 proportionOfOldBalance ) external; /** diff --git a/src/contracts/interfaces/IEigenPod.sol b/src/contracts/interfaces/IEigenPod.sol index 33fd4ed61..113e91177 100644 --- a/src/contracts/interfaces/IEigenPod.sol +++ b/src/contracts/interfaces/IEigenPod.sol @@ -13,8 +13,12 @@ import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; * to account balances in terms of gwei in the EigenPod contract and convert to wei when making calls to other contracts */ interface IEigenPod { - /// @dev Thrown when msg.sender is not allowed to call a function - error UnauthorizedCaller(); + /// @dev Thrown when msg.sender is not the EPM. + error OnlyEigenPodManager(); + /// @dev Thrown when msg.sender is not the pod owner. + error OnlyEigenPodOwner(); + /// @dev Thrown when msg.sender is not owner or the proof submitter. + error OnlyEigenPodOwnerOrProofSubmitter(); /// @dev Thrown when attempting an action that is currently paused. error CurrentlyPaused();