File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -415,8 +415,12 @@ export class DistributorV2Worker {
415
415
416
416
if ( sendCeilingData && sendCeilingData . weight > 0n ) {
417
417
const scaledPreviousReward = previousReward / BigInt ( sendSlash . scaling_divisor )
418
+ const cappedSendScore =
419
+ sendCeilingData . weight > scaledPreviousReward
420
+ ? scaledPreviousReward
421
+ : sendCeilingData . weight
418
422
if ( scaledPreviousReward > 0n ) {
419
- const slashPercentage = ( sendCeilingData . weight * PERC_DENOM ) / scaledPreviousReward
423
+ const slashPercentage = ( cappedSendScore * PERC_DENOM ) / scaledPreviousReward
420
424
amountAfterSlash = ( amount * slashPercentage ) / PERC_DENOM
421
425
} else {
422
426
amountAfterSlash = 0n
@@ -533,6 +537,11 @@ export class DistributorV2Worker {
533
537
fixedPoolAmountsByAddress [ share . address ] ?. amountAfterSlash || 0n
534
538
const amountAfterSlash = hodlerPoolAmountAfterSlash + fixedPoolAmountAfterSlash
535
539
540
+ // Skip if amountAfterSlash is 0
541
+ if ( amountAfterSlash <= 0n ) {
542
+ return null
543
+ }
544
+
536
545
// Update totals
537
546
totalAmount += amount
538
547
totalHodlerPoolAmount += hodlerPoolAmount
You can’t perform that action at this time.
0 commit comments