Skip to content

chore: remove unused code (OZ N-03) #1153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: horizon-oz2/n02-token-restriction
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/horizon/contracts/libraries/UintRange.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ pragma solidity 0.8.27;
* bugs. We may have an active bug bounty program.
*/
library UintRange {
using UintRange for uint256;

/**
* @notice Checks if a value is in the range [`min`, `max`].
* @param value The value to check.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,9 @@ contract HorizonStakingExtension is HorizonStakingBase, IHorizonStakingExtension
/**
* @dev Triggers an update of rewards due to a change in allocations.
* @param _subgraphDeploymentID Subgraph deployment updated
* @return Accumulated rewards per allocated token for the subgraph deployment
*/
function _updateRewards(bytes32 _subgraphDeploymentID) private returns (uint256) {
return _graphRewardsManager().onSubgraphAllocationUpdate(_subgraphDeploymentID);
function _updateRewards(bytes32 _subgraphDeploymentID) private {
_graphRewardsManager().onSubgraphAllocationUpdate(_subgraphDeploymentID);
}

/**
Expand Down
8 changes: 0 additions & 8 deletions packages/horizon/contracts/staking/utilities/Managed.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@ abstract contract Managed is GraphDirectory {
_;
}

/**
* @dev Revert if the caller is not the Controller
*/
modifier onlyController() {
require(msg.sender == address(_graphController()), ManagedOnlyController());
_;
}

/**
* @dev Revert if the caller is not the governor
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ abstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, Alloca
* @param _tokens The amount of tokens to allocate
* @param _allocationProof Signed proof of allocation id address ownership
* @param _delegationRatio The delegation ratio to consider when locking tokens
* @return The allocation details
*/
function _allocate(
address _indexer,
Expand All @@ -209,7 +208,7 @@ abstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, Alloca
uint256 _tokens,
bytes memory _allocationProof,
uint32 _delegationRatio
) internal returns (Allocation.State memory) {
) internal {
require(_allocationId != address(0), AllocationManagerInvalidZeroAllocationId());

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

emit AllocationCreated(_indexer, _allocationId, _subgraphDeploymentId, allocation.tokens, currentEpoch);
return allocation;
}

/**
Expand Down Expand Up @@ -361,13 +359,8 @@ abstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, Alloca
* @param _allocationId The id of the allocation to be resized
* @param _tokens The new amount of tokens to allocate
* @param _delegationRatio The delegation ratio to consider when locking tokens
* @return The allocation details
*/
function _resizeAllocation(
address _allocationId,
uint256 _tokens,
uint32 _delegationRatio
) internal returns (Allocation.State memory) {
function _resizeAllocation(address _allocationId, uint256 _tokens, uint32 _delegationRatio) internal {
Allocation.State memory allocation = _allocations.get(_allocationId);
require(allocation.isOpen(), AllocationManagerAllocationClosed(_allocationId));
require(_tokens != allocation.tokens, AllocationManagerAllocationSameSize(_allocationId, _tokens));
Expand Down Expand Up @@ -404,7 +397,6 @@ abstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, Alloca
}

emit AllocationResized(allocation.indexer, _allocationId, allocation.subgraphDeploymentId, _tokens, oldTokens);
return _allocations[_allocationId];
}

/**
Expand Down Expand Up @@ -466,24 +458,6 @@ abstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, Alloca
emit MaxPOIStalenessSet(_maxPOIStaleness);
}

/**
* @notice Gets the details of an allocation
* @param _allocationId The id of the allocation
* @return The allocation details
*/
function _getAllocation(address _allocationId) internal view returns (Allocation.State memory) {
return _allocations.get(_allocationId);
}

/**
* @notice Gets the details of a legacy allocation
* @param _allocationId The id of the legacy allocation
* @return The legacy allocation details
*/
function _getLegacyAllocation(address _allocationId) internal view returns (LegacyAllocation.State memory) {
return _legacyAllocations.get(_allocationId);
}

/**
* @notice Encodes the allocation proof for EIP712 signing
* @param _indexer The address of the indexer
Expand Down