Skip to content

Commit ba64efd

Browse files
f: fix 'this' ref in lib
1 parent d4a2db0 commit ba64efd

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ library AllocationHandler {
7676
IHorizonStaking graphStaking;
7777
IRewardsManager graphRewardsManager;
7878
IGraphToken graphToken;
79+
address dataService;
7980
address _allocationId;
8081
bytes32 _poi;
8182
bytes _poiMetadata;
@@ -314,26 +315,30 @@ library AllocationHandler {
314315
// Distribute rewards to delegators
315316
uint256 delegatorCut = params.graphStaking.getDelegationFeeCut(
316317
allocation.indexer,
317-
address(this),
318+
params.dataService,
318319
IGraphPayments.PaymentTypes.IndexingRewards
319320
);
320321
IHorizonStakingTypes.DelegationPool memory delegationPool = params.graphStaking.getDelegationPool(
321322
allocation.indexer,
322-
address(this)
323+
params.dataService
323324
);
324325
// If delegation pool has no shares then we don't need to distribute rewards to delegators
325326
tokensDelegationRewards = delegationPool.shares > 0 ? tokensRewards.mulPPM(delegatorCut) : 0;
326327
if (tokensDelegationRewards > 0) {
327328
params.graphToken.approve(address(params.graphStaking), tokensDelegationRewards);
328-
params.graphStaking.addToDelegationPool(allocation.indexer, address(this), tokensDelegationRewards);
329+
params.graphStaking.addToDelegationPool(
330+
allocation.indexer,
331+
params.dataService,
332+
tokensDelegationRewards
333+
);
329334
}
330335

331336
// Distribute rewards to indexer
332337
tokensIndexerRewards = tokensRewards - tokensDelegationRewards;
333338
if (tokensIndexerRewards > 0) {
334339
if (params._paymentsDestination == address(0)) {
335340
params.graphToken.approve(address(params.graphStaking), tokensIndexerRewards);
336-
params.graphStaking.stakeToProvision(allocation.indexer, address(this), tokensIndexerRewards);
341+
params.graphStaking.stakeToProvision(allocation.indexer, params.dataService, tokensIndexerRewards);
337342
} else {
338343
params.graphToken.pushTokens(params._paymentsDestination, tokensIndexerRewards);
339344
}

packages/subgraph-service/contracts/utilities/AllocationManager.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ abstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, Alloca
151151
graphStaking: _graphStaking(),
152152
graphRewardsManager: _graphRewardsManager(),
153153
graphToken: _graphToken(),
154+
dataService: address(this),
154155
_allocationId: _allocationId,
155156
_poi: _poi,
156157
_poiMetadata: _poiMetadata,

0 commit comments

Comments
 (0)