@@ -430,6 +430,7 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
430430 // Check if sender is authorized to slash on the deprecated list
431431 if (__DEPRECATED_slashers[msg .sender ]) {
432432 // Forward call to staking extension
433+ // solhint-disable-next-line avoid-low-level-calls
433434 (bool success , ) = STAKING_EXTENSION_ADDRESS.delegatecall (
434435 abi.encodeWithSelector (
435436 IHorizonStakingExtension.legacySlash.selector ,
@@ -439,7 +440,7 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
439440 verifierDestination
440441 )
441442 );
442- require (success, "Delegatecall to legacySlash failed " );
443+ require (success, "Delegatecall: legacySlash failed " );
443444 return ;
444445 }
445446
@@ -1032,60 +1033,62 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
10321033 /**
10331034 * @notice Traverses a thaw request list and fulfills expired thaw requests.
10341035 * @dev Emits a {ThawRequestsFulfilled} event and a {ThawRequestFulfilled} event for each thaw request fulfilled.
1035- * @param params The parameters for fulfilling thaw requests
1036+ * @param _params The parameters for fulfilling thaw requests
10361037 * @return The amount of thawed tokens
10371038 * @return The amount of tokens still thawing
10381039 * @return The amount of shares still thawing
10391040 */
1040- function _fulfillThawRequests (FulfillThawRequestsParams memory params ) private returns (uint256 , uint256 , uint256 ) {
1041+ function _fulfillThawRequests (
1042+ FulfillThawRequestsParams memory _params
1043+ ) private returns (uint256 , uint256 , uint256 ) {
10411044 LinkedList.List storage thawRequestList = _getThawRequestList (
1042- params .requestType,
1043- params .serviceProvider,
1044- params .verifier,
1045- params .owner
1045+ _params .requestType,
1046+ _params .serviceProvider,
1047+ _params .verifier,
1048+ _params .owner
10461049 );
10471050 require (thawRequestList.count > 0 , HorizonStakingNothingThawing ());
10481051
1049- TraverseThawRequestsResults memory results = _traverseThawRequests (params , thawRequestList);
1052+ TraverseThawRequestsResults memory results = _traverseThawRequests (_params , thawRequestList);
10501053
10511054 emit ThawRequestsFulfilled (
1052- params .serviceProvider,
1053- params .verifier,
1054- params .owner,
1055+ _params .serviceProvider,
1056+ _params .verifier,
1057+ _params .owner,
10551058 results.requestsFulfilled,
10561059 results.tokensThawed,
1057- params .requestType
1060+ _params .requestType
10581061 );
10591062
10601063 return (results.tokensThawed, results.tokensThawing, results.sharesThawing);
10611064 }
10621065
10631066 /**
10641067 * @notice Traverses a thaw request list and fulfills expired thaw requests.
1065- * @param params The parameters for fulfilling thaw requests
1066- * @param thawRequestList The list of thaw requests to traverse
1068+ * @param _params The parameters for fulfilling thaw requests
1069+ * @param _thawRequestList The list of thaw requests to traverse
10671070 * @return The results of the traversal
10681071 */
10691072 function _traverseThawRequests (
1070- FulfillThawRequestsParams memory params ,
1071- LinkedList.List storage thawRequestList
1073+ FulfillThawRequestsParams memory _params ,
1074+ LinkedList.List storage _thawRequestList
10721075 ) private returns (TraverseThawRequestsResults memory ) {
1073- function (bytes32 ) view returns (bytes32 ) getNextItem = _getNextThawRequest (params .requestType);
1074- function (bytes32 ) deleteItem = _getDeleteThawRequest (params .requestType);
1076+ function (bytes32 ) view returns (bytes32 ) getNextItem = _getNextThawRequest (_params .requestType);
1077+ function (bytes32 ) deleteItem = _getDeleteThawRequest (_params .requestType);
10751078
10761079 bytes memory acc = abi.encode (
1077- params .requestType,
1080+ _params .requestType,
10781081 uint256 (0 ),
1079- params .tokensThawing,
1080- params .sharesThawing,
1081- params .thawingNonce
1082+ _params .tokensThawing,
1083+ _params .sharesThawing,
1084+ _params .thawingNonce
10821085 );
1083- (uint256 thawRequestsFulfilled , bytes memory data ) = thawRequestList .traverse (
1086+ (uint256 thawRequestsFulfilled , bytes memory data ) = _thawRequestList .traverse (
10841087 getNextItem,
10851088 _fulfillThawRequest,
10861089 deleteItem,
10871090 acc,
1088- params .nThawRequests
1091+ _params .nThawRequests
10891092 );
10901093
10911094 (, uint256 tokensThawed , uint256 tokensThawing , uint256 sharesThawing ) = abi.decode (
@@ -1152,21 +1155,6 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
11521155 return (false , _acc);
11531156 }
11541157
1155- /**
1156- * @notice Determines the correct callback function for `deleteItem` based on the request type.
1157- * @param _requestType The type of thaw request (Provision or Delegation).
1158- * @return A function pointer to the appropriate `deleteItem` callback.
1159- */
1160- function _getDeleteThawRequest (ThawRequestType _requestType ) private pure returns (function (bytes32 )) {
1161- if (_requestType == ThawRequestType.Provision) {
1162- return _deleteProvisionThawRequest;
1163- } else if (_requestType == ThawRequestType.Delegation) {
1164- return _deleteDelegationThawRequest;
1165- } else {
1166- revert HorizonStakingInvalidThawRequestType ();
1167- }
1168- }
1169-
11701158 /**
11711159 * @notice Deletes a thaw request for a provision.
11721160 * @param _thawRequestId The ID of the thaw request to delete.
@@ -1213,4 +1201,19 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
12131201 return _operatorAuth[_serviceProvider][_verifier][_operator];
12141202 }
12151203 }
1204+
1205+ /**
1206+ * @notice Determines the correct callback function for `deleteItem` based on the request type.
1207+ * @param _requestType The type of thaw request (Provision or Delegation).
1208+ * @return A function pointer to the appropriate `deleteItem` callback.
1209+ */
1210+ function _getDeleteThawRequest (ThawRequestType _requestType ) private pure returns (function (bytes32 )) {
1211+ if (_requestType == ThawRequestType.Provision) {
1212+ return _deleteProvisionThawRequest;
1213+ } else if (_requestType == ThawRequestType.Delegation) {
1214+ return _deleteDelegationThawRequest;
1215+ } else {
1216+ revert HorizonStakingInvalidThawRequestType ();
1217+ }
1218+ }
12161219}
0 commit comments