@@ -68,20 +68,34 @@ library IndexingAgreement {
68
68
uint256 tokensPerEntityPerSecond;
69
69
}
70
70
71
+ /**
72
+ * @notice Parameters for collecting indexing fees
73
+ * @param agreementId The ID of the indexing agreement
74
+ * @param currentEpoch The current epoch
75
+ * @param data The encoded data containing the number of entities indexed, proof of indexing, and epoch
76
+ */
71
77
struct CollectParams {
72
78
bytes16 agreementId;
73
79
uint256 currentEpoch;
74
80
bytes data;
75
81
}
76
82
77
- /// @custom:storage-location erc7201:graphprotocol.subgraph-service.storage.StorageManager.IndexingAgreement
83
+ /**
84
+ * @notice Storage manager for indexing agreements
85
+ * @dev This struct holds the state of indexing agreements and their terms.
86
+ * It is used to manage the lifecycle of indexing agreements in the subgraph service.
87
+ * @custom:storage-location erc7201:graphprotocol.subgraph-service.storage.StorageManager.IndexingAgreement
88
+ */
78
89
struct StorageManager {
79
90
mapping (bytes16 => State) agreements;
80
91
mapping (bytes16 agreementId = > IndexingAgreementTermsV1 data ) termsV1;
81
92
mapping (address allocationId = > bytes16 agreementId ) allocationToActiveAgreementId;
82
93
}
83
94
84
- // keccak256(abi.encode(uint256(keccak256("graphprotocol.subgraph-service.storage.StorageManager.IndexingAgreement")) - 1)) & ~bytes32(uint256(0xff))
95
+ /**
96
+ * @notice Storage location for the indexing agreement storage manager
97
+ * @dev Equals keccak256(abi.encode(uint256(keccak256("graphprotocol.subgraph-service.storage.StorageManager.IndexingAgreement")) - 1)) & ~bytes32(uint256(0xff))
98
+ */
85
99
bytes32 public constant INDEXING_AGREEMENT_STORAGE_MANAGER_LOCATION =
86
100
0xb59b65b7215c7fb95ac34d2ad5aed7c775c8bc77ad936b1b43e17b95efc8e400 ;
87
101
@@ -528,12 +542,12 @@ library IndexingAgreement {
528
542
/**
529
543
* @notice Get the storage manager for indexing agreements.
530
544
* @dev This function retrieves the storage manager for indexing agreements.
531
- * @return $ The storage manager for indexing agreements
545
+ * @return m The storage manager for indexing agreements
532
546
*/
533
- function _getStorageManager () internal pure returns (StorageManager storage $ ) {
547
+ function _getStorageManager () internal pure returns (StorageManager storage m ) {
534
548
// solhint-disable-next-line no-inline-assembly
535
549
assembly {
536
- $ .slot := INDEXING_AGREEMENT_STORAGE_MANAGER_LOCATION
550
+ m .slot := INDEXING_AGREEMENT_STORAGE_MANAGER_LOCATION
537
551
}
538
552
}
539
553
@@ -615,6 +629,8 @@ library IndexingAgreement {
615
629
* - The underlying collector agreement has been accepted
616
630
* - The underlying collector agreement's data service is this contract
617
631
* - The indexing agreement has been accepted and has a valid allocation ID
632
+ * @param wrapper The agreement wrapper containing the indexing agreement and collector agreement data
633
+ * @return True if the agreement is active, false otherwise
618
634
**/
619
635
function _isActive (AgreementWrapper memory wrapper ) private view returns (bool ) {
620
636
return
0 commit comments