diff --git a/.drone.yml b/.drone.yml index 2e46b64a0..ab613cead 100644 --- a/.drone.yml +++ b/.drone.yml @@ -77,12 +77,12 @@ steps: password: from_secret: docker_password tags: - - v11.0.0-alpha.2 + - v11.0.0-beta.1 when: event: - push branch: - - jhernandez/tokenomics-update + - jhernandezb/v11-beta-release - name: docker_release image: plugins/docker settings: @@ -350,7 +350,7 @@ steps: - ./scripts/ci/upgrade/proposal.sh - name: stargaze-upgraded pull: always - image: publicawesome/stargaze:v11.0.0-alpha.2 + image: publicawesome/stargaze:v11.0.0-beta.1 commands: - ./scripts/ci/upgrade/run-upgrade.sh environment: @@ -369,10 +369,11 @@ steps: - http://icad:26657 - name: check-params pull: always - image: publicawesome/stargaze:v11.0.0-alpha.2 + image: publicawesome/stargaze:v11.0.0-beta.1 commands: - starsd q mint params --node http://stargaze-upgraded:26657 - starsd q alloc params --node http://stargaze-upgraded:26657 + - starsd q tokenfactory params --node http://stargaze-upgraded:26657 - starsd q bank balances stars1mnyrspq208uv5m2krdctan2dkyht0szje9s43h --node http://stargaze-upgraded:26657 - starsd q bank balances stars103y4f6h80lc45nr8chuzr3fyzqywm9n0gnr394 --node http://stargaze-upgraded:26657 - starsd q distribution community-pool --node http://stargaze-upgraded:26657 @@ -415,6 +416,6 @@ volumes: --- kind: signature -hmac: 6d7b77c0e3c04feeaa508ac592da7feeb6963d8b85da31d180d2bec0b2d3d7eb +hmac: a2715d033d33712aeeb3f541b01e43677014a6871dc7d91b3da0ad19e13faf71 ... diff --git a/app/app.go b/app/app.go index 01a15e5a3..4511b4aba 100644 --- a/app/app.go +++ b/app/app.go @@ -552,10 +552,6 @@ func NewStargazeApp( registry.RegisterEncoder(claimmoduletypes.ModuleName, claimwasm.Encoder) registry.RegisterEncoder(allocmoduletypes.ModuleName, allocwasm.Encoder) - // The last arguments can contain custom message handlers, and custom query handlers, - // if we want to allow any custom callbacks - availableCapabilities := "iterator,staking,stargate,stargaze,cosmwasm_1_1,cosmwasm_1_2,token_factory" - // Wasm accepted Stargate Queries acceptStargateQueriesList := wasmkeeper.AcceptedStargateQueries{ "/stargaze.tokenfactory.v1.Query/Params": &tokenfactorytypes.QueryParamsResponse{}, @@ -586,7 +582,7 @@ func NewStargazeApp( app.GRPCQueryRouter(), wasmDir, wasmConfig, - availableCapabilities, + GetWasmCapabilities(), wasmOpts..., ) diff --git a/app/upgrades.go b/app/upgrades.go index 70b016449..aa497214d 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -25,10 +25,6 @@ func (app *App) RegisterUpgradeHandlers(cfg module.Configurator) { if err != nil { return nil, err } - params := app.TokenFactoryKeeper.GetParams(ctx) - params.DenomCreationFee = nil - params.DenomCreationGasConsume = 50_000_000 // 50STARS at 1ustars - app.TokenFactoryKeeper.SetParams(ctx, params) // Following param changes reflect what was approved by prop 165 and combined in a single upgrade for Prop 1-3 // https://www.mintscan.io/stargaze/proposals/165 @@ -49,6 +45,14 @@ func (app *App) RegisterUpgradeHandlers(cfg module.Configurator) { // update blocks per year using 5.9 s avg block time mintParams.BlocksPerYear = 5345036 app.MintKeeper.SetParams(ctx, mintParams) + denom := app.MintKeeper.GetParams(ctx).MintDenom + + // token factory params + params := app.TokenFactoryKeeper.GetParams(ctx) + // 10k STARS + params.DenomCreationFee = sdk.NewCoins(sdk.NewInt64Coin(denom, 10_000_000_000)) + + app.TokenFactoryKeeper.SetParams(ctx, params) // set community tax to 0 since the allocation module will now take care of it // making an accurate allocation of the inflation @@ -56,8 +60,6 @@ func (app *App) RegisterUpgradeHandlers(cfg module.Configurator) { distributionParams.CommunityTax = sdk.ZeroDec() app.DistrKeeper.SetParams(ctx, distributionParams) - denom := app.MintKeeper.GetParams(ctx).MintDenom - // change alloc params to set nft incentives to 0% until incentives are live allocParams := app.AllocKeeper.GetParams(ctx) diff --git a/app/wasm.go b/app/wasm.go new file mode 100644 index 000000000..589fc6f14 --- /dev/null +++ b/app/wasm.go @@ -0,0 +1,11 @@ +package app + +import "strings" + +var wasmCapabilities = []string{ + "iterator", "staking", "stargate", "stargaze", "cosmwasm_1_1", "token_factory", +} + +func GetWasmCapabilities() string { + return strings.Join(wasmCapabilities, ",") +} diff --git a/x/alloc/keeper/keeper.go b/x/alloc/keeper/keeper.go index 6e1ab6473..b71aa9445 100644 --- a/x/alloc/keeper/keeper.go +++ b/x/alloc/keeper/keeper.go @@ -81,6 +81,9 @@ func (k Keeper) DistributeInflation(ctx sdk.Context) error { // the amount that needs to be supplemented from the supplement pool supplementAmount := params.SupplementAmount.AmountOf(denom) + distributionEvent := sdk.NewEvent( + types.EventTypeDistribution, + ) // transfer supplement amount to be distributed to stakers if // 1- Supplement from params is not 0 // 2- There is enough balance in the pool @@ -93,13 +96,13 @@ func (k Keeper) DistributeInflation(ctx sdk.Context) error { if err != nil { return err } - + distributionEvent = distributionEvent.AppendAttributes(sdk.NewAttribute(types.AttributeKeySupplementAmount, supplementAmount.String())) } // retrieve balance from fee pool which is filled by minting new coins and by collecting transaction fees blockInflationAddr := k.accountKeeper.GetModuleAccount(ctx, authtypes.FeeCollectorName).GetAddress() blockInflation := k.bankKeeper.GetBalance(ctx, blockInflationAddr, denom) - + distributionEvent = distributionEvent.AppendAttributes(sdk.NewAttribute(types.AttributeKeyFeePoolAmount, blockInflation.String())) proportions := params.DistributionProportions if proportions.NftIncentives.GT(sdk.ZeroDec()) { @@ -110,9 +113,7 @@ func (k Keeper) DistributeInflation(ctx sdk.Context) error { if err != nil { return err } - - // iterate over list of incentive addresses and proportions - k.Logger(ctx).Debug("fund incentive rewards", "amount", incentiveRewards.String(), "from", blockInflationAddr) + distributionEvent = distributionEvent.AppendAttributes(sdk.NewAttribute(types.AttributeKeyIncentivesAmount, incentiveRewards.String())) } // fund community pool if the value is not nil and greater than zero @@ -122,14 +123,20 @@ func (k Keeper) DistributeInflation(ctx sdk.Context) error { if err != nil { return err } + distributionEvent = distributionEvent.AppendAttributes(sdk.NewAttribute(types.AttributeKeyCommunityPoolAmount, communityPoolTax.String())) } devRewards := k.GetProportions(ctx, blockInflation, proportions.DeveloperRewards) + distributionEvent = distributionEvent.AppendAttributes(sdk.NewAttribute(types.AttributeKeyDevRewardsAmount, devRewards.String())) err := k.DistributeWeightedRewards(ctx, blockInflationAddr, devRewards, params.WeightedDeveloperRewardsReceivers) if err != nil { return err } + ctx.EventManager().EmitEvents(sdk.Events{ + distributionEvent, + }) + // fairburn pool fairburnPoolAddress := k.accountKeeper.GetModuleAccount(ctx, types.FairburnPoolName).GetAddress() collectedFairburnFees := k.bankKeeper.GetBalance(ctx, fairburnPoolAddress, denom) diff --git a/x/alloc/types/events.go b/x/alloc/types/events.go index d9d9df4f8..2de461f00 100644 --- a/x/alloc/types/events.go +++ b/x/alloc/types/events.go @@ -1,6 +1,12 @@ package types const ( - EventTypeFundFairburnPool = "fund_fairburn_pool" - AttributeValueCategory = ModuleName + EventTypeFundFairburnPool = "fund_fairburn_pool" + EventTypeDistribution = "alloc_distribution" + AttributeValueCategory = ModuleName + AttributeKeySupplementAmount = "supplement_amount" + AttributeKeyCommunityPoolAmount = "community_pool_amount" + AttributeKeyIncentivesAmount = "incentives_amount" + AttributeKeyDevRewardsAmount = "dev_rewards_amount" + AttributeKeyFeePoolAmount = "fee_pool_amount" )