Skip to content

Commit

Permalink
fix: reward_calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
notJoon committed Jan 9, 2025
1 parent 09bfc7c commit 30fb984
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gov/staker/reward_calculation.gno
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,11 @@ func calculateProtocolFee() {
return
}

registered := common.ListRegisteredTokens()
// get gov staker's grc20 balance
for _, tokenPath := range common.ListRegisteredTokens() {
tokenBalance, exists := accuProtocolFee.Get(tokenPath)
if !exists || tokenBalance == uint64(0) {
continue
}

leftValue, exists := leftProtocolFeeFromLast.Get(tokenPath)
leftFromLast := uint64(0)
Expand Down Expand Up @@ -399,4 +401,4 @@ func calculateProtocolFee() {
alreadyCalculatedProtocolFee.Set(tokenPath, current+tokenBalance.(uint64))
leftProtocolFeeFromLast.Set(tokenPath, tokenBalance.(uint64)-calculated)
}
}
}

0 comments on commit 30fb984

Please sign in to comment.