Skip to content

Commit 623d16a

Browse files
committed
chore: naming
1 parent c2adaee commit 623d16a

File tree

6 files changed

+175
-201
lines changed

6 files changed

+175
-201
lines changed

src/contracts/core/SlashEscrow.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ contract SlashEscrow is ISlashEscrow {
1111
using SafeERC20 for IERC20;
1212

1313
/// @inheritdoc ISlashEscrow
14-
function burnOrRedistributeUnderlyingTokens(
14+
function releaseTokens(
1515
ISlashEscrowFactory slashEscrowFactory,
1616
ISlashEscrow slashEscrowImplementation,
1717
OperatorSet calldata operatorSet,

src/contracts/core/SlashEscrowFactory.sol

Lines changed: 30 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ contract SlashEscrowFactory is Initializable, SlashEscrowFactoryStorage, Ownable
4242
) external initializer {
4343
_transferOwnership(initialOwner);
4444
_setPausedStatus(initialPausedStatus);
45-
_setGlobalBurnOrRedistributionDelay(initialGlobalDelayBlocks);
45+
_setGlobalEscrowDelay(initialGlobalDelayBlocks);
4646
}
4747

4848
/**
@@ -72,14 +72,14 @@ contract SlashEscrowFactory is Initializable, SlashEscrowFactoryStorage, Ownable
7272

7373
// Set the start block for the slash ID.
7474
_slashIdToStartBlock[operatorSet.key()][slashId] = uint32(block.number);
75-
emit StartBurnOrRedistribution(operatorSet, slashId, strategy, uint32(block.number));
75+
emit StartEscrow(operatorSet, slashId, strategy, uint32(block.number));
7676
}
7777

7878
/// @inheritdoc ISlashEscrowFactory
7979
function releaseSlashEscrow(
8080
OperatorSet calldata operatorSet,
8181
uint256 slashId
82-
) external virtual onlyWhenNotPaused(PAUSED_BURN_OR_REDISTRIBUTE_SHARES) {
82+
) external virtual onlyWhenNotPaused(PAUSED_RELEASE_ESCROW) {
8383
address redistributionRecipient = allocationManager.getRedistributionRecipient(operatorSet);
8484

8585
// If the redistribution recipient is not the default burn address...
@@ -88,10 +88,10 @@ contract SlashEscrowFactory is Initializable, SlashEscrowFactoryStorage, Ownable
8888
}
8989

9090
// Assert that the slash ID is not paused
91-
require(!isBurnOrRedistributionPaused(operatorSet, slashId), IPausable.CurrentlyPaused());
91+
require(!isEscrowPaused(operatorSet, slashId), IPausable.CurrentlyPaused());
9292

9393
// Assert that the escrow delay has elapsed
94-
require(block.number >= getBurnOrRedistributionCompleteBlock(operatorSet, slashId), EscrowDelayNotElapsed());
94+
require(block.number >= getEscrowCompleteBlock(operatorSet, slashId), EscrowDelayNotElapsed());
9595

9696
// Calling `decreaseBurnOrRedistributableShares` will transfer the underlying tokens to the `SlashEscrow`.
9797
// NOTE: While `decreaseBurnOrRedistributableShares` may have already been called, we call it again to ensure that the
@@ -114,7 +114,7 @@ contract SlashEscrowFactory is Initializable, SlashEscrowFactoryStorage, Ownable
114114
address strategy = pendingStrategiesForSlashId.at(i - 1);
115115

116116
// Burn or redistribute the underlying tokens for the strategy.
117-
slashEscrow.burnOrRedistributeUnderlyingTokens(
117+
slashEscrow.releaseTokens(
118118
ISlashEscrowFactory(address(this)),
119119
slashEscrowImplementation,
120120
operatorSet,
@@ -125,7 +125,7 @@ contract SlashEscrowFactory is Initializable, SlashEscrowFactoryStorage, Ownable
125125

126126
// Remove the strategy and underlying amount from the pending burn or redistributions map.
127127
pendingStrategiesForSlashId.remove(strategy);
128-
emit BurnOrRedistributionComplete(operatorSet, slashId, IStrategy(strategy), redistributionRecipient);
128+
emit EscrowComplete(operatorSet, slashId, IStrategy(strategy), redistributionRecipient);
129129
}
130130

131131
// Remove the slash ID from the pending slash IDs set.
@@ -161,17 +161,17 @@ contract SlashEscrowFactory is Initializable, SlashEscrowFactoryStorage, Ownable
161161
*/
162162

163163
/// @inheritdoc ISlashEscrowFactory
164-
function pauseRedistribution(OperatorSet calldata operatorSet, uint256 slashId) external virtual onlyPauser {
164+
function pauseEscrow(OperatorSet calldata operatorSet, uint256 slashId) external virtual onlyPauser {
165165
_checkNewPausedStatus(operatorSet, slashId, true);
166166
_paused[operatorSet.key()][slashId] = true;
167-
emit RedistributionPaused(operatorSet, slashId);
167+
emit EscrowPaused(operatorSet, slashId);
168168
}
169169

170170
/// @inheritdoc ISlashEscrowFactory
171-
function unpauseRedistribution(OperatorSet calldata operatorSet, uint256 slashId) external virtual onlyUnpauser {
171+
function unpauseEscrow(OperatorSet calldata operatorSet, uint256 slashId) external virtual onlyUnpauser {
172172
_checkNewPausedStatus(operatorSet, slashId, false);
173173
_paused[operatorSet.key()][slashId] = false;
174-
emit RedistributionUnpaused(operatorSet, slashId);
174+
emit EscrowUnPaused(operatorSet, slashId);
175175
}
176176

177177
/**
@@ -181,28 +181,28 @@ contract SlashEscrowFactory is Initializable, SlashEscrowFactoryStorage, Ownable
181181
*/
182182

183183
/// @inheritdoc ISlashEscrowFactory
184-
function setGlobalBurnOrRedistributionDelay(
184+
function setGlobalEscrowDelay(
185185
uint32 delay
186186
) external onlyOwner {
187-
_setGlobalBurnOrRedistributionDelay(delay);
187+
_setGlobalEscrowDelay(delay);
188188
}
189189

190190
/// @inheritdoc ISlashEscrowFactory
191-
function setStrategyBurnOrRedistributionDelay(IStrategy strategy, uint32 delay) external onlyOwner {
192-
_strategyBurnOrRedistributionDelayBlocks[address(strategy)] = delay;
193-
emit StrategyBurnOrRedistributionDelaySet(strategy, delay);
191+
function setStrategyEscrowDelay(IStrategy strategy, uint32 delay) external onlyOwner {
192+
_strategyEscrowDelayBlocks[address(strategy)] = delay;
193+
emit StrategyEscrowDelaySet(strategy, delay);
194194
}
195195

196196
/**
197197
*
198198
* HELPERS
199199
*
200200
*/
201-
function _setGlobalBurnOrRedistributionDelay(
201+
function _setGlobalEscrowDelay(
202202
uint32 delay
203203
) internal {
204-
_globalBurnOrRedistributionDelayBlocks = delay;
205-
emit GlobalBurnOrRedistributionDelaySet(delay);
204+
_globalEscrowDelayBlocks = delay;
205+
emit GlobalEscrowDelaySet(delay);
206206
}
207207

208208
/// @notice Checks that the new paused status is not the same as the current paused status.
@@ -287,7 +287,7 @@ contract SlashEscrowFactory is Initializable, SlashEscrowFactoryStorage, Ownable
287287
// For each slashId, get the complete block.
288288
completeBlocks[i] = new uint32[](slashIds[i].length);
289289
for (uint256 j = 0; j < slashIds[i].length; j++) {
290-
completeBlocks[i][j] = getBurnOrRedistributionCompleteBlock(operatorSets[i], slashIds[i][j]);
290+
completeBlocks[i][j] = getEscrowCompleteBlock(operatorSets[i], slashIds[i][j]);
291291
}
292292
}
293293
}
@@ -349,55 +349,46 @@ contract SlashEscrowFactory is Initializable, SlashEscrowFactoryStorage, Ownable
349349
}
350350

351351
/// @inheritdoc ISlashEscrowFactory
352-
function isBurnOrRedistributionPaused(
353-
OperatorSet calldata operatorSet,
354-
uint256 slashId
355-
) public view returns (bool) {
352+
function isEscrowPaused(OperatorSet calldata operatorSet, uint256 slashId) public view returns (bool) {
356353
return _paused[operatorSet.key()][slashId];
357354
}
358355

359356
/// @inheritdoc ISlashEscrowFactory
360-
function getBurnOrRedistributionStartBlock(
361-
OperatorSet memory operatorSet,
362-
uint256 slashId
363-
) public view returns (uint256) {
357+
function getEscrowStartBlock(OperatorSet memory operatorSet, uint256 slashId) public view returns (uint256) {
364358
return _slashIdToStartBlock[operatorSet.key()][slashId];
365359
}
366360

367361
/// @inheritdoc ISlashEscrowFactory
368-
function getBurnOrRedistributionCompleteBlock(
369-
OperatorSet memory operatorSet,
370-
uint256 slashId
371-
) public view returns (uint32) {
362+
function getEscrowCompleteBlock(OperatorSet memory operatorSet, uint256 slashId) public view returns (uint32) {
372363
IStrategy[] memory strategies = getPendingStrategiesForSlashId(operatorSet, slashId);
373364

374365
// Loop through all strategies and return the max delay
375366
uint32 maxStrategyDelay;
376367
for (uint256 i = 0; i < strategies.length; ++i) {
377-
uint32 delay = getStrategyBurnOrRedistributionDelay(IStrategy(address(strategies[i])));
368+
uint32 delay = getStrategyEscrowDelay(IStrategy(address(strategies[i])));
378369
if (delay > maxStrategyDelay) {
379370
maxStrategyDelay = delay;
380371
}
381372
}
382373

383374
// The escrow can be released once the max strategy delay has elapsed.
384-
return uint32(getBurnOrRedistributionStartBlock(operatorSet, slashId) + maxStrategyDelay + 1);
375+
return uint32(getEscrowStartBlock(operatorSet, slashId) + maxStrategyDelay + 1);
385376
}
386377

387378
/// @inheritdoc ISlashEscrowFactory
388-
function getStrategyBurnOrRedistributionDelay(
379+
function getStrategyEscrowDelay(
389380
IStrategy strategy
390381
) public view returns (uint32) {
391-
uint32 globalDelay = _globalBurnOrRedistributionDelayBlocks;
392-
uint32 strategyDelay = _strategyBurnOrRedistributionDelayBlocks[address(strategy)];
382+
uint32 globalDelay = _globalEscrowDelayBlocks;
383+
uint32 strategyDelay = _strategyEscrowDelayBlocks[address(strategy)];
393384

394385
// Return whichever delay is greater.
395386
return strategyDelay > globalDelay ? strategyDelay : globalDelay;
396387
}
397388

398389
/// @inheritdoc ISlashEscrowFactory
399-
function getGlobalBurnOrRedistributionDelay() external view returns (uint32) {
400-
return _globalBurnOrRedistributionDelayBlocks;
390+
function getGlobalEscrowDelay() external view returns (uint32) {
391+
return _globalEscrowDelayBlocks;
401392
}
402393

403394
/// @inheritdoc ISlashEscrowFactory

src/contracts/core/SlashEscrowFactoryStorage.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ abstract contract SlashEscrowFactoryStorage is ISlashEscrowFactory {
1515
address internal constant DEFAULT_BURN_ADDRESS = 0x00000000000000000000000000000000000E16E4;
1616

1717
/// @notice The pause status for the `releaseSlashEscrow` function.
18-
/// @dev Allows all burn or redistribution outflows to be temporarily halted.
19-
uint8 public constant PAUSED_BURN_OR_REDISTRIBUTE_SHARES = 0;
18+
/// @dev Allows all escrow outflows to be temporarily halted.
19+
uint8 public constant PAUSED_RELEASE_ESCROW = 0;
2020

2121
// Immutable Storage
2222

@@ -48,11 +48,11 @@ abstract contract SlashEscrowFactoryStorage is ISlashEscrowFactory {
4848
/// @notice Returns the paused status for a given operator set and slash ID.
4949
mapping(bytes32 operatorSetKey => mapping(uint256 slashId => bool paused)) internal _paused;
5050

51-
/// @dev Returns the burn or redistribution delay for a given strategy.
52-
uint32 internal _globalBurnOrRedistributionDelayBlocks;
51+
/// @dev Returns the escrow delay for a given strategy.
52+
uint32 internal _globalEscrowDelayBlocks;
5353

5454
/// @dev Returns the operator set delay for a given strategy.
55-
mapping(address strategy => uint32 delay) internal _strategyBurnOrRedistributionDelayBlocks;
55+
mapping(address strategy => uint32 delay) internal _strategyEscrowDelayBlocks;
5656

5757
// Constructor
5858

src/contracts/interfaces/ISlashEscrow.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface ISlashEscrow {
1919
/// @param slashId The slash ID that was used to create the slash escrow.
2020
/// @param recipient The recipient of the underlying tokens.
2121
/// @param strategy The strategy that was used to create the slash escrow.
22-
function burnOrRedistributeUnderlyingTokens(
22+
function releaseTokens(
2323
ISlashEscrowFactory slashEscrowFactory,
2424
ISlashEscrow slashEscrowImplementation,
2525
OperatorSet calldata operatorSet,
@@ -32,7 +32,7 @@ interface ISlashEscrow {
3232
/// @dev Validates that the provided parameters deterministically generate this contract's address using CREATE2.
3333
/// - Uses ClonesUpgradeable.predictDeterministicAddress() to compute the expected address from the parameters.
3434
/// - Compares the computed address against this contract's address to validate parameter integrity.
35-
/// - Provides a stateless validation mechanism for burnOrRedistributeUnderlyingTokens() inputs.
35+
/// - Provides a stateless validation mechanism for releaseTokens() inputs.
3636
/// - Security relies on the cryptographic properties of CREATE2 address derivation.
3737
/// - Attack vector would require finding a hash collision in the CREATE2 address computation.
3838
/// @param slashEscrowFactory The factory contract that created the slash escrow.

0 commit comments

Comments
 (0)