@@ -295,7 +295,7 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
295
295
address verifier ,
296
296
uint256 shares
297
297
) external override notPaused returns (bytes32 ) {
298
- return _undelegate (ThawRequestType.Delegation, serviceProvider, verifier, shares, msg . sender );
298
+ return _undelegate (serviceProvider, verifier, shares);
299
299
}
300
300
301
301
/// @inheritdoc IHorizonStakingMain
@@ -304,15 +304,7 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
304
304
address verifier ,
305
305
uint256 nThawRequests
306
306
) external override notPaused {
307
- _withdrawDelegated (
308
- ThawRequestType.Delegation,
309
- serviceProvider,
310
- verifier,
311
- address (0 ),
312
- address (0 ),
313
- 0 ,
314
- nThawRequests
315
- );
307
+ _withdrawDelegated (serviceProvider, verifier, address (0 ), address (0 ), 0 , nThawRequests);
316
308
}
317
309
318
310
/// @inheritdoc IHorizonStakingMain
@@ -327,7 +319,6 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
327
319
require (newServiceProvider != address (0 ), HorizonStakingInvalidServiceProviderZeroAddress ());
328
320
require (newVerifier != address (0 ), HorizonStakingInvalidVerifierZeroAddress ());
329
321
_withdrawDelegated (
330
- ThawRequestType.Delegation,
331
322
oldServiceProvider,
332
323
oldVerifier,
333
324
newServiceProvider,
@@ -358,7 +349,7 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
358
349
359
350
/// @inheritdoc IHorizonStakingMain
360
351
function undelegate (address serviceProvider , uint256 shares ) external override notPaused {
361
- _undelegate (ThawRequestType.Delegation, serviceProvider, SUBGRAPH_DATA_SERVICE_ADDRESS, shares, msg . sender );
352
+ _undelegate (serviceProvider, SUBGRAPH_DATA_SERVICE_ADDRESS, shares);
362
353
}
363
354
364
355
/// @inheritdoc IHorizonStakingMain
@@ -913,20 +904,12 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
913
904
* invalidated.
914
905
* @dev Note that delegation that is caught thawing when the pool is invalidated will be completely lost! However delegation shares
915
906
* that were not thawing will be preserved.
916
- * @param _requestType The type of thaw request (Provision or Delegation).
917
907
* @param _serviceProvider The service provider address
918
908
* @param _verifier The verifier address
919
909
* @param _shares The amount of shares to undelegate
920
- * @param _beneficiary The beneficiary address
921
910
* @return The ID of the thaw request
922
911
*/
923
- function _undelegate (
924
- ThawRequestType _requestType ,
925
- address _serviceProvider ,
926
- address _verifier ,
927
- uint256 _shares ,
928
- address _beneficiary
929
- ) private returns (bytes32 ) {
912
+ function _undelegate (address _serviceProvider , address _verifier , uint256 _shares ) private returns (bytes32 ) {
930
913
require (_shares > 0 , HorizonStakingInvalidZeroShares ());
931
914
DelegationPoolInternal storage pool = _getDelegationPool (_serviceProvider, _verifier);
932
915
DelegationInternal storage delegation = pool.delegators[msg .sender ];
@@ -958,10 +941,10 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
958
941
}
959
942
960
943
bytes32 thawRequestId = _createThawRequest (
961
- _requestType ,
944
+ ThawRequestType.Delegation ,
962
945
_serviceProvider,
963
946
_verifier,
964
- _beneficiary ,
947
+ msg . sender ,
965
948
thawingShares,
966
949
thawingUntil,
967
950
pool.thawingNonce
@@ -978,7 +961,6 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
978
961
* will attempt to fulfill all thaw requests until the first one that is not yet expired is found.
979
962
* @dev If the delegation pool was completely slashed before withdrawing, calling this function will fulfill
980
963
* the thaw requests with an amount equal to zero.
981
- * @param _requestType The type of thaw request (Provision or Delegation).
982
964
* @param _serviceProvider The service provider address
983
965
* @param _verifier The verifier address
984
966
* @param _newServiceProvider The new service provider address
@@ -987,7 +969,6 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
987
969
* @param _nThawRequests The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests.
988
970
*/
989
971
function _withdrawDelegated (
990
- ThawRequestType _requestType ,
991
972
address _serviceProvider ,
992
973
address _verifier ,
993
974
address _newServiceProvider ,
@@ -1008,7 +989,7 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
1008
989
uint256 tokensThawing = pool.tokensThawing;
1009
990
1010
991
FulfillThawRequestsParams memory params = FulfillThawRequestsParams ({
1011
- requestType: _requestType ,
992
+ requestType: ThawRequestType.Delegation ,
1012
993
serviceProvider: _serviceProvider,
1013
994
verifier: _verifier,
1014
995
owner: msg .sender ,
0 commit comments