File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import "./Cobbs.sol";
14
14
*/
15
15
library Rebates {
16
16
using SafeMath for uint256 ;
17
+ using Rebates for Rebates.Pool;
17
18
18
19
// Tracks stats for allocations closed on a particular epoch for claiming
19
20
// The pool also keeps tracks of total query fees collected and stake used
@@ -86,7 +87,7 @@ library Rebates {
86
87
uint256 rebateReward = 0 ;
87
88
88
89
// Calculate the rebate rewards for the indexer
89
- if (pool.fees > 0 ) {
90
+ if (pool.fees > 0 && _indexerEffectiveAllocatedStake > 0 ) {
90
91
rebateReward = LibCobbDouglas.cobbDouglas (
91
92
pool.fees, // totalRewards
92
93
_indexerFees,
@@ -98,7 +99,7 @@ library Rebates {
98
99
);
99
100
100
101
// Under NO circumstance we will reward more than total fees in the pool
101
- uint256 _unclaimedFees = pool.fees. sub (pool.claimedRewards );
102
+ uint256 _unclaimedFees = pool.unclaimedFees ( );
102
103
if (rebateReward > _unclaimedFees) {
103
104
rebateReward = _unclaimedFees;
104
105
}
You can’t perform that action at this time.
0 commit comments