Skip to content

Commit

Permalink
aaa
Browse files Browse the repository at this point in the history
  • Loading branch information
smartdev0328 committed Dec 5, 2022
1 parent a32e22e commit 955e4f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
2 changes: 1 addition & 1 deletion proto/pageinflation/minted_pool.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ package smartdev0328.bluechip.pageinflation;
option go_package = "github.com/smartdev0328/bluechip/x/pageinflation/types";

message MintedPool {
uint64 value = 1;
string value = 1;

}
21 changes: 3 additions & 18 deletions x/pageinflation/keeper/msg_server_creator_pool_mint.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,16 @@ package keeper

import (
"context"
"strconv"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/smartdev0328/bluechip/x/pageinflation/types"
)

func (k msgServer) CreatorPoolMint(goCtx context.Context, msg *types.MsgCreatorPoolMint) (*types.MsgCreatorPoolMintResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
currentBlock := uint64(ctx.BlockHeight())

storeMintDenom, isFound := k.GetMintDenom(ctx)
mintDenom := ""
if isFound {
mintDenom = storeMintDenom.Value
} else {
mintDenom = "ubluechip"
}
///
storeStartBlock, isFound := k.GetStartBlock(ctx)
startBlock := uint64(0)
if isFound {
startBlock, _ = strconv.ParseUint(storeStartBlock.Value, 0, 64)
} else {
startBlock = currentBlock
}

mintDenom := "ubluechip"

mintedAmount := sdk.NewDec(4500000000000000).Quo(k.bankKeeper.GetSupply(ctx, mintDenom).Amount.ToDec().Quo(sdk.NewDec(100))).Mul(sdk.NewDec(1000000))
mintedCoin := sdk.NewCoin(mintDenom, mintedAmount.TruncateInt())
coins := sdk.NewCoins(mintedCoin)
Expand Down

0 comments on commit 955e4f6

Please sign in to comment.