2020-02-11 06:58:37 -08:00
|
|
|
syntax = "proto3";
|
2020-08-11 04:49:45 -07:00
|
|
|
package cosmos.distribution.v1beta1;
|
2020-02-11 06:58:37 -08:00
|
|
|
|
2020-02-26 17:16:48 -08:00
|
|
|
option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types";
|
2020-02-21 02:31:16 -08:00
|
|
|
option (gogoproto.equal_all) = true;
|
2020-02-11 06:58:37 -08:00
|
|
|
|
2020-06-18 10:04:26 -07:00
|
|
|
import "gogoproto/gogo.proto";
|
2020-08-11 04:49:45 -07:00
|
|
|
import "cosmos/base/v1beta1/coin.proto";
|
2020-02-11 06:58:37 -08:00
|
|
|
|
2020-08-19 00:36:41 -07:00
|
|
|
// Params defines the set of params for the distribution module.
|
2020-02-11 06:58:37 -08:00
|
|
|
message Params {
|
|
|
|
option (gogoproto.goproto_stringer) = false;
|
|
|
|
string community_tax = 1 [
|
|
|
|
(gogoproto.moretags) = "yaml:\"community_tax\"",
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
|
|
|
string base_proposer_reward = 2 [
|
|
|
|
(gogoproto.moretags) = "yaml:\"base_proposer_reward\"",
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
|
|
|
string bonus_proposer_reward = 3 [
|
|
|
|
(gogoproto.moretags) = "yaml:\"bonus_proposer_reward\"",
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
|
|
|
bool withdraw_addr_enabled = 4 [(gogoproto.moretags) = "yaml:\"withdraw_addr_enabled\""];
|
|
|
|
}
|
|
|
|
|
2020-08-19 00:36:41 -07:00
|
|
|
// ValidatorHistoricalRewards represents historical rewards for a validator.
|
|
|
|
// Height is implicit within the store key.
|
|
|
|
// Cumulative reward ratio is the sum from the zeroeth period
|
|
|
|
// until this period of rewards / tokens, per the spec.
|
2020-02-11 06:58:37 -08:00
|
|
|
// The reference count indicates the number of objects
|
2020-08-19 00:36:41 -07:00
|
|
|
// which might need to reference this historical entry at any point.
|
2020-02-11 06:58:37 -08:00
|
|
|
// ReferenceCount =
|
|
|
|
// number of outstanding delegations which ended the associated period (and might need to read
|
|
|
|
// that record)
|
|
|
|
// + number of slashes which ended the associated period (and might need to read that record)
|
|
|
|
// + one per validator for the zeroeth period, set on initialization
|
|
|
|
message ValidatorHistoricalRewards {
|
2020-08-11 04:49:45 -07:00
|
|
|
repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 [
|
2020-02-11 06:58:37 -08:00
|
|
|
(gogoproto.moretags) = "yaml:\"cumulative_reward_ratio\"",
|
|
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
|
|
|
uint32 reference_count = 2 [(gogoproto.moretags) = "yaml:\"reference_count\""];
|
|
|
|
}
|
|
|
|
|
2020-08-19 00:36:41 -07:00
|
|
|
// ValidatorCurrentRewards represents current rewards and current
|
|
|
|
// period for a validator kept as a running counter and incremented
|
|
|
|
// each block as long as the validator's tokens remain constant.
|
2020-02-11 06:58:37 -08:00
|
|
|
message ValidatorCurrentRewards {
|
2020-08-11 04:49:45 -07:00
|
|
|
repeated cosmos.base.v1beta1.DecCoin rewards = 1 [
|
2020-02-11 06:58:37 -08:00
|
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
|
|
|
uint64 period = 2;
|
|
|
|
}
|
|
|
|
|
2020-08-19 00:36:41 -07:00
|
|
|
// ValidatorAccumulatedCommission represents accumulated commission
|
|
|
|
// for a validator kept as a running counter, can be withdrawn at any time.
|
2020-02-11 06:58:37 -08:00
|
|
|
message ValidatorAccumulatedCommission {
|
2020-08-11 04:49:45 -07:00
|
|
|
repeated cosmos.base.v1beta1.DecCoin commission = 1 [
|
2020-02-11 06:58:37 -08:00
|
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2020-08-19 00:36:41 -07:00
|
|
|
// ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards
|
|
|
|
// for a validator inexpensive to track, allows simple sanity checks.
|
2020-02-11 06:58:37 -08:00
|
|
|
message ValidatorOutstandingRewards {
|
2020-08-11 04:49:45 -07:00
|
|
|
repeated cosmos.base.v1beta1.DecCoin rewards = 1 [
|
2020-02-11 06:58:37 -08:00
|
|
|
(gogoproto.moretags) = "yaml:\"rewards\"",
|
|
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2020-08-19 00:36:41 -07:00
|
|
|
// ValidatorSlashEvent represents a validator slash event.
|
|
|
|
// Height is implicit within the store key.
|
|
|
|
// This is needed to calculate appropriate amount of staking tokens
|
|
|
|
// for delegations which are withdrawn after a slash has occurred.
|
2020-02-11 06:58:37 -08:00
|
|
|
message ValidatorSlashEvent {
|
|
|
|
uint64 validator_period = 1 [(gogoproto.moretags) = "yaml:\"validator_period\""];
|
|
|
|
string fraction = 2 [
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2020-08-19 00:36:41 -07:00
|
|
|
// ValidatorSlashEvents is a collection of ValidatorSlashEvent messages.
|
2020-02-11 06:58:37 -08:00
|
|
|
message ValidatorSlashEvents {
|
|
|
|
option (gogoproto.goproto_stringer) = false;
|
|
|
|
repeated ValidatorSlashEvent validator_slash_events = 1
|
|
|
|
[(gogoproto.moretags) = "yaml:\"validator_slash_events\"", (gogoproto.nullable) = false];
|
|
|
|
}
|
|
|
|
|
2020-08-19 00:36:41 -07:00
|
|
|
// FeePool is the global fee pool for distribution.
|
2020-02-11 06:58:37 -08:00
|
|
|
message FeePool {
|
2020-08-11 04:49:45 -07:00
|
|
|
repeated cosmos.base.v1beta1.DecCoin community_pool = 1 [
|
2020-02-11 06:58:37 -08:00
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins",
|
|
|
|
(gogoproto.moretags) = "yaml:\"community_pool\""
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2020-08-19 00:36:41 -07:00
|
|
|
// CommunityPoolSpendProposal details a proposal for use of community funds,
|
|
|
|
// together with how many coins are proposed to be spent, and to which
|
|
|
|
// recipient account.
|
2020-02-11 06:58:37 -08:00
|
|
|
message CommunityPoolSpendProposal {
|
|
|
|
option (gogoproto.goproto_stringer) = false;
|
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
string title = 1;
|
|
|
|
string description = 2;
|
|
|
|
bytes recipient = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
|
2020-08-11 04:49:45 -07:00
|
|
|
repeated cosmos.base.v1beta1.Coin amount = 4 [
|
2020-02-11 06:58:37 -08:00
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2020-08-19 00:36:41 -07:00
|
|
|
// DelegatorStartingInfo represents the starting info for a delegator reward period.
|
|
|
|
// It tracks the previous validator period, the delegation's amount
|
2020-02-11 06:58:37 -08:00
|
|
|
// of staking token, and the creation height (to check later on
|
2020-08-19 00:36:41 -07:00
|
|
|
// if any slashes have occurred).
|
|
|
|
// NOTE: Even though validators are slashed to whole staking tokens, the
|
2020-02-11 06:58:37 -08:00
|
|
|
// delegators within the validator may be left with less than a full token,
|
2020-08-19 00:36:41 -07:00
|
|
|
// thus sdk.Dec is used.
|
2020-02-11 06:58:37 -08:00
|
|
|
message DelegatorStartingInfo {
|
|
|
|
uint64 previous_period = 1 [(gogoproto.moretags) = "yaml:\"previous_period\""];
|
|
|
|
string stake = 2 [
|
|
|
|
(gogoproto.moretags) = "yaml:\"stake\"",
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2020-02-21 02:31:16 -08:00
|
|
|
uint64 height = 3
|
|
|
|
[(gogoproto.moretags) = "yaml:\"creation_height\"", (gogoproto.jsontag) = "creation_height"];
|
2020-02-11 06:58:37 -08:00
|
|
|
}
|
2020-07-13 13:01:16 -07:00
|
|
|
|
2020-08-19 00:36:41 -07:00
|
|
|
// DelegationDelegatorReward represents the properties
|
2020-07-13 13:01:16 -07:00
|
|
|
// of a delegator's delegation reward.
|
|
|
|
message DelegationDelegatorReward {
|
|
|
|
bytes validator_address = 1 [
|
|
|
|
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
|
|
|
|
(gogoproto.moretags) = "yaml:\"validator_address\""
|
|
|
|
];
|
|
|
|
|
2020-08-11 04:49:45 -07:00
|
|
|
repeated cosmos.base.v1beta1.DecCoin reward = 2 [
|
2020-07-13 13:01:16 -07:00
|
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
|
|
|
}
|