Skip to content

Commit 3cea40c

Browse files
benjamin202410liam.lai
and
liam.lai
authored
fix: owner and foundation same address for reward (#1024)
Co-authored-by: liam.lai <liam.lai@us>
1 parent d25c6f0 commit 3cea40c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

contracts/utils.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,12 @@ func GetRewardBalancesRate(foundationWalletAddr common.Address, statedb *state.S
466466

467467
foundationReward := new(big.Int).Mul(totalReward, new(big.Int).SetInt64(common.RewardFoundationPercent))
468468
foundationReward = new(big.Int).Div(foundationReward, new(big.Int).SetInt64(100))
469-
balances[foundationWalletAddr] = foundationReward
469+
470+
if balances[foundationWalletAddr] != nil {
471+
balances[foundationWalletAddr].Add(balances[foundationWalletAddr], foundationReward)
472+
} else {
473+
balances[foundationWalletAddr] = foundationReward
474+
}
470475

471476
jsonHolders, err := json.Marshal(balances)
472477
if err != nil {

0 commit comments

Comments
 (0)