Skip to content

Commit

Permalink
StakingTokenSupply no longer includes Dao Treasury
Browse files Browse the repository at this point in the history
  • Loading branch information
cgdusek authored and AaronKutch committed Aug 22, 2023
1 parent 6a3986f commit 13ddd90
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion x/staking/keeper/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,14 @@ func (k Keeper) TotalBondedTokens(ctx sdk.Context) sdk.Int {

// StakingTokenSupply staking tokens from the total supply
func (k Keeper) StakingTokenSupply(ctx sdk.Context) sdk.Int {
return k.bankKeeper.GetSupply(ctx, k.BondDenom(ctx)).Amount
stakeSupply := k.bankKeeper.GetSupply(ctx, k.BondDenom(ctx)).Amount
daoAddr := k.authKeeper.GetModuleAddress("dao")
if daoAddr != nil {
daoSupply := k.bankKeeper.GetBalance(ctx, daoAddr, k.BondDenom(ctx))
stakeSupply = stakeSupply.Sub(daoSupply.Amount)
}

return stakeSupply
}

// BondedRatio the fraction of the staking tokens which are currently bonded
Expand Down

0 comments on commit 13ddd90

Please sign in to comment.