@@ -5,6 +5,7 @@ pragma experimental ABIEncoderV2;
55
66import "@openzeppelin/contracts/cryptography/ECDSA.sol " ;
77
8+ import "../base/Multicall.sol " ;
89import "../upgrades/GraphUpgradeable.sol " ;
910import "../utils/TokenUtils.sol " ;
1011
@@ -20,7 +21,7 @@ import "./libs/Stakes.sol";
2021 * Allocations on a Subgraph. It also allows Delegators to Delegate towards an Indexer. The
2122 * contract also has the slashing functionality.
2223 */
23- contract Staking is StakingV2Storage , GraphUpgradeable , IStaking {
24+ contract Staking is StakingV2Storage , GraphUpgradeable , IStaking , Multicall {
2425 using SafeMath for uint256 ;
2526 using Stakes for Stakes.Indexer;
2627 using Rebates for Rebates.Pool;
@@ -908,49 +909,6 @@ contract Staking is StakingV2Storage, GraphUpgradeable, IStaking {
908909 _closeAllocation (_allocationID, _poi);
909910 }
910911
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-
954912 /**
955913 * @dev Collect query fees from state channels and assign them to an allocation.
956914 * Funds received are only accepted from a valid sender.
@@ -1036,21 +994,6 @@ contract Staking is StakingV2Storage, GraphUpgradeable, IStaking {
1036994 _claim (_allocationID, _restake);
1037995 }
1038996
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-
1054997 /**
1055998 * @dev Stake tokens on the indexer.
1056999 * This function does not check minimum indexer stake requirement to allow
0 commit comments