@@ -5,14 +5,14 @@ import { IGraphToken } from "@graphprotocol/contracts/contracts/token/IGraphToke
5
5
import { IHorizonStaking } from "@graphprotocol/horizon/contracts/interfaces/IHorizonStaking.sol " ;
6
6
import { IDisputeManager } from "./interfaces/IDisputeManager.sol " ;
7
7
import { ISubgraphService } from "./interfaces/ISubgraphService.sol " ;
8
- import { IRecurringCollector } from "@graphprotocol/horizon/contracts/interfaces/IRecurringCollector.sol " ;
9
8
10
9
import { Math } from "@openzeppelin/contracts/utils/math/Math.sol " ;
11
10
import { TokenUtils } from "@graphprotocol/contracts/contracts/utils/TokenUtils.sol " ;
12
11
import { PPMMath } from "@graphprotocol/horizon/contracts/libraries/PPMMath.sol " ;
13
12
import { MathUtils } from "@graphprotocol/horizon/contracts/libraries/MathUtils.sol " ;
14
13
import { Allocation } from "./libraries/Allocation.sol " ;
15
14
import { Attestation } from "./libraries/Attestation.sol " ;
15
+ import { IndexingAgreement } from "./libraries/IndexingAgreement.sol " ;
16
16
17
17
import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol " ;
18
18
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol " ;
@@ -480,25 +480,25 @@ contract DisputeManager is
480
480
bytes32 _poi ,
481
481
uint256 _entities
482
482
) private returns (bytes32 ) {
483
- (
484
- ISubgraphService.IndexingAgreementData memory indexingAgreement ,
485
- IRecurringCollector.AgreementData memory agreement
486
- ) = _getSubgraphService ().getIndexingAgreement (_agreementId);
483
+ IndexingAgreement.AgreementWrapper memory wrapper = _getSubgraphService ().getIndexingAgreement (_agreementId);
487
484
488
485
// Agreement must have been collected on and be a version 1
489
- require (agreement.lastCollectionAt > 0 , DisputeManagerIndexingAgreementNotDisputable (_agreementId));
490
486
require (
491
- indexingAgreement.version == ISubgraphService.IndexingAgreementVersion.V1,
492
- DisputeManagerIndexingAgreementInvalidVersion (indexingAgreement.version)
487
+ wrapper.collectorAgreement.lastCollectionAt > 0 ,
488
+ DisputeManagerIndexingAgreementNotDisputable (_agreementId)
489
+ );
490
+ require (
491
+ wrapper.agreement.version == IndexingAgreement.IndexingAgreementVersion.V1,
492
+ DisputeManagerIndexingAgreementInvalidVersion (wrapper.agreement.version)
493
493
);
494
494
495
495
// Create a disputeId
496
496
bytes32 disputeId = keccak256 (
497
497
abi.encodePacked (
498
498
"IndexingFeeDisputeWithAgreement " ,
499
499
_agreementId,
500
- agreement .serviceProvider,
501
- agreement .payer,
500
+ wrapper.collectorAgreement .serviceProvider,
501
+ wrapper.collectorAgreement .payer,
502
502
_poi,
503
503
_entities
504
504
)
@@ -509,14 +509,14 @@ contract DisputeManager is
509
509
510
510
// The indexer must be disputable
511
511
IHorizonStaking.Provision memory provision = _graphStaking ().getProvision (
512
- agreement .serviceProvider,
512
+ wrapper.collectorAgreement .serviceProvider,
513
513
address (_getSubgraphService ())
514
514
);
515
515
require (provision.tokens != 0 , DisputeManagerZeroTokens ());
516
516
517
- uint256 stakeSnapshot = _getStakeSnapshot (agreement .serviceProvider, provision.tokens);
517
+ uint256 stakeSnapshot = _getStakeSnapshot (wrapper.collectorAgreement .serviceProvider, provision.tokens);
518
518
disputes[disputeId] = Dispute (
519
- agreement .serviceProvider,
519
+ wrapper.collectorAgreement .serviceProvider,
520
520
_fisherman,
521
521
_deposit,
522
522
0 , // no related dispute,
@@ -528,10 +528,10 @@ contract DisputeManager is
528
528
529
529
emit IndexingFeeDisputeCreated (
530
530
disputeId,
531
- agreement .serviceProvider,
531
+ wrapper.collectorAgreement .serviceProvider,
532
532
_fisherman,
533
533
_deposit,
534
- agreement .payer,
534
+ wrapper.collectorAgreement .payer,
535
535
_agreementId,
536
536
_poi,
537
537
_entities,
0 commit comments