Skip to content

Commit 7ca134d

Browse files
f: more NatSpec
1 parent 8f8a0d2 commit 7ca134d

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ library IndexingAgreement {
235235
* Emits {IndexingAgreementAccepted} event
236236
*
237237
* @param self The indexing agreement storage manager
238+
* @param allocations The mapping of allocation IDs to their states
238239
* @param allocationId The id of the allocation
239240
* @param signedRCA The signed Recurring Collection Agreement
240241
*/

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ library SubgraphServiceLib {
99
using Allocation for mapping(address => Allocation.State);
1010
using Allocation for Allocation.State;
1111

12+
/**
13+
* @notice Requires that the allocation is valid and owned by the indexer.
14+
*
15+
* Requirements:
16+
* - Allocation must belong to the indexer
17+
* - Allocation must be open
18+
*
19+
* @param self The allocation storage manager
20+
* @param allocationId The id of the allocation
21+
* @param indexer The address of the indexer
22+
* @return The allocation state
23+
*/
1224
function requireValidAllocation(
1325
mapping(address => Allocation.State) storage self,
1426
address allocationId,

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,20 @@ import { IndexingAgreement } from "./IndexingAgreement.sol";
66
library UnsafeDecoder {
77
/**
88
* @notice See {Decoder.decodeCollectIndexingFeeData}
9+
* @param data The data to decode
10+
* @return agreementId The agreement ID
11+
* @return nestedData The nested encoded data
912
*/
1013
function decodeCollectIndexingFeeData_(bytes calldata data) public pure returns (bytes16, bytes memory) {
1114
return abi.decode(data, (bytes16, bytes));
1215
}
1316

1417
/**
1518
* @notice See {Decoder.decodeRCAMetadata}
19+
* @dev The data should be encoded as {IndexingAgreement.AcceptIndexingAgreementMetadata}
20+
* @param data The data to decode
21+
* @return The decoded data
22+
*
1623
*/
1724
function decodeRCAMetadata_(
1825
bytes calldata data
@@ -22,6 +29,9 @@ library UnsafeDecoder {
2229

2330
/**
2431
* @notice See {Decoder.decodeRCAUMetadata}
32+
* @dev The data should be encoded as {IndexingAgreement.UpdateIndexingAgreementMetadata}
33+
* @param data The data to decode
34+
* @return The decoded data
2535
*/
2636
function decodeRCAUMetadata_(
2737
bytes calldata data
@@ -31,6 +41,11 @@ library UnsafeDecoder {
3141

3242
/**
3343
* @notice See {Decoder.decodeCollectIndexingFeeDataV1}
44+
* @dev The data should be encoded as (uint256 entities, bytes32 poi, uint256 epoch)
45+
* @param data The data to decode
46+
* @return entities The number of entities indexed
47+
* @return poi The proof of indexing
48+
* @return epoch The current epoch
3449
*/
3550
function decodeCollectIndexingFeeDataV1_(
3651
bytes memory data
@@ -40,6 +55,9 @@ library UnsafeDecoder {
4055

4156
/**
4257
* @notice See {Decoder.decodeIndexingAgreementTermsV1}
58+
* @dev The data should be encoded as {IndexingAgreement.IndexingAgreementTermsV1}
59+
* @param data The data to decode
60+
* @return The decoded indexing agreement terms
4361
*/
4462
function decodeIndexingAgreementTermsV1_(
4563
bytes memory data

0 commit comments

Comments
 (0)