@@ -5,6 +5,7 @@ pragma experimental ABIEncoderV2;
5
5
6
6
import "@openzeppelin/contracts/cryptography/ECDSA.sol " ;
7
7
8
+ import "../base/Multicall.sol " ;
8
9
import "../upgrades/GraphUpgradeable.sol " ;
9
10
import "../utils/TokenUtils.sol " ;
10
11
@@ -20,7 +21,7 @@ import "./libs/Stakes.sol";
20
21
* Allocations on a Subgraph. It also allows Delegators to Delegate towards an Indexer. The
21
22
* contract also has the slashing functionality.
22
23
*/
23
- contract Staking is StakingV2Storage , GraphUpgradeable , IStaking {
24
+ contract Staking is StakingV2Storage , GraphUpgradeable , IStaking , Multicall {
24
25
using SafeMath for uint256 ;
25
26
using Stakes for Stakes.Indexer;
26
27
using Rebates for Rebates.Pool;
@@ -908,49 +909,6 @@ contract Staking is StakingV2Storage, GraphUpgradeable, IStaking {
908
909
_closeAllocation (_allocationID, _poi);
909
910
}
910
911
911
- /**
912
- * @dev Close multiple allocations and free the staked tokens.
913
- * To be eligible for rewards a proof of indexing must be presented.
914
- * Presenting a bad proof is subject to slashable condition.
915
- * To opt out for rewards set _poi to 0x0
916
- * @param _requests An array of CloseAllocationRequest
917
- */
918
- function closeAllocationMany (CloseAllocationRequest[] calldata _requests )
919
- external
920
- override
921
- notPaused
922
- {
923
- for (uint256 i = 0 ; i < _requests.length ; i++ ) {
924
- _closeAllocation (_requests[i].allocationID, _requests[i].poi);
925
- }
926
- }
927
-
928
- /**
929
- * @dev Close and allocate. This will perform a close and then create a new Allocation
930
- * atomically on the same transaction.
931
- * @param _closingAllocationID The identifier of the allocation to be closed
932
- * @param _poi Proof of indexing submitted for the allocated period
933
- * @param _indexer Indexer address to allocate funds from.
934
- * @param _subgraphDeploymentID ID of the SubgraphDeployment where tokens will be allocated
935
- * @param _tokens Amount of tokens to allocate
936
- * @param _allocationID The allocation identifier
937
- * @param _metadata IPFS hash for additional information about the allocation
938
- * @param _proof A 65-bytes Ethereum signed message of `keccak256(indexerAddress,allocationID)`
939
- */
940
- function closeAndAllocate (
941
- address _closingAllocationID ,
942
- bytes32 _poi ,
943
- address _indexer ,
944
- bytes32 _subgraphDeploymentID ,
945
- uint256 _tokens ,
946
- address _allocationID ,
947
- bytes32 _metadata ,
948
- bytes calldata _proof
949
- ) external override notPaused {
950
- _closeAllocation (_closingAllocationID, _poi);
951
- _allocate (_indexer, _subgraphDeploymentID, _tokens, _allocationID, _metadata, _proof);
952
- }
953
-
954
912
/**
955
913
* @dev Collect query fees from state channels and assign them to an allocation.
956
914
* Funds received are only accepted from a valid sender.
@@ -1036,21 +994,6 @@ contract Staking is StakingV2Storage, GraphUpgradeable, IStaking {
1036
994
_claim (_allocationID, _restake);
1037
995
}
1038
996
1039
- /**
1040
- * @dev Claim tokens from the rebate pool for many allocations.
1041
- * @param _allocationID Array of allocations from where we are claiming tokens
1042
- * @param _restake True if restake fees instead of transfer to indexer
1043
- */
1044
- function claimMany (address [] calldata _allocationID , bool _restake )
1045
- external
1046
- override
1047
- notPaused
1048
- {
1049
- for (uint256 i = 0 ; i < _allocationID.length ; i++ ) {
1050
- _claim (_allocationID[i], _restake);
1051
- }
1052
- }
1053
-
1054
997
/**
1055
998
* @dev Stake tokens on the indexer.
1056
999
* This function does not check minimum indexer stake requirement to allow
0 commit comments