Skip to content

Commit 30fb984

Browse files
committed
fix: reward_calculation
1 parent 09bfc7c commit 30fb984

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

gov/staker/reward_calculation.gno

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,11 @@ func calculateProtocolFee() {
349349
return
350350
}
351351

352-
registered := common.ListRegisteredTokens()
353-
// get gov staker's grc20 balance
354352
for _, tokenPath := range common.ListRegisteredTokens() {
353+
tokenBalance, exists := accuProtocolFee.Get(tokenPath)
354+
if !exists || tokenBalance == uint64(0) {
355+
continue
356+
}
355357

356358
leftValue, exists := leftProtocolFeeFromLast.Get(tokenPath)
357359
leftFromLast := uint64(0)
@@ -399,4 +401,4 @@ func calculateProtocolFee() {
399401
alreadyCalculatedProtocolFee.Set(tokenPath, current+tokenBalance.(uint64))
400402
leftProtocolFeeFromLast.Set(tokenPath, tokenBalance.(uint64)-calculated)
401403
}
402-
}
404+
}

0 commit comments

Comments
 (0)