Skip to content

Commit 98f7640

Browse files
committed
chore: remove unused code (OZ N-03)
Signed-off-by: Tomás Migone <[email protected]>
1 parent 0fca0f8 commit 98f7640

File tree

4 files changed

+4
-41
lines changed

4 files changed

+4
-41
lines changed

packages/horizon/contracts/libraries/UintRange.sol

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ pragma solidity 0.8.27;
88
* bugs. We may have an active bug bounty program.
99
*/
1010
library UintRange {
11-
using UintRange for uint256;
12-
1311
/**
1412
* @notice Checks if a value is in the range [`min`, `max`].
1513
* @param value The value to check.

packages/horizon/contracts/staking/HorizonStakingExtension.sol

+2-3
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,9 @@ contract HorizonStakingExtension is HorizonStakingBase, IHorizonStakingExtension
279279
/**
280280
* @dev Triggers an update of rewards due to a change in allocations.
281281
* @param _subgraphDeploymentID Subgraph deployment updated
282-
* @return Accumulated rewards per allocated token for the subgraph deployment
283282
*/
284-
function _updateRewards(bytes32 _subgraphDeploymentID) private returns (uint256) {
285-
return _graphRewardsManager().onSubgraphAllocationUpdate(_subgraphDeploymentID);
283+
function _updateRewards(bytes32 _subgraphDeploymentID) private {
284+
_graphRewardsManager().onSubgraphAllocationUpdate(_subgraphDeploymentID);
286285
}
287286

288287
/**

packages/horizon/contracts/staking/utilities/Managed.sol

-8
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,6 @@ abstract contract Managed is GraphDirectory {
5050
_;
5151
}
5252

53-
/**
54-
* @dev Revert if the caller is not the Controller
55-
*/
56-
modifier onlyController() {
57-
require(msg.sender == address(_graphController()), ManagedOnlyController());
58-
_;
59-
}
60-
6153
/**
6254
* @dev Revert if the caller is not the governor
6355
*/

packages/subgraph-service/contracts/utilities/AllocationManager.sol

+2-28
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ abstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, Alloca
200200
* @param _tokens The amount of tokens to allocate
201201
* @param _allocationProof Signed proof of allocation id address ownership
202202
* @param _delegationRatio The delegation ratio to consider when locking tokens
203-
* @return The allocation details
204203
*/
205204
function _allocate(
206205
address _indexer,
@@ -209,7 +208,7 @@ abstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, Alloca
209208
uint256 _tokens,
210209
bytes memory _allocationProof,
211210
uint32 _delegationRatio
212-
) internal returns (Allocation.State memory) {
211+
) internal {
213212
require(_allocationId != address(0), AllocationManagerInvalidZeroAllocationId());
214213

215214
_verifyAllocationProof(_indexer, _allocationId, _allocationProof);
@@ -238,7 +237,6 @@ abstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, Alloca
238237
allocation.tokens;
239238

240239
emit AllocationCreated(_indexer, _allocationId, _subgraphDeploymentId, allocation.tokens, currentEpoch);
241-
return allocation;
242240
}
243241

244242
/**
@@ -361,13 +359,8 @@ abstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, Alloca
361359
* @param _allocationId The id of the allocation to be resized
362360
* @param _tokens The new amount of tokens to allocate
363361
* @param _delegationRatio The delegation ratio to consider when locking tokens
364-
* @return The allocation details
365362
*/
366-
function _resizeAllocation(
367-
address _allocationId,
368-
uint256 _tokens,
369-
uint32 _delegationRatio
370-
) internal returns (Allocation.State memory) {
363+
function _resizeAllocation(address _allocationId, uint256 _tokens, uint32 _delegationRatio) internal {
371364
Allocation.State memory allocation = _allocations.get(_allocationId);
372365
require(allocation.isOpen(), AllocationManagerAllocationClosed(_allocationId));
373366
require(_tokens != allocation.tokens, AllocationManagerAllocationSameSize(_allocationId, _tokens));
@@ -404,7 +397,6 @@ abstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, Alloca
404397
}
405398

406399
emit AllocationResized(allocation.indexer, _allocationId, allocation.subgraphDeploymentId, _tokens, oldTokens);
407-
return _allocations[_allocationId];
408400
}
409401

410402
/**
@@ -466,24 +458,6 @@ abstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, Alloca
466458
emit MaxPOIStalenessSet(_maxPOIStaleness);
467459
}
468460

469-
/**
470-
* @notice Gets the details of an allocation
471-
* @param _allocationId The id of the allocation
472-
* @return The allocation details
473-
*/
474-
function _getAllocation(address _allocationId) internal view returns (Allocation.State memory) {
475-
return _allocations.get(_allocationId);
476-
}
477-
478-
/**
479-
* @notice Gets the details of a legacy allocation
480-
* @param _allocationId The id of the legacy allocation
481-
* @return The legacy allocation details
482-
*/
483-
function _getLegacyAllocation(address _allocationId) internal view returns (LegacyAllocation.State memory) {
484-
return _legacyAllocations.get(_allocationId);
485-
}
486-
487461
/**
488462
* @notice Encodes the allocation proof for EIP712 signing
489463
* @param _indexer The address of the indexer

0 commit comments

Comments
 (0)