Skip to content

Commit 7e82d53

Browse files
refactor: review changes (#1411)
**Motivation:** Minor nits. **Modifications:** - Add `slashOperator` return value natspec. - Remove `pause/unpauseRedistribution` codesize optimization. **Result:** Cleaner and shorter diff for audit.
1 parent 4e3bf2e commit 7e82d53

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

src/contracts/core/SlashEscrowFactory.sol

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,15 @@ contract SlashEscrowFactory is Initializable, SlashEscrowFactoryStorage, Ownable
117117
*/
118118

119119
/// @inheritdoc ISlashEscrowFactory
120-
function pauseEscrow(OperatorSet calldata operatorSet, uint256 slashId) external onlyPauser {
121-
_checkNewPausedStatus(operatorSet, slashId, true);
120+
function pauseEscrow(OperatorSet calldata operatorSet, uint256 slashId) external virtual onlyPauser {
121+
require(!_paused[operatorSet.key()][slashId], IPausable.InvalidNewPausedStatus());
122122
_paused[operatorSet.key()][slashId] = true;
123123
emit EscrowPaused(operatorSet, slashId);
124124
}
125125

126126
/// @inheritdoc ISlashEscrowFactory
127-
function unpauseEscrow(OperatorSet calldata operatorSet, uint256 slashId) external onlyUnpauser {
128-
_checkNewPausedStatus(operatorSet, slashId, false);
127+
function unpauseEscrow(OperatorSet calldata operatorSet, uint256 slashId) external virtual onlyUnpauser {
128+
require(_paused[operatorSet.key()][slashId], IPausable.InvalidNewPausedStatus());
129129
_paused[operatorSet.key()][slashId] = false;
130130
emit EscrowUnpaused(operatorSet, slashId);
131131
}
@@ -208,16 +208,6 @@ contract SlashEscrowFactory is Initializable, SlashEscrowFactoryStorage, Ownable
208208
emit GlobalEscrowDelaySet(delay);
209209
}
210210

211-
/// @notice Checks that the new paused status is not the same as the current paused status.
212-
/// @dev This is needed for event sanitization.
213-
function _checkNewPausedStatus(
214-
OperatorSet calldata operatorSet,
215-
uint256 slashId,
216-
bool newPauseStatus
217-
) internal view {
218-
require(_paused[operatorSet.key()][slashId] != newPauseStatus, IPausable.InvalidNewPausedStatus());
219-
}
220-
221211
/**
222212
* @notice Deploys a `SlashEscrow`
223213
* @param operatorSet The operator set whose slash escrow is being deployed.
@@ -363,7 +353,7 @@ contract SlashEscrowFactory is Initializable, SlashEscrowFactoryStorage, Ownable
363353

364354
/// @inheritdoc ISlashEscrowFactory
365355
function isEscrowPaused(OperatorSet calldata operatorSet, uint256 slashId) public view returns (bool) {
366-
return _paused[operatorSet.key()][slashId];
356+
return _paused[operatorSet.key()][slashId] || paused(PAUSED_RELEASE_ESCROW);
367357
}
368358

369359
/// @inheritdoc ISlashEscrowFactory

src/contracts/interfaces/IAllocationManager.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ interface IAllocationManager is IAllocationManagerErrors, IAllocationManagerEven
250250
* @dev Small slashing amounts may not result in actual token burns due to
251251
* rounding, which will result in small amounts of tokens locked in the contract
252252
* rather than fully burning through the burn mechanism.
253+
* @return slashId The operator set's unique identifier for the slash.
254+
* @return shares The number of shares to be burned or redistributed for each strategy that was slashed.
253255
*/
254256
function slashOperator(
255257
address avs,

0 commit comments

Comments
 (0)