@@ -123,7 +123,8 @@ contract Staking is Governed {
123
123
address channelID ,
124
124
address from ,
125
125
uint256 curationFees ,
126
- uint256 rebateFees
126
+ uint256 rebateFees ,
127
+ uint256 effectiveAllocation
127
128
);
128
129
129
130
/**
@@ -514,8 +515,7 @@ contract Staking is Governed {
514
515
) private {
515
516
address indexer = channels[_channelID].indexer;
516
517
bytes32 subgraphID = channels[_channelID].subgraphID;
517
- Stakes.Indexer storage indexerStake = stakes[indexer];
518
- Stakes.Allocation storage alloc = indexerStake.allocations[subgraphID];
518
+ Stakes.Allocation storage alloc = stakes[indexer].allocations[subgraphID];
519
519
520
520
require (alloc.hasChannel (), "Channel: Must be active for settlement " );
521
521
@@ -530,16 +530,15 @@ contract Staking is Governed {
530
530
531
531
// Set apart fees into a rebate pool
532
532
uint256 rebateFees = _tokens.sub (curationFees);
533
- rebates[currentEpoch].add (
534
- indexer,
535
- subgraphID,
536
- rebateFees,
537
- alloc.getTokensEffectiveAllocation (epochs, maxAllocationEpochs)
533
+ uint256 effectiveAllocation = alloc.getTokensEffectiveAllocation (
534
+ epochs,
535
+ maxAllocationEpochs
538
536
);
537
+ rebates[currentEpoch].add (indexer, subgraphID, rebateFees, effectiveAllocation);
539
538
540
539
// Close channel
541
540
// NOTE: Channels used are never deleted from state tracked in `channels` var
542
- indexerStake .unallocateTokens (subgraphID, alloc.tokens);
541
+ stakes[indexer] .unallocateTokens (subgraphID, alloc.tokens);
543
542
alloc.channelID = address (0 );
544
543
alloc.createdAtEpoch = 0 ;
545
544
// TODO: send multisig one-shot invalidation
@@ -560,7 +559,8 @@ contract Staking is Governed {
560
559
_channelID,
561
560
_from,
562
561
rebateFees,
563
- curationFees
562
+ curationFees,
563
+ effectiveAllocation
564
564
);
565
565
}
566
566
0 commit comments