@@ -12,7 +12,7 @@ import { SubgraphServiceLib } from "./SubgraphServiceLib.sol";
12
12
import { Decoder } from "./Decoder.sol " ;
13
13
14
14
library IndexingAgreement {
15
- using IndexingAgreement for Manager ;
15
+ using IndexingAgreement for StorageManager ;
16
16
using Allocation for mapping (address => Allocation.State);
17
17
using SubgraphServiceLib for mapping (address => Allocation.State);
18
18
@@ -74,16 +74,16 @@ library IndexingAgreement {
74
74
bytes data;
75
75
}
76
76
77
- /// @custom:storage-location erc7201:graphprotocol.subgraph-service.storage.Manager .IndexingAgreement
78
- struct Manager {
77
+ /// @custom:storage-location erc7201:graphprotocol.subgraph-service.storage.StorageManager .IndexingAgreement
78
+ struct StorageManager {
79
79
mapping (bytes16 => State) agreements;
80
80
mapping (bytes16 agreementId = > IndexingAgreementTermsV1 data ) termsV1;
81
81
mapping (address allocationId = > bytes16 agreementId ) allocationToActiveAgreementId;
82
82
}
83
83
84
- // keccak256(abi.encode(uint256(keccak256("graphprotocol.subgraph-service.storage.Manager .IndexingAgreement")) - 1)) & ~bytes32(uint256(0xff))
85
- bytes32 private constant INDEXING_AGREEMENT_MANAGER_STORAGE_LOCATION =
86
- 0xfdb6fb5d1a390e01387ce73642e517880d8e0fedd0e7e26ac9194788a7a85200 ;
84
+ // keccak256(abi.encode(uint256(keccak256("graphprotocol.subgraph-service.storage.StorageManager .IndexingAgreement")) - 1)) & ~bytes32(uint256(0xff))
85
+ bytes32 public constant INDEXING_AGREEMENT_STORAGE_MANAGER_LOCATION =
86
+ 0xb59b65b7215c7fb95ac34d2ad5aed7c775c8bc77ad936b1b43e17b95efc8e400 ;
87
87
88
88
/**
89
89
* @notice Emitted when an indexer collects indexing fees from a V1 agreement
@@ -218,7 +218,7 @@ library IndexingAgreement {
218
218
error IndexingAgreementNotAuthorized (bytes16 agreementId , address unauthorizedIndexer );
219
219
220
220
function accept (
221
- Manager storage self ,
221
+ StorageManager storage self ,
222
222
mapping (address allocationId = > Allocation.State allocation ) storage allocations ,
223
223
address allocationId ,
224
224
IRecurringCollector.SignedRCA calldata signedRCA
@@ -289,7 +289,7 @@ library IndexingAgreement {
289
289
* @param signedRCAU The signed Recurring Collection Agreement Update
290
290
*/
291
291
function update (
292
- Manager storage self ,
292
+ StorageManager storage self ,
293
293
address indexer ,
294
294
IRecurringCollector.SignedRCAU calldata signedRCAU
295
295
) external {
@@ -332,7 +332,7 @@ library IndexingAgreement {
332
332
* @param indexer The indexer address
333
333
* @param agreementId The id of the agreement to cancel
334
334
*/
335
- function cancel (Manager storage self , address indexer , bytes16 agreementId ) external {
335
+ function cancel (StorageManager storage self , address indexer , bytes16 agreementId ) external {
336
336
AgreementWrapper memory wrapper = _get (self, agreementId);
337
337
require (_isActive (wrapper), IndexingAgreementNotActive (agreementId));
338
338
require (
@@ -348,7 +348,7 @@ library IndexingAgreement {
348
348
);
349
349
}
350
350
351
- function cancelForAllocation (Manager storage self , address _allocationId ) external {
351
+ function cancelForAllocation (StorageManager storage self , address _allocationId ) external {
352
352
bytes16 agreementId = self.allocationToActiveAgreementId[_allocationId];
353
353
if (agreementId == bytes16 (0 )) {
354
354
return ;
@@ -368,7 +368,7 @@ library IndexingAgreement {
368
368
);
369
369
}
370
370
371
- function cancelByPayer (Manager storage self , bytes16 agreementId ) external {
371
+ function cancelByPayer (StorageManager storage self , bytes16 agreementId ) external {
372
372
AgreementWrapper memory wrapper = _get (self, agreementId);
373
373
require (_isActive (wrapper), IndexingAgreementNotActive (agreementId));
374
374
require (
@@ -385,7 +385,7 @@ library IndexingAgreement {
385
385
}
386
386
387
387
function collect (
388
- Manager storage self ,
388
+ StorageManager storage self ,
389
389
mapping (address allocationId = > Allocation.State allocation ) storage allocations ,
390
390
CollectParams memory params
391
391
) external returns (address , uint256 ) {
@@ -435,28 +435,28 @@ library IndexingAgreement {
435
435
return (wrapper.collectorAgreement.serviceProvider, tokensCollected);
436
436
}
437
437
438
- function get (Manager storage self , bytes16 agreementId ) external view returns (AgreementWrapper memory ) {
438
+ function get (StorageManager storage self , bytes16 agreementId ) external view returns (AgreementWrapper memory ) {
439
439
AgreementWrapper memory wrapper = _get (self, agreementId);
440
440
require (wrapper.collectorAgreement.dataService == address (this ), IndexingAgreementNotActive (agreementId));
441
441
442
442
return wrapper;
443
443
}
444
444
445
- function _getManager () internal pure returns (Manager storage $) {
445
+ function _getStorageManager () internal pure returns (StorageManager storage $) {
446
446
// solhint-disable-next-line no-inline-assembly
447
447
assembly {
448
- $.slot := INDEXING_AGREEMENT_MANAGER_STORAGE_LOCATION
448
+ $.slot := INDEXING_AGREEMENT_STORAGE_MANAGER_LOCATION
449
449
}
450
450
}
451
451
452
- function _setTermsV1 (Manager storage _manager , bytes16 _agreementId , bytes memory _data ) private {
452
+ function _setTermsV1 (StorageManager storage _manager , bytes16 _agreementId , bytes memory _data ) private {
453
453
IndexingAgreementTermsV1 memory newTerms = Decoder.decodeIndexingAgreementTermsV1 (_data);
454
454
_manager.termsV1[_agreementId].tokensPerSecond = newTerms.tokensPerSecond;
455
455
_manager.termsV1[_agreementId].tokensPerEntityPerSecond = newTerms.tokensPerEntityPerSecond;
456
456
}
457
457
458
458
function _cancel (
459
- Manager storage _manager ,
459
+ StorageManager storage _manager ,
460
460
bytes16 _agreementId ,
461
461
State memory _agreement ,
462
462
IRecurringCollector.AgreementData memory _collectorAgreement ,
@@ -477,7 +477,7 @@ library IndexingAgreement {
477
477
}
478
478
479
479
function _tokensToCollect (
480
- Manager storage _manager ,
480
+ StorageManager storage _manager ,
481
481
bytes16 _agreementId ,
482
482
IRecurringCollector.AgreementData memory _agreement ,
483
483
uint256 _entities
@@ -509,7 +509,7 @@ library IndexingAgreement {
509
509
return SubgraphService (address (this ));
510
510
}
511
511
512
- function _get (Manager storage self , bytes16 agreementId ) private view returns (AgreementWrapper memory ) {
512
+ function _get (StorageManager storage self , bytes16 agreementId ) private view returns (AgreementWrapper memory ) {
513
513
return
514
514
AgreementWrapper ({
515
515
agreement: self.agreements[agreementId],
0 commit comments