From 9dfb8b0f1e7e3e454a8a249bcf86ce200bb38d84 Mon Sep 17 00:00:00 2001 From: MoonBoi9001 Date: Wed, 18 Sep 2024 17:44:23 +0100 Subject: [PATCH 1/2] fix: remove unused return value. (OZ N-10) --- .../subgraph-service/contracts/utilities/AllocationManager.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/subgraph-service/contracts/utilities/AllocationManager.sol b/packages/subgraph-service/contracts/utilities/AllocationManager.sol index 2e40f28d3..978335b58 100644 --- a/packages/subgraph-service/contracts/utilities/AllocationManager.sol +++ b/packages/subgraph-service/contracts/utilities/AllocationManager.sol @@ -396,7 +396,7 @@ abstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, Alloca * * @param _allocationId The id of the allocation to be closed */ - function _closeAllocation(address _allocationId) internal returns (Allocation.State memory) { + function _closeAllocation(address _allocationId) internal { Allocation.State memory allocation = allocations.get(_allocationId); // Take rewards snapshot to prevent other allos from counting tokens from this allo @@ -414,7 +414,6 @@ abstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, Alloca allocation.tokens; emit AllocationClosed(allocation.indexer, _allocationId, allocation.subgraphDeploymentId, allocation.tokens); - return allocations[_allocationId]; } /** From bd62e959dadf8b011b7d3cf766d2cf1103b50120 Mon Sep 17 00:00:00 2001 From: MoonBoi9001 Date: Wed, 18 Sep 2024 17:58:49 +0100 Subject: [PATCH 2/2] fix: remove unused return values from the Allocation library. (OZ N-10) --- .../contracts/libraries/Allocation.sol | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/packages/subgraph-service/contracts/libraries/Allocation.sol b/packages/subgraph-service/contracts/libraries/Allocation.sol index a55034f17..320547f92 100644 --- a/packages/subgraph-service/contracts/libraries/Allocation.sol +++ b/packages/subgraph-service/contracts/libraries/Allocation.sol @@ -96,12 +96,10 @@ library Allocation { * @param self The allocation list mapping * @param allocationId The allocation id */ - function presentPOI(mapping(address => State) storage self, address allocationId) internal returns (State memory) { + function presentPOI(mapping(address => State) storage self, address allocationId) internal { State storage allocation = _get(self, allocationId); require(allocation.isOpen(), AllocationClosed(allocationId, allocation.closedAt)); allocation.lastPOIPresentedAt = block.timestamp; - - return allocation; } /** @@ -116,12 +114,10 @@ library Allocation { mapping(address => State) storage self, address allocationId, uint256 accRewardsPerAllocatedToken - ) internal returns (State memory) { + ) internal { State storage allocation = _get(self, allocationId); require(allocation.isOpen(), AllocationClosed(allocationId, allocation.closedAt)); allocation.accRewardsPerAllocatedToken = accRewardsPerAllocatedToken; - - return allocation; } /** @@ -131,15 +127,10 @@ library Allocation { * @param self The allocation list mapping * @param allocationId The allocation id */ - function clearPendingRewards( - mapping(address => State) storage self, - address allocationId - ) internal returns (State memory) { + function clearPendingRewards(mapping(address => State) storage self, address allocationId) internal { State storage allocation = _get(self, allocationId); require(allocation.isOpen(), AllocationClosed(allocationId, allocation.closedAt)); allocation.accRewardsPending = 0; - - return allocation; } /** @@ -149,12 +140,10 @@ library Allocation { * @param self The allocation list mapping * @param allocationId The allocation id */ - function close(mapping(address => State) storage self, address allocationId) internal returns (State memory) { + function close(mapping(address => State) storage self, address allocationId) internal { State storage allocation = _get(self, allocationId); require(allocation.isOpen(), AllocationClosed(allocationId, allocation.closedAt)); allocation.closedAt = block.timestamp; - - return allocation; } /**