From 3cea40cf9d2230ff1ef2734147d367c81ab7f81c Mon Sep 17 00:00:00 2001 From: benjamin202410 Date: Thu, 1 May 2025 08:46:09 -0700 Subject: [PATCH] fix: owner and foundation same address for reward (#1024) Co-authored-by: liam.lai --- contracts/utils.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contracts/utils.go b/contracts/utils.go index cd007afad6..6e5f453bd6 100644 --- a/contracts/utils.go +++ b/contracts/utils.go @@ -466,7 +466,12 @@ func GetRewardBalancesRate(foundationWalletAddr common.Address, statedb *state.S foundationReward := new(big.Int).Mul(totalReward, new(big.Int).SetInt64(common.RewardFoundationPercent)) foundationReward = new(big.Int).Div(foundationReward, new(big.Int).SetInt64(100)) - balances[foundationWalletAddr] = foundationReward + + if balances[foundationWalletAddr] != nil { + balances[foundationWalletAddr].Add(balances[foundationWalletAddr], foundationReward) + } else { + balances[foundationWalletAddr] = foundationReward + } jsonHolders, err := json.Marshal(balances) if err != nil {