diff --git a/src/contracts/fullRestakeDelegator/FullRestakeResetHook.sol b/src/contracts/fullRestakeDelegator/FullRestakeResetHook.sol index 6747173..f93f044 100644 --- a/src/contracts/fullRestakeDelegator/FullRestakeResetHook.sol +++ b/src/contracts/fullRestakeDelegator/FullRestakeResetHook.sol @@ -27,13 +27,13 @@ contract FullRestakeResetHook is IFullRestakeResetHook { mapping(address vault => mapping(address operator => CircularBuffer.Bytes32CircularBuffer buffer)) private _slashings; - constructor(uint48 period_, uint256 slashCount_) { - if (slashCount_ == 0) { + constructor(uint48 period, uint256 slashCount) { + if (slashCount == 0) { revert InvalidSlashCount(); } - PERIOD = period_; - SLASH_COUNT = slashCount_; + PERIOD = period; + SLASH_COUNT = slashCount; } /** @@ -56,9 +56,8 @@ contract FullRestakeResetHook is IFullRestakeResetHook { revert NotVaultDelegator(); } - uint256 slashCount_ = SLASH_COUNT; if (_slashings[vault][operator].count() == 0) { - _slashings[vault][operator].setup(slashCount_); + _slashings[vault][operator].setup(SLASH_COUNT); } if (IFullRestakeDelegator(msg.sender).operatorNetworkLimit(subnetwork, operator) == 0) { @@ -68,8 +67,8 @@ contract FullRestakeResetHook is IFullRestakeResetHook { _slashings[vault][operator].push(bytes32(uint256(Time.timestamp()))); if ( - _slashings[vault][operator].count() == slashCount_ - && Time.timestamp() - uint256(_slashings[vault][operator].last(slashCount_ - 1)) <= PERIOD + _slashings[vault][operator].count() == SLASH_COUNT + && Time.timestamp() - uint256(_slashings[vault][operator].last(SLASH_COUNT - 1)) <= PERIOD ) { IFullRestakeDelegator(msg.sender).setOperatorNetworkLimit(subnetwork, operator, 0); } diff --git a/src/contracts/networkRestakeDelegator/NetworkRestakeResetHook.sol b/src/contracts/networkRestakeDelegator/NetworkRestakeResetHook.sol index 1057aeb..dcd9d91 100644 --- a/src/contracts/networkRestakeDelegator/NetworkRestakeResetHook.sol +++ b/src/contracts/networkRestakeDelegator/NetworkRestakeResetHook.sol @@ -27,13 +27,13 @@ contract NetworkRestakeResetHook is INetworkRestakeResetHook { mapping(address vault => mapping(address operator => CircularBuffer.Bytes32CircularBuffer buffer)) private _slashings; - constructor(uint48 period_, uint256 slashCount_) { - if (slashCount_ == 0) { + constructor(uint48 period, uint256 slashCount) { + if (slashCount == 0) { revert InvalidSlashCount(); } - PERIOD = period_; - SLASH_COUNT = slashCount_; + PERIOD = period; + SLASH_COUNT = slashCount; } /** @@ -56,9 +56,8 @@ contract NetworkRestakeResetHook is INetworkRestakeResetHook { revert NotVaultDelegator(); } - uint256 slashCount_ = SLASH_COUNT; if (_slashings[vault][operator].count() == 0) { - _slashings[vault][operator].setup(slashCount_); + _slashings[vault][operator].setup(SLASH_COUNT); } if (INetworkRestakeDelegator(msg.sender).operatorNetworkShares(subnetwork, operator) == 0) { @@ -68,8 +67,8 @@ contract NetworkRestakeResetHook is INetworkRestakeResetHook { _slashings[vault][operator].push(bytes32(uint256(Time.timestamp()))); if ( - _slashings[vault][operator].count() == slashCount_ - && Time.timestamp() - uint256(_slashings[vault][operator].last(slashCount_ - 1)) <= PERIOD + _slashings[vault][operator].count() == SLASH_COUNT + && Time.timestamp() - uint256(_slashings[vault][operator].last(SLASH_COUNT - 1)) <= PERIOD ) { INetworkRestakeDelegator(msg.sender).setOperatorNetworkShares(subnetwork, operator, 0); } diff --git a/src/contracts/operatorSpecificDelegator/OperatorSpecificResetHook.sol b/src/contracts/operatorSpecificDelegator/OperatorSpecificResetHook.sol index 25118f8..4174239 100644 --- a/src/contracts/operatorSpecificDelegator/OperatorSpecificResetHook.sol +++ b/src/contracts/operatorSpecificDelegator/OperatorSpecificResetHook.sol @@ -26,13 +26,13 @@ contract OperatorSpecificResetHook is IOperatorSpecificResetHook { mapping(address vault => CircularBuffer.Bytes32CircularBuffer buffer) private _slashings; - constructor(uint48 period_, uint256 slashCount_) { - if (slashCount_ == 0) { + constructor(uint48 period, uint256 slashCount) { + if (slashCount == 0) { revert InvalidSlashCount(); } - PERIOD = period_; - SLASH_COUNT = slashCount_; + PERIOD = period; + SLASH_COUNT = slashCount; } /** @@ -55,9 +55,8 @@ contract OperatorSpecificResetHook is IOperatorSpecificResetHook { revert NotVaultDelegator(); } - uint256 slashCount_ = SLASH_COUNT; if (_slashings[vault].count() == 0) { - _slashings[vault].setup(slashCount_); + _slashings[vault].setup(SLASH_COUNT); } if (IOperatorSpecificDelegator(msg.sender).networkLimit(subnetwork) == 0) { @@ -67,8 +66,8 @@ contract OperatorSpecificResetHook is IOperatorSpecificResetHook { _slashings[vault].push(bytes32(uint256(Time.timestamp()))); if ( - _slashings[vault].count() == slashCount_ - && Time.timestamp() - uint256(_slashings[vault].last(slashCount_ - 1)) <= PERIOD + _slashings[vault].count() == SLASH_COUNT + && Time.timestamp() - uint256(_slashings[vault].last(SLASH_COUNT - 1)) <= PERIOD ) { IOperatorSpecificDelegator(msg.sender).setNetworkLimit(subnetwork, 0); }