Skip to content

Commit f124dce

Browse files
f: more NatSpec
1 parent 7cb4a0c commit f124dce

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

packages/subgraph-service/contracts/libraries/AllocationManagerLib.sol

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ library AllocationManagerLib {
2424
using PPMMath for uint256;
2525
using TokenUtils for IGraphToken;
2626

27+
/**
28+
* @notice Parameters for the allocation creation
29+
* @param currentEpoch The current epoch at the time of allocation creation
30+
* @param graphStaking The Horizon staking contract to handle token locking
31+
* @param graphRewardsManager The rewards manager to handle rewards distribution
32+
* @param _encodeAllocationProof The EIP712 encoded allocation proof
33+
* @param _indexer The address of the indexer creating the allocation
34+
* @param _allocationId The id of the allocation to be created
35+
* @param _subgraphDeploymentId The id of the subgraph deployment for which the allocation is created
36+
* @param _tokens The amount of tokens to allocate
37+
* @param _allocationProof The EIP712 proof, an EIP712 signed message of (indexer,allocationId)
38+
* @param _delegationRatio The delegation ratio to consider when locking tokens
39+
*/
2740
struct AllocateParams {
2841
uint256 currentEpoch;
2942
IHorizonStaking graphStaking;
@@ -37,6 +50,19 @@ library AllocationManagerLib {
3750
uint32 _delegationRatio;
3851
}
3952

53+
/**
54+
* @notice Parameters for the POI presentation
55+
* @param maxPOIStaleness The maximum staleness of the POI in epochs
56+
* @param graphEpochManager The epoch manager to get the current epoch
57+
* @param graphStaking The Horizon staking contract to handle token locking
58+
* @param graphRewardsManager The rewards manager to handle rewards distribution
59+
* @param graphToken The Graph token contract to handle token transfers
60+
* @param _allocationId The id of the allocation for which the POI is presented
61+
* @param _poi The proof of indexing (POI) to be presented
62+
* @param _poiMetadata The metadata associated with the POI
63+
* @param _delegationRatio The delegation ratio to consider when locking tokens
64+
* @param _paymentsDestination The address to which the indexing rewards should be sent
65+
*/
4066
struct PresentParams {
4167
uint256 maxPOIStaleness;
4268
IEpochManager graphEpochManager;
@@ -272,6 +298,11 @@ library AllocationManagerLib {
272298
*
273299
* Emits a {AllocationResized} event.
274300
*
301+
* @param _allocations The mapping of allocation ids to allocation states
302+
* @param allocationProvisionTracker The mapping of indexers to their locked tokens
303+
* @param _subgraphAllocatedTokens The mapping of subgraph deployment ids to their allocated tokens
304+
* @param graphStaking The Horizon staking contract to handle token locking
305+
* @param graphRewardsManager The rewards manager to handle rewards distribution
275306
* @param _allocationId The id of the allocation to be resized
276307
* @param _tokens The new amount of tokens to allocate
277308
* @param _delegationRatio The delegation ratio to consider when locking tokens
@@ -335,6 +366,8 @@ library AllocationManagerLib {
335366

336367
/**
337368
* @notice Checks if an allocation is over-allocated
369+
* @param allocationProvisionTracker The mapping of indexers to their locked tokens
370+
* @param graphStaking The Horizon staking contract to check delegation ratios
338371
* @param _indexer The address of the indexer
339372
* @param _delegationRatio The delegation ratio to consider when locking tokens
340373
* @return True if the allocation is over-allocated, false otherwise

0 commit comments

Comments
 (0)