Skip to content
Merged
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
19 changes: 4 additions & 15 deletions packages/subgraph-service/contracts/libraries/Allocation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand All @@ -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;
}

/**
Expand All @@ -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;
}

/**
Expand All @@ -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;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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];
}

/**
Expand Down