@@ -430,6 +430,7 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
430
430
// Check if sender is authorized to slash on the deprecated list
431
431
if (__DEPRECATED_slashers[msg .sender ]) {
432
432
// Forward call to staking extension
433
+ // solhint-disable-next-line avoid-low-level-calls
433
434
(bool success , ) = STAKING_EXTENSION_ADDRESS.delegatecall (
434
435
abi.encodeWithSelector (
435
436
IHorizonStakingExtension.legacySlash.selector ,
@@ -439,7 +440,7 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
439
440
verifierDestination
440
441
)
441
442
);
442
- require (success, "Delegatecall to legacySlash failed " );
443
+ require (success, "Delegatecall: legacySlash failed " );
443
444
return ;
444
445
}
445
446
@@ -1032,60 +1033,62 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
1032
1033
/**
1033
1034
* @notice Traverses a thaw request list and fulfills expired thaw requests.
1034
1035
* @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
1036
1037
* @return The amount of thawed tokens
1037
1038
* @return The amount of tokens still thawing
1038
1039
* @return The amount of shares still thawing
1039
1040
*/
1040
- function _fulfillThawRequests (FulfillThawRequestsParams memory params ) private returns (uint256 , uint256 , uint256 ) {
1041
+ function _fulfillThawRequests (
1042
+ FulfillThawRequestsParams memory _params
1043
+ ) private returns (uint256 , uint256 , uint256 ) {
1041
1044
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
1046
1049
);
1047
1050
require (thawRequestList.count > 0 , HorizonStakingNothingThawing ());
1048
1051
1049
- TraverseThawRequestsResults memory results = _traverseThawRequests (params , thawRequestList);
1052
+ TraverseThawRequestsResults memory results = _traverseThawRequests (_params , thawRequestList);
1050
1053
1051
1054
emit ThawRequestsFulfilled (
1052
- params .serviceProvider,
1053
- params .verifier,
1054
- params .owner,
1055
+ _params .serviceProvider,
1056
+ _params .verifier,
1057
+ _params .owner,
1055
1058
results.requestsFulfilled,
1056
1059
results.tokensThawed,
1057
- params .requestType
1060
+ _params .requestType
1058
1061
);
1059
1062
1060
1063
return (results.tokensThawed, results.tokensThawing, results.sharesThawing);
1061
1064
}
1062
1065
1063
1066
/**
1064
1067
* @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
1067
1070
* @return The results of the traversal
1068
1071
*/
1069
1072
function _traverseThawRequests (
1070
- FulfillThawRequestsParams memory params ,
1071
- LinkedList.List storage thawRequestList
1073
+ FulfillThawRequestsParams memory _params ,
1074
+ LinkedList.List storage _thawRequestList
1072
1075
) 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);
1075
1078
1076
1079
bytes memory acc = abi.encode (
1077
- params .requestType,
1080
+ _params .requestType,
1078
1081
uint256 (0 ),
1079
- params .tokensThawing,
1080
- params .sharesThawing,
1081
- params .thawingNonce
1082
+ _params .tokensThawing,
1083
+ _params .sharesThawing,
1084
+ _params .thawingNonce
1082
1085
);
1083
- (uint256 thawRequestsFulfilled , bytes memory data ) = thawRequestList .traverse (
1086
+ (uint256 thawRequestsFulfilled , bytes memory data ) = _thawRequestList .traverse (
1084
1087
getNextItem,
1085
1088
_fulfillThawRequest,
1086
1089
deleteItem,
1087
1090
acc,
1088
- params .nThawRequests
1091
+ _params .nThawRequests
1089
1092
);
1090
1093
1091
1094
(, uint256 tokensThawed , uint256 tokensThawing , uint256 sharesThawing ) = abi.decode (
@@ -1152,21 +1155,6 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
1152
1155
return (false , _acc);
1153
1156
}
1154
1157
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
-
1170
1158
/**
1171
1159
* @notice Deletes a thaw request for a provision.
1172
1160
* @param _thawRequestId The ID of the thaw request to delete.
@@ -1213,4 +1201,19 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
1213
1201
return _operatorAuth[_serviceProvider][_verifier][_operator];
1214
1202
}
1215
1203
}
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
+ }
1216
1219
}
0 commit comments