Skip to content

Commit

Permalink
- qb1542: Fix incorrect truncate impl of NozSupply formula
Browse files Browse the repository at this point in the history
  • Loading branch information
jialbai committed Dec 21, 2022
1 parent 31b6277 commit 80efcad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion x/register/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ func (k Keeper) NozSupply(ctx sdk.Context) (remaining, total sdk.Int) {
S := k.GetInitialGenesisStakeTotal(ctx)
Pt := k.GetTotalUnissuedPrepay(ctx).Amount
// total supply = Lt * ( 1 + Pt / S )
total = (Pt.ToDec().Quo(S.ToDec()).TruncateInt().Add(sdk.NewInt(1))).Mul(remaining)
total = Pt.ToDec().Quo(S.ToDec()).Add(sdk.NewInt(1).ToDec()).Mul(remaining.ToDec()).TruncateInt()
return remaining, total
}

Expand Down

0 comments on commit 80efcad

Please sign in to comment.