Skip to content

Commit

Permalink
chore: x/mint docs and clean up, excluding mint keeper (backport #1857)
Browse files Browse the repository at this point in the history
  • Loading branch information
p0mvn committed Jul 14, 2022
1 parent b0afc78 commit 6feea69
Show file tree
Hide file tree
Showing 70 changed files with 1,811 additions and 1,521 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/make -f

PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation')
VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
LEDGER_ENABLED ?= true
Expand Down
44 changes: 24 additions & 20 deletions docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2533,15 +2533,17 @@ Msg defines the Msg service.
<a name="osmosis.mint.v1beta1.DistributionProportions"></a>

### DistributionProportions

DistributionProportions defines the distribution proportions of the minted
denom. In other words, defines which stakeholders will receive the minted
denoms and how much.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `staking` | [string](#string) | | staking defines the proportion of the minted minted_denom that is to be allocated as staking rewards. |
| `pool_incentives` | [string](#string) | | pool_incentives defines the proportion of the minted minted_denom that is to be allocated as pool incentives. |
| `developer_rewards` | [string](#string) | | developer_rewards defines the proportion of the minted minted_denom that is to be allocated to developer rewards address. |
| `community_pool` | [string](#string) | | community_pool defines the proportion of the minted minted_denom that is to be allocated to the community pool. |
| `staking` | [string](#string) | | staking defines the proportion of the minted mint_denom that is to be allocated as staking rewards. |
| `pool_incentives` | [string](#string) | | pool_incentives defines the proportion of the minted mint_denom that is to be allocated as pool incentives. |
| `developer_rewards` | [string](#string) | | developer_rewards defines the proportion of the minted mint_denom that is to be allocated to developer rewards address. |
| `community_pool` | [string](#string) | | community_pool defines the proportion of the minted mint_denom that is to be allocated to the community pool. |



Expand All @@ -2556,7 +2558,7 @@ Minter represents the minting state.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `epoch_provisions` | [string](#string) | | current epoch provisions |
| `epoch_provisions` | [string](#string) | | epoch_provisions represent rewards for the current epoch. |



Expand All @@ -2566,19 +2568,19 @@ Minter represents the minting state.
<a name="osmosis.mint.v1beta1.Params"></a>

### Params
Params holds parameters for the mint module.
Params holds parameters for the x/mint module.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `mint_denom` | [string](#string) | | type of coin to mint |
| `genesis_epoch_provisions` | [string](#string) | | epoch provisions from the first epoch |
| `epoch_identifier` | [string](#string) | | mint epoch identifier |
| `reduction_period_in_epochs` | [int64](#int64) | | number of epochs take to reduce rewards |
| `reduction_factor` | [string](#string) | | reduction multiplier to execute on each period |
| `distribution_proportions` | [DistributionProportions](#osmosis.mint.v1beta1.DistributionProportions) | | distribution_proportions defines the proportion of the minted denom |
| `weighted_developer_rewards_receivers` | [WeightedAddress](#osmosis.mint.v1beta1.WeightedAddress) | repeated | address to receive developer rewards |
| `minting_rewards_distribution_start_epoch` | [int64](#int64) | | start epoch to distribute minting rewards |
| `mint_denom` | [string](#string) | | mint_denom is the denom of the coin to mint. |
| `genesis_epoch_provisions` | [string](#string) | | genesis_epoch_provisions epoch provisions from the first epoch. |
| `epoch_identifier` | [string](#string) | | epoch_identifier mint epoch identifier e.g. (day, week). |
| `reduction_period_in_epochs` | [int64](#int64) | | reduction_period_in_epochs the number of epochs it takes to reduce the rewards. |
| `reduction_factor` | [string](#string) | | reduction_factor is the reduction multiplier to execute at the end of each period set by reduction_period_in_epochs. |
| `distribution_proportions` | [DistributionProportions](#osmosis.mint.v1beta1.DistributionProportions) | | distribution_proportions defines the distribution proportions of the minted denom. In other words, defines which stakeholders will receive the minted denoms and how much. |
| `weighted_developer_rewards_receivers` | [WeightedAddress](#osmosis.mint.v1beta1.WeightedAddress) | repeated | weighted_developer_rewards_receivers is the address to receive developer rewards with weights assignedt to each address. The final amount that each address receives is: epoch_provisions * distribution_proportions.developer_rewards * Address's Weight. |
| `minting_rewards_distribution_start_epoch` | [int64](#int64) | | minting_rewards_distribution_start_epoch start epoch to distribute minting rewards |



Expand All @@ -2588,7 +2590,9 @@ Params holds parameters for the mint module.
<a name="osmosis.mint.v1beta1.WeightedAddress"></a>

### WeightedAddress

WeightedAddress represents an address with a weight assigned to it.
The weight is used to determine the proportion of the total minted
tokens to be minted to the address.


| Field | Type | Label | Description |
Expand Down Expand Up @@ -2625,9 +2629,9 @@ GenesisState defines the mint module's genesis state.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `minter` | [Minter](#osmosis.mint.v1beta1.Minter) | | minter is a space for holding current rewards information. |
| `params` | [Params](#osmosis.mint.v1beta1.Params) | | params defines all the paramaters of the module. |
| `halven_started_epoch` | [int64](#int64) | | current halven period start epoch |
| `minter` | [Minter](#osmosis.mint.v1beta1.Minter) | | minter is an abstraction for holding current rewards information. |
| `params` | [Params](#osmosis.mint.v1beta1.Params) | | params defines all the paramaters of the mint module. |
| `reduction_started_epoch` | [int64](#int64) | | reduction_started_epoch is the first epoch in which the reduction of mint begins. |



Expand Down Expand Up @@ -2716,7 +2720,7 @@ Query provides defines the gRPC querier service.
| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
| `Params` | [QueryParamsRequest](#osmosis.mint.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#osmosis.mint.v1beta1.QueryParamsResponse) | Params returns the total set of minting parameters. | GET|/osmosis/mint/v1beta1/params|
| `EpochProvisions` | [QueryEpochProvisionsRequest](#osmosis.mint.v1beta1.QueryEpochProvisionsRequest) | [QueryEpochProvisionsResponse](#osmosis.mint.v1beta1.QueryEpochProvisionsResponse) | EpochProvisions current minting epoch provisions value. | GET|/osmosis/mint/v1beta1/epoch_provisions|
| `EpochProvisions` | [QueryEpochProvisionsRequest](#osmosis.mint.v1beta1.QueryEpochProvisionsRequest) | [QueryEpochProvisionsResponse](#osmosis.mint.v1beta1.QueryEpochProvisionsResponse) | EpochProvisions returns the current minting epoch provisions value. | GET|/osmosis/mint/v1beta1/epoch_provisions|

<!-- end services -->

Expand Down
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/CosmWasm/wasmd v0.24.0
github.com/cosmos/cosmos-sdk v0.45.5
github.com/cosmos/cosmos-sdk v0.45.6
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/iavl v0.17.3
github.com/cosmos/ibc-go/v3 v3.0.0
Expand All @@ -15,6 +15,7 @@ require (
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/ory/dockertest/v3 v3.9.1
github.com/osmosis-labs/bech32-ibc v0.3.0-rc1
github.com/osmosis-labs/osmosis/v7 v7.3.0
github.com/pkg/errors v0.9.1
github.com/rakyll/statik v0.1.7
github.com/regen-network/cosmos-proto v0.3.1
Expand All @@ -31,6 +32,8 @@ require (
gopkg.in/yaml.v2 v2.4.0
)

require golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect

require (
4d63.com/gochecknoglobals v0.1.0 // indirect
filippo.io/edwards25519 v1.0.0-beta.2 // indirect
Expand Down Expand Up @@ -251,7 +254,6 @@ require (
golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
golang.org/x/term v0.0.0-20220411215600-e5f449aeb171 // indirect
golang.org/x/text v0.3.7 // indirect
Expand Down
5 changes: 3 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,6 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS
github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 h1:4kuARK6Y6FxaNu/BnU2OAaLF86eTVhP2hjTB6iMvItA=
github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354/go.mod h1:KSVJerMDfblTH7p5MZaTt+8zaT2iEk3AkVb9PQdZuE8=
github.com/neilotoole/errgroup v0.1.5/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nishanths/exhaustive v0.7.11 h1:xV/WU3Vdwh5BUH4N06JNUznb6d5zhRPOnlgCrpNYNKA=
github.com/nishanths/exhaustive v0.7.11/go.mod h1:gX+MP7DWMKJmNa1HfMozK+u04hQd3na9i0hyqf3/dOI=
Expand Down Expand Up @@ -1038,6 +1037,8 @@ github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220623195843-6209434a1de9 h1:pY1T
github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220623195843-6209434a1de9/go.mod h1:pMiEr6WR7drhXAXK1FOdAKPazWCi7b+WOyWOF4O0OXY=
github.com/osmosis-labs/iavl v0.17.3-osmo-v7 h1:6KcADC/WhL7yDmNQxUIJt2XmzNt4FfRmq9gRke45w74=
github.com/osmosis-labs/iavl v0.17.3-osmo-v7/go.mod h1:lJEOIlsd3sVO0JDyXWIXa9/Ur5FBscP26zJx0KxHjto=
github.com/osmosis-labs/osmosis/v7 v7.3.0 h1:9CrUh2drxa0IKARgI5Cy6KzDHximeD3TxcNivN1TKLI=
github.com/osmosis-labs/osmosis/v7 v7.3.0/go.mod h1:uyrTFKD4w9hq0EY1PfvCmWNTtiO8X7c0ivRisBKrOA0=
github.com/osmosis-labs/wasmd v0.27.0-rc2.0.20220517191021-59051aa18d58 h1:15l3Iss2oCGCeJRi2g3CuCnqmEjpAr3Le7cDnoN/LS0=
github.com/osmosis-labs/wasmd v0.27.0-rc2.0.20220517191021-59051aa18d58/go.mod h1:0h8WBsFhyingomsrN+34JVZe/qRySHYHICyTEokCkYU=
github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw=
Expand Down Expand Up @@ -2013,8 +2014,8 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U=
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
Expand Down
11 changes: 6 additions & 5 deletions proto/osmosis/mint/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ option go_package = "github.com/osmosis-labs/osmosis/v10/x/mint/types";

// GenesisState defines the mint module's genesis state.
message GenesisState {
// minter is a space for holding current rewards information.
// minter is an abstraction for holding current rewards information.
Minter minter = 1 [ (gogoproto.nullable) = false ];

// params defines all the paramaters of the module.
// params defines all the paramaters of the mint module.
Params params = 2 [ (gogoproto.nullable) = false ];

// current halven period start epoch
int64 halven_started_epoch = 3
[ (gogoproto.moretags) = "yaml:\"halven_started_epoch\"" ];
// reduction_started_epoch is the first epoch in which the reduction of mint
// begins.
int64 reduction_started_epoch = 3
[ (gogoproto.moretags) = "yaml:\"reduction_started_epoch\"" ];
}
42 changes: 28 additions & 14 deletions proto/osmosis/mint/v1beta1/mint.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ import "google/protobuf/duration.proto";

// Minter represents the minting state.
message Minter {
// current epoch provisions
// epoch_provisions represent rewards for the current epoch.
string epoch_provisions = 1 [
(gogoproto.moretags) = "yaml:\"epoch_provisions\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
}

// WeightedAddress represents an address with a weight assigned to it.
// The weight is used to determine the proportion of the total minted
// tokens to be minted to the address.
message WeightedAddress {
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
string weight = 2 [
Expand All @@ -27,29 +30,32 @@ message WeightedAddress {
];
}

// DistributionProportions defines the distribution proportions of the minted
// denom. In other words, defines which stakeholders will receive the minted
// denoms and how much.
message DistributionProportions {
// staking defines the proportion of the minted minted_denom that is to be
// staking defines the proportion of the minted mint_denom that is to be
// allocated as staking rewards.
string staking = 1 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.moretags) = "yaml:\"staking\"",
(gogoproto.nullable) = false
];
// pool_incentives defines the proportion of the minted minted_denom that is
// pool_incentives defines the proportion of the minted mint_denom that is
// to be allocated as pool incentives.
string pool_incentives = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.moretags) = "yaml:\"pool_incentives\"",
(gogoproto.nullable) = false
];
// developer_rewards defines the proportion of the minted minted_denom that is
// developer_rewards defines the proportion of the minted mint_denom that is
// to be allocated to developer rewards address.
string developer_rewards = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.moretags) = "yaml:\"developer_rewards\"",
(gogoproto.nullable) = false
];
// community_pool defines the proportion of the minted minted_denom that is
// community_pool defines the proportion of the minted mint_denom that is
// to be allocated to the community pool.
string community_pool = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
Expand All @@ -58,39 +64,47 @@ message DistributionProportions {
];
}

// Params holds parameters for the mint module.
// Params holds parameters for the x/mint module.
message Params {
option (gogoproto.goproto_stringer) = false;

// type of coin to mint
// mint_denom is the denom of the coin to mint.
string mint_denom = 1;
// epoch provisions from the first epoch
// genesis_epoch_provisions epoch provisions from the first epoch.
string genesis_epoch_provisions = 2 [
(gogoproto.moretags) = "yaml:\"genesis_epoch_provisions\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
// mint epoch identifier
// epoch_identifier mint epoch identifier e.g. (day, week).
string epoch_identifier = 3
[ (gogoproto.moretags) = "yaml:\"epoch_identifier\"" ];
// number of epochs take to reduce rewards
// reduction_period_in_epochs the number of epochs it takes
// to reduce the rewards.
int64 reduction_period_in_epochs = 4
[ (gogoproto.moretags) = "yaml:\"reduction_period_in_epochs\"" ];
// reduction multiplier to execute on each period
// reduction_factor is the reduction multiplier to execute
// at the end of each period set by reduction_period_in_epochs.
string reduction_factor = 5 [
(gogoproto.moretags) = "yaml:\"reduction_factor\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
// distribution_proportions defines the proportion of the minted denom
// distribution_proportions defines the distribution proportions of the minted
// denom. In other words, defines which stakeholders will receive the minted
// denoms and how much.
DistributionProportions distribution_proportions = 6
[ (gogoproto.nullable) = false ];
// address to receive developer rewards
// weighted_developer_rewards_receivers is the address to receive developer
// rewards with weights assignedt to each address. The final amount that each
// address receives is: epoch_provisions *
// distribution_proportions.developer_rewards * Address's Weight.
repeated WeightedAddress weighted_developer_rewards_receivers = 7 [
(gogoproto.moretags) = "yaml:\"developer_rewards_receiver\"",
(gogoproto.nullable) = false
];
// start epoch to distribute minting rewards
// minting_rewards_distribution_start_epoch start epoch to distribute minting
// rewards
int64 minting_rewards_distribution_start_epoch = 8
[ (gogoproto.moretags) =
"yaml:\"minting_rewards_distribution_start_epoch\"" ];
Expand Down
2 changes: 1 addition & 1 deletion proto/osmosis/mint/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ service Query {
option (google.api.http).get = "/osmosis/mint/v1beta1/params";
}

// EpochProvisions current minting epoch provisions value.
// EpochProvisions returns the current minting epoch provisions value.
rpc EpochProvisions(QueryEpochProvisionsRequest)
returns (QueryEpochProvisionsResponse) {
option (google.api.http).get = "/osmosis/mint/v1beta1/epoch_provisions";
Expand Down
Loading

0 comments on commit 6feea69

Please sign in to comment.