Skip to content

Commit 866c982

Browse files
f: more NatSpec
1 parent 4c9ae69 commit 866c982

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

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

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,34 @@ library IndexingAgreement {
6868
uint256 tokensPerEntityPerSecond;
6969
}
7070

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+
*/
7177
struct CollectParams {
7278
bytes16 agreementId;
7379
uint256 currentEpoch;
7480
bytes data;
7581
}
7682

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+
*/
7889
struct StorageManager {
7990
mapping(bytes16 => State) agreements;
8091
mapping(bytes16 agreementId => IndexingAgreementTermsV1 data) termsV1;
8192
mapping(address allocationId => bytes16 agreementId) allocationToActiveAgreementId;
8293
}
8394

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+
*/
8599
bytes32 public constant INDEXING_AGREEMENT_STORAGE_MANAGER_LOCATION =
86100
0xb59b65b7215c7fb95ac34d2ad5aed7c775c8bc77ad936b1b43e17b95efc8e400;
87101

@@ -528,12 +542,12 @@ library IndexingAgreement {
528542
/**
529543
* @notice Get the storage manager for indexing agreements.
530544
* @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
532546
*/
533-
function _getStorageManager() internal pure returns (StorageManager storage $) {
547+
function _getStorageManager() internal pure returns (StorageManager storage m) {
534548
// solhint-disable-next-line no-inline-assembly
535549
assembly {
536-
$.slot := INDEXING_AGREEMENT_STORAGE_MANAGER_LOCATION
550+
m.slot := INDEXING_AGREEMENT_STORAGE_MANAGER_LOCATION
537551
}
538552
}
539553

@@ -615,6 +629,8 @@ library IndexingAgreement {
615629
* - The underlying collector agreement has been accepted
616630
* - The underlying collector agreement's data service is this contract
617631
* - 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
618634
**/
619635
function _isActive(AgreementWrapper memory wrapper) private view returns (bool) {
620636
return

0 commit comments

Comments
 (0)