remove legacy committee migration (#1360)

Co-authored-by: Draco <draco@dracoli.com>
This commit is contained in:
Nick DeLuca 2022-10-21 13:02:55 -07:00 committed by GitHub
parent f1c37725cc
commit 52fc29952e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 0 additions and 3850 deletions

View File

@ -1,481 +0,0 @@
package v0_15
import (
"encoding/json"
"fmt"
"strings"
"time"
sdk "github.com/cosmos/cosmos-sdk/types"
v036gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v036"
)
const MaxCommitteeDescriptionLength int = 512
type TallyOption uint64
const (
NullTallyOption TallyOption = iota
FirstPastThePost TallyOption = iota // Votes are tallied each block and the proposal passes as soon as the vote threshold is reached
Deadline TallyOption = iota // Votes are tallied exactly once, when the deadline time is reached
)
const (
BaseCommitteeType = "kava/BaseCommittee"
MemberCommitteeType = "kava/MemberCommittee" // Committee is composed of member addresses that vote to enact proposals within their permissions
TokenCommitteeType = "kava/TokenCommittee" // Committee is composed of token holders with voting power determined by total token balance
BondDenom = "ukava"
)
// TallyOptionFromString returns a TallyOption from a string. It returns an error
// if the string is invalid.
func TallyOptionFromString(str string) (TallyOption, error) {
switch strings.ToLower(str) {
case "firstpastthepost", "fptp":
return FirstPastThePost, nil
case "deadline", "d":
return Deadline, nil
default:
return TallyOption(0xff), fmt.Errorf("'%s' is not a valid tally option", str)
}
}
// Marshal needed for protobuf compatibility.
func (t TallyOption) Marshal() ([]byte, error) {
return []byte{byte(t)}, nil
}
// Unmarshal needed for protobuf compatibility.
func (t *TallyOption) Unmarshal(data []byte) error {
*t = TallyOption(data[0])
return nil
}
// Marshals to JSON using string.
func (t TallyOption) MarshalJSON() ([]byte, error) {
return json.Marshal(t.String())
}
// UnmarshalJSON decodes from JSON assuming Bech32 encoding.
func (t *TallyOption) UnmarshalJSON(data []byte) error {
var s string
err := json.Unmarshal(data, &s)
if err != nil {
return err
}
bz2, err := TallyOptionFromString(s)
if err != nil {
return err
}
*t = bz2
return nil
}
// String implements the Stringer interface.
func (t TallyOption) String() string {
switch t {
case FirstPastThePost:
return "FirstPastThePost"
case Deadline:
return "Deadline"
default:
return ""
}
}
// Committee is an interface for handling common actions on committees
type Committee interface {
GetID() uint64
GetType() string
GetDescription() string
GetMembers() []sdk.AccAddress
SetMembers([]sdk.AccAddress) BaseCommittee
HasMember(addr sdk.AccAddress) bool
GetPermissions() []Permission
SetPermissions([]Permission) Committee
GetProposalDuration() time.Duration
SetProposalDuration(time.Duration) BaseCommittee
GetVoteThreshold() sdk.Dec
SetVoteThreshold(sdk.Dec) BaseCommittee
GetTallyOption() TallyOption
Validate() error
}
var (
_ Committee = MemberCommittee{}
_ Committee = TokenCommittee{}
)
// Committees is a slice of committees
type Committees []Committee
// BaseCommittee is a common type shared by all Committees
type BaseCommittee struct {
ID uint64 `json:"id" yaml:"id"`
Description string `json:"description" yaml:"description"`
Members []sdk.AccAddress `json:"members" yaml:"members"`
Permissions []Permission `json:"permissions" yaml:"permissions"`
VoteThreshold sdk.Dec `json:"vote_threshold" yaml:"vote_threshold"` // Smallest percentage that must vote for a proposal to pass
ProposalDuration time.Duration `json:"proposal_duration" yaml:"proposal_duration"` // The length of time a proposal remains active for. Proposals will close earlier if they get enough votes.
TallyOption TallyOption `json:"tally_option" yaml:"tally_option"`
}
// GetType is a getter for committee type
func (c BaseCommittee) GetType() string { return BaseCommitteeType }
// GetID is a getter for committee ID
func (c BaseCommittee) GetID() uint64 { return c.ID }
// GetDescription is a getter for committee description
func (c BaseCommittee) GetDescription() string { return c.Description }
// GetMembers is a getter for committee members
func (c BaseCommittee) GetMembers() []sdk.AccAddress { return c.Members }
// SetMembers is a setter for committee members
func (c BaseCommittee) SetMembers(members []sdk.AccAddress) BaseCommittee {
c.Members = members
return c
}
// HasMember returns if a committee contains a given member address
func (c BaseCommittee) HasMember(addr sdk.AccAddress) bool {
for _, m := range c.Members {
if m.Equals(addr) {
return true
}
}
return false
}
// GetPermissions is a getter for committee permissions
func (c BaseCommittee) GetPermissions() []Permission { return c.Permissions }
// SetPermissions is a setter for committee permissions
func (c BaseCommittee) SetPermissions(permissions []Permission) BaseCommittee {
c.Permissions = permissions
return c
}
// GetVoteThreshold is a getter for committee VoteThreshold
func (c BaseCommittee) GetVoteThreshold() sdk.Dec { return c.VoteThreshold }
// SetVoteThreshold is a setter for committee VoteThreshold
func (c BaseCommittee) SetVoteThreshold(voteThreshold sdk.Dec) BaseCommittee {
c.VoteThreshold = voteThreshold
return c
}
// GetProposalDuration is a getter for committee ProposalDuration
func (c BaseCommittee) GetProposalDuration() time.Duration { return c.ProposalDuration }
// SetProposalDuration is a setter for committee ProposalDuration
func (c BaseCommittee) SetProposalDuration(proposalDuration time.Duration) BaseCommittee {
c.ProposalDuration = proposalDuration
return c
}
// GetTallyOption is a getter for committee TallyOption
func (c BaseCommittee) GetTallyOption() TallyOption { return c.TallyOption }
// Validate validates BaseCommittee fields
func (c BaseCommittee) Validate() error {
if len(c.Description) > MaxCommitteeDescriptionLength {
return fmt.Errorf("description length %d longer than max allowed %d", len(c.Description), MaxCommitteeDescriptionLength)
}
if len(c.Members) <= 0 {
return fmt.Errorf("committee must have members")
}
addressMap := make(map[string]bool, len(c.Members))
for _, m := range c.Members {
// check there are no duplicate members
if _, ok := addressMap[m.String()]; ok {
return fmt.Errorf("committee cannot have duplicate members, %s", m)
}
// check for valid addresses
if m.Empty() {
return fmt.Errorf("committee cannot have empty member address")
}
addressMap[m.String()] = true
}
for _, p := range c.Permissions {
if p == nil {
return fmt.Errorf("committee cannot have a nil permission")
}
}
if c.ProposalDuration < 0 {
return fmt.Errorf("invalid proposal duration: %s", c.ProposalDuration)
}
// threshold must be in the range [0, 1]
if c.VoteThreshold.IsNil() || c.VoteThreshold.LTE(sdk.ZeroDec()) || c.VoteThreshold.GT(sdk.NewDec(1)) {
return fmt.Errorf("invalid threshold: %s", c.VoteThreshold)
}
if c.TallyOption <= 0 || c.TallyOption > 2 {
return fmt.Errorf("invalid tally option: %d", c.TallyOption)
}
return nil
}
// MemberCommittee is an alias of BaseCommittee
type MemberCommittee struct {
BaseCommittee `json:"base_committee" yaml:"base_committee"`
}
// NewMemberCommittee instantiates a new instance of MemberCommittee
func NewMemberCommittee(id uint64, description string, members []sdk.AccAddress, permissions []Permission,
threshold sdk.Dec, duration time.Duration, tallyOption TallyOption,
) MemberCommittee {
return MemberCommittee{
BaseCommittee: BaseCommittee{
ID: id,
Description: description,
Members: members,
Permissions: permissions,
VoteThreshold: threshold,
ProposalDuration: duration,
TallyOption: tallyOption,
},
}
}
// GetType is a getter for committee type
func (c MemberCommittee) GetType() string { return MemberCommitteeType }
// SetPermissions is a setter for committee permissions
func (c MemberCommittee) SetPermissions(permissions []Permission) Committee {
c.Permissions = permissions
return c
}
// Validate validates the committee's fields
func (c MemberCommittee) Validate() error {
return c.BaseCommittee.Validate()
}
// TokenCommittee supports voting on proposals by token holders
type TokenCommittee struct {
BaseCommittee `json:"base_committee" yaml:"base_committee"`
Quorum sdk.Dec `json:"quorum" yaml:"quorum"`
TallyDenom string `json:"tally_denom" yaml:"tally_denom"`
}
// NewTokenCommittee instantiates a new instance of TokenCommittee
func NewTokenCommittee(id uint64, description string, members []sdk.AccAddress, permissions []Permission,
threshold sdk.Dec, duration time.Duration, tallyOption TallyOption, quorum sdk.Dec, tallyDenom string,
) TokenCommittee {
return TokenCommittee{
BaseCommittee: BaseCommittee{
ID: id,
Description: description,
Members: members,
Permissions: permissions,
VoteThreshold: threshold,
ProposalDuration: duration,
TallyOption: tallyOption,
},
Quorum: quorum,
TallyDenom: tallyDenom,
}
}
// GetType is a getter for committee type
func (c TokenCommittee) GetType() string { return TokenCommitteeType }
// GetQuorum returns the quorum of the committee
func (c TokenCommittee) GetQuorum() sdk.Dec { return c.Quorum }
// GetTallyDenom returns the tally denom of the committee
func (c TokenCommittee) GetTallyDenom() string { return c.TallyDenom }
// SetPermissions is a setter for committee permissions
func (c TokenCommittee) SetPermissions(permissions []Permission) Committee {
c.Permissions = permissions
return c
}
// Validate validates the committee's fields
func (c TokenCommittee) Validate() error {
if c.TallyDenom == BondDenom {
return fmt.Errorf("invalid tally denom: %s", c.TallyDenom)
}
err := sdk.ValidateDenom(c.TallyDenom)
if err != nil {
return err
}
if c.Quorum.IsNil() || c.Quorum.IsNegative() || c.Quorum.GT(sdk.NewDec(1)) {
return fmt.Errorf("invalid quorum: %s", c.Quorum)
}
return c.BaseCommittee.Validate()
}
// ------------------------------------------
// Proposals
// ------------------------------------------
// PubProposal is the interface that all proposals must fulfill to be submitted to a committee.
// Proposal types can be created external to this module. For example a ParamChangeProposal, or CommunityPoolSpendProposal.
// It is pinned to the equivalent type in the gov module to create compatibility between proposal types.
type PubProposal v036gov.Content
// Proposal is an internal record of a governance proposal submitted to a committee.
type Proposal struct {
PubProposal `json:"pub_proposal" yaml:"pub_proposal"`
ID uint64 `json:"id" yaml:"id"`
CommitteeID uint64 `json:"committee_id" yaml:"committee_id"`
Deadline time.Time `json:"deadline" yaml:"deadline"`
}
func NewProposal(pubProposal PubProposal, id uint64, committeeID uint64, deadline time.Time) Proposal {
return Proposal{
PubProposal: pubProposal,
ID: id,
CommitteeID: committeeID,
Deadline: deadline,
}
}
// HasExpiredBy calculates if the proposal will have expired by a certain time.
// All votes must be cast before deadline, those cast at time == deadline are not valid
func (p Proposal) HasExpiredBy(time time.Time) bool {
return !time.Before(p.Deadline)
}
// ------------------------------------------
// Votes
// ------------------------------------------
type Vote struct {
ProposalID uint64 `json:"proposal_id" yaml:"proposal_id"`
Voter sdk.AccAddress `json:"voter" yaml:"voter"`
VoteType VoteType `json:"vote_type" yaml:"vote_type"`
}
func NewVote(proposalID uint64, voter sdk.AccAddress, voteType VoteType) Vote {
return Vote{
ProposalID: proposalID,
Voter: voter,
VoteType: voteType,
}
}
func (v Vote) Validate() error {
if v.Voter.Empty() {
return fmt.Errorf("voter address cannot be empty")
}
return v.VoteType.Validate()
}
type VoteType uint64
const (
NullVoteType VoteType = iota // 0
Yes VoteType = iota // 1
No VoteType = iota // 2
Abstain VoteType = iota // 3
)
// VoteTypeFromString returns a VoteType from a string. It returns an error
// if the string is invalid.
func VoteTypeFromString(str string) (VoteType, error) {
switch strings.ToLower(str) {
case "yes", "y":
return Yes, nil
case "abstain", "a":
return Abstain, nil
case "no", "n":
return No, nil
default:
return VoteType(0xff), fmt.Errorf("'%s' is not a valid vote type", str)
}
}
// Marshal needed for protobuf compatibility.
func (vt VoteType) Marshal() ([]byte, error) {
return []byte{byte(vt)}, nil
}
// Unmarshal needed for protobuf compatibility.
func (vt *VoteType) Unmarshal(data []byte) error {
*vt = VoteType(data[0])
return nil
}
// Marshals to JSON using string.
func (vt VoteType) MarshalJSON() ([]byte, error) {
return json.Marshal(vt.String())
}
// UnmarshalJSON decodes from JSON assuming Bech32 encoding.
func (vt *VoteType) UnmarshalJSON(data []byte) error {
var s string
err := json.Unmarshal(data, &s)
if err != nil {
return err
}
bz2, err := VoteTypeFromString(s)
if err != nil {
return err
}
*vt = bz2
return nil
}
// String implements the Stringer interface.
func (vt VoteType) String() string {
switch vt {
case Yes:
return "Yes"
case Abstain:
return "Abstain"
case No:
return "No"
default:
return ""
}
}
func (vt VoteType) Validate() error {
if vt <= 0 || vt > 3 {
return fmt.Errorf("invalid vote type: %d", vt)
}
return nil
}
// CommitteeChangeProposal is a gov proposal for creating a new committee or modifying an existing one.
type CommitteeChangeProposal struct {
Title string `json:"title" yaml:"title"`
Description string `json:"description" yaml:"description"`
NewCommittee Committee `json:"new_committee" yaml:"new_committee"`
}
// CommitteeDeleteProposal is a gov proposal for removing a committee.
type CommitteeDeleteProposal struct {
Title string `json:"title" yaml:"title"`
Description string `json:"description" yaml:"description"`
CommitteeID uint64 `json:"committee_id" yaml:"committee_id"`
}

View File

@ -1,6 +0,0 @@
package v0_15
const (
// ModuleName The name that will be used throughout the module
ModuleName = "committee"
)

View File

@ -1,192 +0,0 @@
package v0_15
// Permission is anything with a method that validates whether a proposal is allowed by it or not.
type Permission interface{}
// ------------------------------------------
// GodPermission
// ------------------------------------------
// GodPermission allows any governance proposal. It is used mainly for testing.
type GodPermission struct{}
var _ Permission = GodPermission{}
// ------------------------------------------
// SimpleParamChangePermission
// ------------------------------------------
// SimpleParamChangePermission only allows changes to certain params
type SimpleParamChangePermission struct {
AllowedParams AllowedParams `json:"allowed_params" yaml:"allowed_params"`
}
var _ Permission = SimpleParamChangePermission{}
// AllowedParam permission type for module parameter keys
type AllowedParam struct {
Subspace string `json:"subspace" yaml:"subspace"`
Key string `json:"key" yaml:"key"`
}
// AllowedParams slice of AllowedParam
type AllowedParams []AllowedParam
// ------------------------------------------
// TextPermission
// ------------------------------------------
// TextPermission allows any text governance proposal.
type TextPermission struct{}
var _ Permission = TextPermission{}
// ------------------------------------------
// SoftwareUpgradePermission
// ------------------------------------------
// SoftwareUpgradePermission permission type for software upgrade proposals
type SoftwareUpgradePermission struct{}
var _ Permission = SoftwareUpgradePermission{}
// ------------------------------------------
// SubParamChangePermission
// ------------------------------------------
// SubParamChangePermission permission type for allowing changes to specific sub-keys within module parameter keys
type SubParamChangePermission struct {
AllowedParams AllowedParams `json:"allowed_params" yaml:"allowed_params"`
AllowedCollateralParams AllowedCollateralParams `json:"allowed_collateral_params" yaml:"allowed_collateral_params"`
AllowedDebtParam AllowedDebtParam `json:"allowed_debt_param" yaml:"allowed_debt_param"`
AllowedAssetParams AllowedAssetParams `json:"allowed_asset_params" yaml:"allowed_asset_params"`
AllowedMarkets AllowedMarkets `json:"allowed_markets" yaml:"allowed_markets"`
AllowedMoneyMarkets AllowedMoneyMarkets `json:"allowed_money_markets" yaml:"allowed_money_markets"`
}
var _ Permission = SubParamChangePermission{}
// MarshalYAML implement yaml marshalling
func (perm SubParamChangePermission) MarshalYAML() (interface{}, error) {
valueToMarshal := struct {
Type string `yaml:"type" json:"type"`
AllowedParams AllowedParams `yaml:"allowed_params" json:"allowed_params"`
AllowedCollateralParams AllowedCollateralParams `yaml:"allowed_collateral_params" json:"allowed_collateral_params"`
AllowedDebtParam AllowedDebtParam `yaml:"allowed_debt_param" json:"allowed_debt_param"`
AllowedAssetParams AllowedAssetParams `yaml:"allowed_asset_params" json:"allowed_asset_params"`
AllowedMarkets AllowedMarkets `yaml:"allowed_markets" json:"allowed_markets"`
AllowedMoneyMarkets AllowedMoneyMarkets `json:"allowed_money_markets" yaml:"allowed_money_markets"`
}{
Type: "param_change_permission",
AllowedParams: perm.AllowedParams,
AllowedCollateralParams: perm.AllowedCollateralParams,
AllowedDebtParam: perm.AllowedDebtParam,
AllowedAssetParams: perm.AllowedAssetParams,
AllowedMarkets: perm.AllowedMarkets,
AllowedMoneyMarkets: perm.AllowedMoneyMarkets,
}
return valueToMarshal, nil
}
// AllowedCollateralParams slice of AllowedCollateralParam
type AllowedCollateralParams []AllowedCollateralParam
// AllowedCollateralParam permission struct for changes to collateral parameter keys (cdp module)
type AllowedCollateralParam struct {
Type string `json:"type" yaml:"type"`
Denom bool `json:"denom" yaml:"denom"`
LiquidationRatio bool `json:"liquidation_ratio" yaml:"liquidation_ratio"`
DebtLimit bool `json:"debt_limit" yaml:"debt_limit"`
StabilityFee bool `json:"stability_fee" yaml:"stability_fee"`
AuctionSize bool `json:"auction_size" yaml:"auction_size"`
LiquidationPenalty bool `json:"liquidation_penalty" yaml:"liquidation_penalty"`
Prefix bool `json:"prefix" yaml:"prefix"`
SpotMarketID bool `json:"spot_market_id" yaml:"spot_market_id"`
LiquidationMarketID bool `json:"liquidation_market_id" yaml:"liquidation_market_id"`
ConversionFactor bool `json:"conversion_factor" yaml:"conversion_factor"`
KeeperRewardPercentage bool `json:"keeper_reward_percentage" yaml:"keeper_reward_percentage"`
CheckCollateralizationIndexCount bool `json:"check_collateralization_index_count" yaml:"check_collateralization_index_count"`
}
// NewAllowedCollateralParam return a new AllowedCollateralParam
func NewAllowedCollateralParam(
ctype string, denom, liqRatio, debtLimit,
stabilityFee, auctionSize, liquidationPenalty,
prefix, spotMarket, liquidationMarket, conversionFactor, keeperReward, ltvIndexCount bool,
) AllowedCollateralParam {
return AllowedCollateralParam{
Type: ctype,
Denom: denom,
LiquidationRatio: liqRatio,
DebtLimit: debtLimit,
StabilityFee: stabilityFee,
AuctionSize: auctionSize,
LiquidationPenalty: liquidationPenalty,
Prefix: prefix,
SpotMarketID: spotMarket,
LiquidationMarketID: liquidationMarket,
ConversionFactor: conversionFactor,
KeeperRewardPercentage: keeperReward,
CheckCollateralizationIndexCount: ltvIndexCount,
}
}
// AllowedDebtParam permission struct for changes to debt parameter keys (cdp module)
type AllowedDebtParam struct {
Denom bool `json:"denom" yaml:"denom"`
ReferenceAsset bool `json:"reference_asset" yaml:"reference_asset"`
ConversionFactor bool `json:"conversion_factor" yaml:"conversion_factor"`
DebtFloor bool `json:"debt_floor" yaml:"debt_floor"`
}
// AllowedAssetParams slice of AllowedAssetParam
type AllowedAssetParams []AllowedAssetParam
// AllowedAssetParam bep3 asset parameters that can be changed by committee
type AllowedAssetParam struct {
Denom string `json:"denom" yaml:"denom"`
CoinID bool `json:"coin_id" yaml:"coin_id"`
Limit bool `json:"limit" yaml:"limit"`
Active bool `json:"active" yaml:"active"`
MaxSwapAmount bool `json:"max_swap_amount" yaml:"max_swap_amount"`
MinBlockLock bool `json:"min_block_lock" yaml:"min_block_lock"`
}
// AllowedMarkets slice of AllowedMarket
type AllowedMarkets []AllowedMarket
// AllowedMarket permission struct for market parameters (pricefeed module)
type AllowedMarket struct {
MarketID string `json:"market_id" yaml:"market_id"`
BaseAsset bool `json:"base_asset" yaml:"base_asset"`
QuoteAsset bool `json:"quote_asset" yaml:"quote_asset"`
Oracles bool `json:"oracles" yaml:"oracles"`
Active bool `json:"active" yaml:"active"`
}
// AllowedMoneyMarket permission struct for money market parameters (hard module)
type AllowedMoneyMarket struct {
Denom string `json:"denom" yaml:"denom"`
BorrowLimit bool `json:"borrow_limit" yaml:"borrow_limit"`
SpotMarketID bool `json:"spot_market_id" yaml:"spot_market_id"`
ConversionFactor bool `json:"conversion_factor" yaml:"conversion_factor"`
InterestRateModel bool `json:"interest_rate_model" yaml:"interest_rate_model"`
ReserveFactor bool `json:"reserve_factor" yaml:"reserve_factor"`
KeeperRewardPercentage bool `json:"keeper_reward_percentage" yaml:"keeper_reward_percentage"`
}
// NewAllowedMoneyMarket returns a new AllowedMoneyMarket
func NewAllowedMoneyMarket(denom string, bl, sm, cf, irm, rf, kr bool) AllowedMoneyMarket {
return AllowedMoneyMarket{
Denom: denom,
BorrowLimit: bl,
SpotMarketID: sm,
ConversionFactor: cf,
InterestRateModel: irm,
ReserveFactor: rf,
KeeperRewardPercentage: kr,
}
}
// AllowedMoneyMarkets slice of AllowedMoneyMarket
type AllowedMoneyMarkets []AllowedMoneyMarket

View File

@ -1,51 +0,0 @@
package v0_15
import (
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
)
// GenesisState is state that must be provided at chain genesis.
type GenesisState struct {
NextProposalID uint64 `json:"next_proposal_id" yaml:"next_proposal_id"`
Committees Committees `json:"committees" yaml:"committees"`
Proposals []Proposal `json:"proposals" yaml:"proposals"`
Votes []Vote `json:"votes" yaml:"votes"`
}
// MsgSubmitProposal is used by committee members to create a new proposal that they can vote on.
type MsgSubmitProposal struct {
PubProposal PubProposal `json:"pub_proposal" yaml:"pub_proposal"`
Proposer sdk.AccAddress `json:"proposer" yaml:"proposer"`
CommitteeID uint64 `json:"committee_id" yaml:"committee_id"`
}
// MsgVote is submitted by committee members to vote on proposals.
type MsgVote struct {
ProposalID uint64 `json:"proposal_id" yaml:"proposal_id"`
Voter sdk.AccAddress `json:"voter" yaml:"voter"`
VoteType VoteType `json:"vote_type" yaml:"vote_type"`
}
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
// Proposals
cdc.RegisterInterface((*PubProposal)(nil), nil)
// Committees
cdc.RegisterInterface((*Committee)(nil), nil)
cdc.RegisterConcrete(BaseCommittee{}, "kava/BaseCommittee", nil)
cdc.RegisterConcrete(MemberCommittee{}, "kava/MemberCommittee", nil)
cdc.RegisterConcrete(TokenCommittee{}, "kava/TokenCommittee", nil)
// Permissions
cdc.RegisterInterface((*Permission)(nil), nil)
cdc.RegisterConcrete(GodPermission{}, "kava/GodPermission", nil)
cdc.RegisterConcrete(SimpleParamChangePermission{}, "kava/SimpleParamChangePermission", nil)
cdc.RegisterConcrete(TextPermission{}, "kava/TextPermission", nil)
cdc.RegisterConcrete(SoftwareUpgradePermission{}, "kava/SoftwareUpgradePermission", nil)
cdc.RegisterConcrete(SubParamChangePermission{}, "kava/SubParamChangePermission", nil)
// Msgs
cdc.RegisterConcrete(MsgSubmitProposal{}, "kava/MsgSubmitProposal", nil)
cdc.RegisterConcrete(MsgVote{}, "kava/MsgVote", nil)
}

View File

@ -1,564 +0,0 @@
package v0_16
import (
"fmt"
"reflect"
"sort"
proto "github.com/gogo/protobuf/proto"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
v036distr "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v036"
v040distr "github.com/cosmos/cosmos-sdk/x/distribution/types"
v036gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v036"
v040gov "github.com/cosmos/cosmos-sdk/x/gov/types"
v036params "github.com/cosmos/cosmos-sdk/x/params/legacy/v036"
v040params "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
v038upgrade "github.com/cosmos/cosmos-sdk/x/upgrade/legacy/v038"
v040upgrade "github.com/cosmos/cosmos-sdk/x/upgrade/types"
v016bep3types "github.com/kava-labs/kava/x/bep3/types"
v016cdptypes "github.com/kava-labs/kava/x/cdp/types"
v015committee "github.com/kava-labs/kava/x/committee/legacy/v0_15"
v016committee "github.com/kava-labs/kava/x/committee/types"
v016hardMigration "github.com/kava-labs/kava/x/hard/legacy/v0_16"
v016hardtypes "github.com/kava-labs/kava/x/hard/types"
v015kavadist "github.com/kava-labs/kava/x/kavadist/legacy/v0_15"
v016kavadist "github.com/kava-labs/kava/x/kavadist/types"
v015pricefeed "github.com/kava-labs/kava/x/pricefeed/legacy/v0_15"
v016pricefeedmigration "github.com/kava-labs/kava/x/pricefeed/legacy/v0_16"
v016pricefeedtypes "github.com/kava-labs/kava/x/pricefeed/types"
)
const (
KavaStabilityCommitteeID = 1
HardGovernanceCommitteeID = 3
)
// migrateWhitelist returns an string slice of json keys that should be whitelisted on the whitelist interface
func migrateWhitelist(whitelist interface{}, ignoredTag string) []string {
allowed := []string{}
v := reflect.ValueOf(whitelist)
typeOfS := v.Type()
for i := 0; i < v.NumField(); i++ {
tag := typeOfS.Field(i).Tag.Get("json")
if tag != ignoredTag && tag != "" {
val, ok := v.Field(i).Interface().(bool)
if ok && val {
allowed = append(allowed, tag)
}
}
}
sort.Strings(allowed)
return allowed
}
// isSubparamAllowed returns true if the subspace and key is allowed in the v15 permissions
func isSubparamAllowed(permission v015committee.SubParamChangePermission, subspace string, key string) bool {
for _, allowed := range permission.AllowedParams {
if allowed.Key == key && allowed.Subspace == subspace {
return true
}
}
return false
}
type subspaceKeyPair struct {
key []byte
subspace string
}
// migrateSubParamPermissions converts v15 SubParamChangePermissions to v16 ParamsChangePermission
func migrateSubParamPermissions(
permission v015committee.SubParamChangePermission,
committeeID uint64,
oldPricefeedState v015pricefeed.GenesisState,
) *v016committee.ParamsChangePermission {
changes := v016committee.AllowedParamsChanges{}
// migrate allowed params
pairsToAvoid := []subspaceKeyPair{
{key: v016cdptypes.KeyCollateralParams, subspace: v016cdptypes.ModuleName},
{key: v016cdptypes.KeyDebtParam, subspace: v016cdptypes.ModuleName},
{key: v016bep3types.KeyAssetParams, subspace: v016bep3types.ModuleName},
{key: v016pricefeedtypes.KeyMarkets, subspace: v016pricefeedtypes.ModuleName},
{key: v016hardtypes.KeyMoneyMarkets, subspace: v016hardtypes.ModuleName},
}
for _, allowed := range permission.AllowedParams {
shouldAvoid := false
for _, pair := range pairsToAvoid {
if string(pair.key) == allowed.Key && pair.subspace == allowed.Subspace {
shouldAvoid = true
break
}
}
if !shouldAvoid {
changes = append(changes, v016committee.AllowedParamsChange{
Subspace: allowed.Subspace,
Key: allowed.Key,
})
}
}
// migrate collateral params
if isSubparamAllowed(permission, v016cdptypes.ModuleName, string(v016cdptypes.KeyCollateralParams)) {
change := v016committee.AllowedParamsChange{
Key: string(v016cdptypes.KeyCollateralParams),
Subspace: string(v016cdptypes.ModuleName),
}
requirements := []v016committee.SubparamRequirement{}
for _, param := range permission.AllowedCollateralParams {
requirement := v016committee.SubparamRequirement{
Key: "type",
Val: param.Type,
AllowedSubparamAttrChanges: []string{},
}
allowed := migrateWhitelist(param, "type")
requirement.AllowedSubparamAttrChanges = allowed
requirements = append(requirements, requirement)
}
// add new requirement for stability committee
if committeeID == KavaStabilityCommitteeID {
requirement := v016committee.SubparamRequirement{
Key: "type",
Val: "swp-a",
AllowedSubparamAttrChanges: []string{
"auction_size", "check_collateralization_index_count", "debt_limit",
"keeper_reward_percentage", "stability_fee",
},
}
requirements = append(requirements, requirement)
}
change.MultiSubparamsRequirements = requirements
changes = append(changes, change)
}
// migrate debt params
if isSubparamAllowed(permission, string(v016cdptypes.ModuleName), string(v016cdptypes.KeyDebtParam)) {
change := v016committee.AllowedParamsChange{
Subspace: v016cdptypes.ModuleName,
Key: string(v016cdptypes.KeyDebtParam),
SingleSubparamAllowedAttrs: migrateWhitelist(permission.AllowedDebtParam, ""),
}
changes = append(changes, change)
}
// migrate asset params
if isSubparamAllowed(permission, string(v016bep3types.ModuleName), string(v016bep3types.KeyAssetParams)) {
change := v016committee.AllowedParamsChange{
Key: string(v016bep3types.KeyAssetParams),
Subspace: string(v016bep3types.ModuleName),
}
requirements := []v016committee.SubparamRequirement{}
for _, param := range permission.AllowedAssetParams {
requirement := v016committee.SubparamRequirement{
Key: "denom",
Val: param.Denom,
AllowedSubparamAttrChanges: []string{},
}
allowed := migrateWhitelist(param, "denom")
requirement.AllowedSubparamAttrChanges = allowed
requirements = append(requirements, requirement)
}
change.MultiSubparamsRequirements = requirements
changes = append(changes, change)
}
// migrate markets
if isSubparamAllowed(permission, string(v016pricefeedtypes.ModuleName), string(v016pricefeedtypes.KeyMarkets)) {
change := v016committee.AllowedParamsChange{
Key: string(v016pricefeedtypes.KeyMarkets),
Subspace: string(v016pricefeedtypes.ModuleName),
}
requirements := []v016committee.SubparamRequirement{}
for _, param := range permission.AllowedMarkets {
requirement := v016committee.SubparamRequirement{
Key: "market_id",
Val: param.MarketID,
AllowedSubparamAttrChanges: []string{},
}
allowed := migrateWhitelist(param, "market_id")
requirement.AllowedSubparamAttrChanges = allowed
requirements = append(requirements, requirement)
}
if committeeID == KavaStabilityCommitteeID {
// Add permissions for existing pricefeed markets that are missing in allowed_markets
outer:
for _, oldPricefeedMarket := range oldPricefeedState.Params.Markets {
// Skip if this oldPricefeedMarket already exists in requirements
for _, marketRequirement := range requirements {
if marketRequirement.Val == oldPricefeedMarket.MarketID {
continue outer
}
}
requirement := v016committee.SubparamRequirement{
Key: "market_id",
Val: oldPricefeedMarket.MarketID,
AllowedSubparamAttrChanges: []string{"active"},
}
requirements = append(requirements, requirement)
}
// Add new IBC denoms for stability committee
for _, market := range v016pricefeedmigration.NewIBCMarkets {
requirement := v016committee.SubparamRequirement{
Key: "market_id",
Val: market.MarketID,
AllowedSubparamAttrChanges: []string{"active"},
}
requirements = append(requirements, requirement)
}
}
change.MultiSubparamsRequirements = requirements
changes = append(changes, change)
}
// migrate money markets
if isSubparamAllowed(permission, string(v016hardtypes.ModuleName), string(v016hardtypes.KeyMoneyMarkets)) {
change := v016committee.AllowedParamsChange{
Key: string(v016hardtypes.KeyMoneyMarkets),
Subspace: string(v016hardtypes.ModuleName),
}
requirements := []v016committee.SubparamRequirement{}
for _, param := range permission.AllowedMoneyMarkets {
requirement := v016committee.SubparamRequirement{
Key: "denom",
Val: param.Denom,
AllowedSubparamAttrChanges: []string{},
}
allowed := migrateWhitelist(param, "denom")
requirement.AllowedSubparamAttrChanges = allowed
requirements = append(requirements, requirement)
}
// add new requirement for stability committee
if committeeID == KavaStabilityCommitteeID {
requirement := v016committee.SubparamRequirement{
Key: "denom",
Val: "swp",
AllowedSubparamAttrChanges: []string{
"borrow_limit", "interest_rate_model",
"keeper_reward_percentage", "reserve_factor",
},
}
requirements = append(requirements, requirement)
requirementAtom := v016committee.SubparamRequirement{
Key: "denom",
Val: v016hardMigration.UATOM_IBC_DENOM,
AllowedSubparamAttrChanges: []string{
"borrow_limit", "interest_rate_model",
"keeper_reward_percentage", "reserve_factor",
},
}
requirements = append(requirements, requirementAtom)
} else if committeeID == HardGovernanceCommitteeID {
// add new requirement for Hard Governance committee
requirementSwp := v016committee.SubparamRequirement{
Key: "denom",
Val: "swp",
AllowedSubparamAttrChanges: []string{
"borrow_limit", "interest_rate_model", "keeper_reward_percentage",
"reserve_factor", "spot_market_id",
},
}
requirements = append(requirements, requirementSwp)
requirementUatom := v016committee.SubparamRequirement{
Key: "denom",
Val: v016hardMigration.UATOM_IBC_DENOM,
AllowedSubparamAttrChanges: []string{
"borrow_limit", "interest_rate_model", "keeper_reward_percentage",
"reserve_factor", "spot_market_id",
},
}
requirements = append(requirements, requirementUatom)
}
change.MultiSubparamsRequirements = requirements
changes = append(changes, change)
}
return &v016committee.ParamsChangePermission{
AllowedParamsChanges: changes,
}
}
func migratePermission(
v015permission v015committee.Permission,
committeeID uint64,
oldPricefeedState v015pricefeed.GenesisState,
) *codectypes.Any {
var protoProposal proto.Message
switch v015permission := v015permission.(type) {
case v015committee.GodPermission:
{
protoProposal = &v016committee.GodPermission{}
}
case v015committee.TextPermission:
{
protoProposal = &v016committee.TextPermission{}
}
case v015committee.SoftwareUpgradePermission:
{
protoProposal = &v016committee.SoftwareUpgradePermission{}
}
case v015committee.SimpleParamChangePermission:
{
changes := make(v016committee.AllowedParamsChanges, len(v015permission.AllowedParams))
for i, param := range v015permission.AllowedParams {
changes[i] = v016committee.AllowedParamsChange{
Subspace: param.Subspace,
Key: param.Key,
}
}
protoProposal = &v016committee.ParamsChangePermission{
AllowedParamsChanges: changes,
}
}
case v015committee.SubParamChangePermission:
{
protoProposal = migrateSubParamPermissions(v015permission, committeeID, oldPricefeedState)
}
default:
panic(fmt.Errorf("'%s' is not a valid permission", v015permission))
}
// Convert the content into Any.
contentAny, err := codectypes.NewAnyWithValue(protoProposal)
if err != nil {
panic(err)
}
return contentAny
}
func migrateTallyOption(oldTallyOption v015committee.TallyOption) v016committee.TallyOption {
switch oldTallyOption {
case v015committee.NullTallyOption:
return v016committee.TALLY_OPTION_UNSPECIFIED
case v015committee.FirstPastThePost:
return v016committee.TALLY_OPTION_FIRST_PAST_THE_POST
case v015committee.Deadline:
return v016committee.TALLY_OPTION_DEADLINE
default:
panic(fmt.Errorf("'%s' is not a valid tally option", oldTallyOption))
}
}
func migrateCommittee(committee v015committee.Committee, oldPricefeedState v015pricefeed.GenesisState) *codectypes.Any {
var protoProposal proto.Message
switch committee := committee.(type) {
case v015committee.MemberCommittee:
{
permissions := make([]*codectypes.Any, len(committee.Permissions))
for i, permission := range committee.Permissions {
permissions[i] = migratePermission(permission, committee.GetID(), oldPricefeedState)
}
protoProposal = &v016committee.MemberCommittee{
BaseCommittee: &v016committee.BaseCommittee{
ID: committee.ID,
Description: committee.Description,
Members: committee.Members,
Permissions: permissions,
VoteThreshold: committee.VoteThreshold,
ProposalDuration: committee.ProposalDuration,
TallyOption: migrateTallyOption(committee.TallyOption),
},
}
}
case v015committee.TokenCommittee:
{
permissions := make([]*codectypes.Any, len(committee.Permissions))
for i, permission := range committee.Permissions {
permissions[i] = migratePermission(permission, committee.GetID(), oldPricefeedState)
}
protoProposal = &v016committee.TokenCommittee{
BaseCommittee: &v016committee.BaseCommittee{
ID: committee.ID,
Description: committee.Description,
Members: committee.Members,
Permissions: permissions,
VoteThreshold: committee.VoteThreshold,
ProposalDuration: committee.ProposalDuration,
TallyOption: migrateTallyOption(committee.TallyOption),
},
Quorum: committee.Quorum,
TallyDenom: committee.TallyDenom,
}
}
default:
panic(fmt.Errorf("'%s' is not a valid committee", committee))
}
// Convert the content into Any.
contentAny, err := codectypes.NewAnyWithValue(protoProposal)
if err != nil {
panic(err)
}
return contentAny
}
func migrateCommittees(v015committees v015committee.Committees, oldPricefeedState v015pricefeed.GenesisState) []*codectypes.Any {
committees := make([]*codectypes.Any, len(v015committees))
for i, committee := range v015committees {
committees[i] = migrateCommittee(committee, oldPricefeedState)
}
return committees
}
func migrateContent(oldContent v036gov.Content) *codectypes.Any {
var protoProposal proto.Message
switch oldContent := oldContent.(type) {
case v036gov.TextProposal:
{
protoProposal = &v040gov.TextProposal{
Title: oldContent.Title,
Description: oldContent.Description,
}
// Convert the content into Any.
contentAny, err := codectypes.NewAnyWithValue(protoProposal)
if err != nil {
panic(err)
}
return contentAny
}
case v036distr.CommunityPoolSpendProposal:
{
protoProposal = &v040distr.CommunityPoolSpendProposal{
Title: oldContent.Title,
Description: oldContent.Description,
Recipient: oldContent.Recipient.String(),
Amount: oldContent.Amount,
}
}
case v038upgrade.CancelSoftwareUpgradeProposal:
{
protoProposal = &v040upgrade.CancelSoftwareUpgradeProposal{
Description: oldContent.Description,
Title: oldContent.Title,
}
}
case v038upgrade.SoftwareUpgradeProposal:
{
protoProposal = &v040upgrade.SoftwareUpgradeProposal{
Description: oldContent.Description,
Title: oldContent.Title,
Plan: v040upgrade.Plan{
Name: oldContent.Plan.Name,
Height: oldContent.Plan.Height,
Info: oldContent.Plan.Info,
},
}
}
case v036params.ParameterChangeProposal:
{
newChanges := make([]v040params.ParamChange, len(oldContent.Changes))
for i, oldChange := range oldContent.Changes {
newChanges[i] = v040params.ParamChange{
Subspace: oldChange.Subspace,
Key: oldChange.Key,
Value: oldChange.Value,
}
}
protoProposal = &v040params.ParameterChangeProposal{
Description: oldContent.Description,
Title: oldContent.Title,
Changes: newChanges,
}
}
case v015kavadist.CommunityPoolMultiSpendProposal:
{
newRecipients := make([]v016kavadist.MultiSpendRecipient, len(oldContent.RecipientList))
for i, recipient := range oldContent.RecipientList {
newRecipients[i] = v016kavadist.MultiSpendRecipient{
Address: recipient.Address.String(),
Amount: recipient.Amount,
}
}
protoProposal = &v016kavadist.CommunityPoolMultiSpendProposal{
Description: oldContent.Description,
Title: oldContent.Title,
RecipientList: newRecipients,
}
}
default:
panic(fmt.Errorf("%T is not a valid proposal content type", oldContent))
}
// Convert the content into Any.
contentAny, err := codectypes.NewAnyWithValue(protoProposal)
if err != nil {
panic(err)
}
return contentAny
}
func migrateProposals(v015proposals []v015committee.Proposal) v016committee.Proposals {
proposals := make(v016committee.Proposals, len(v015proposals))
for i, v15proposal := range v015proposals {
proposals[i] = v016committee.Proposal{
ID: v15proposal.ID,
Content: migrateContent(v15proposal.PubProposal),
CommitteeID: v15proposal.CommitteeID,
Deadline: v15proposal.Deadline,
}
}
return proposals
}
func migrateVoteType(oldVoteType v015committee.VoteType) v016committee.VoteType {
switch oldVoteType {
case v015committee.Yes:
return v016committee.VOTE_TYPE_YES
case v015committee.No:
return v016committee.VOTE_TYPE_NO
case v015committee.Abstain:
return v016committee.VOTE_TYPE_ABSTAIN
case v015committee.NullVoteType:
return v016committee.VOTE_TYPE_UNSPECIFIED
default:
panic(fmt.Errorf("'%s' is not a valid vote type", oldVoteType))
}
}
func migrateVotes(v15votes []v015committee.Vote) []v016committee.Vote {
votes := make([]v016committee.Vote, len(v15votes))
for i, v15vote := range v15votes {
votes[i] = v016committee.Vote{
ProposalID: v15vote.ProposalID,
Voter: v15vote.Voter,
VoteType: migrateVoteType(v15vote.VoteType),
}
}
return votes
}
func Migrate(
oldState v015committee.GenesisState,
oldPricefeedState v015pricefeed.GenesisState,
) *v016committee.GenesisState {
newState := v016committee.GenesisState{
NextProposalID: oldState.NextProposalID,
Committees: migrateCommittees(oldState.Committees, oldPricefeedState),
Proposals: migrateProposals(oldState.Proposals),
Votes: migrateVotes(oldState.Votes),
}
return &newState
}

View File

@ -1,366 +0,0 @@
package v0_16
import (
"time"
sdk "github.com/cosmos/cosmos-sdk/types"
v016bep3types "github.com/kava-labs/kava/x/bep3/types"
v016cdptypes "github.com/kava-labs/kava/x/cdp/types"
v015committee "github.com/kava-labs/kava/x/committee/legacy/v0_15"
v016committee "github.com/kava-labs/kava/x/committee/types"
v016hardtypes "github.com/kava-labs/kava/x/hard/types"
v016pricefeedtypes "github.com/kava-labs/kava/x/pricefeed/types"
)
func (s *migrateTestSuite) TestMigrate_Committee_SubparamPermissions() {
testcases := []struct {
name string
v015permission v015committee.Permission
v016permission v016committee.Permission
}{
{
name: "allowed collateral params",
v015permission: v015committee.SubParamChangePermission{
AllowedParams: v015committee.AllowedParams{{
Subspace: v016cdptypes.ModuleName,
Key: string(v016cdptypes.KeyCollateralParams),
}},
AllowedCollateralParams: v015committee.AllowedCollateralParams{
{
Type: "bnb",
Denom: true,
LiquidationRatio: false,
DebtLimit: true,
KeeperRewardPercentage: true,
},
{
Type: "btc",
Prefix: true,
SpotMarketID: false,
DebtLimit: true,
CheckCollateralizationIndexCount: true,
},
},
},
v016permission: &v016committee.ParamsChangePermission{
AllowedParamsChanges: v016committee.AllowedParamsChanges{
{
Subspace: v016cdptypes.ModuleName,
Key: string(v016cdptypes.KeyCollateralParams),
MultiSubparamsRequirements: []v016committee.SubparamRequirement{
{
Key: "type",
Val: "bnb",
AllowedSubparamAttrChanges: []string{"debt_limit", "denom", "keeper_reward_percentage"},
},
{
Key: "type",
Val: "btc",
AllowedSubparamAttrChanges: []string{"check_collateralization_index_count", "debt_limit", "prefix"},
},
},
},
},
},
},
{
name: "allowed collateral params - no requirements",
v015permission: v015committee.SubParamChangePermission{
AllowedParams: v015committee.AllowedParams{{
Subspace: v016cdptypes.ModuleName,
Key: string(v016cdptypes.KeyCollateralParams),
}},
},
v016permission: &v016committee.ParamsChangePermission{
AllowedParamsChanges: v016committee.AllowedParamsChanges{
{
Subspace: v016cdptypes.ModuleName,
Key: string(v016cdptypes.KeyCollateralParams),
MultiSubparamsRequirements: []v016committee.SubparamRequirement{},
},
},
},
},
{
name: "allowed debt params",
v015permission: v015committee.SubParamChangePermission{
AllowedParams: v015committee.AllowedParams{{
Subspace: v016cdptypes.ModuleName,
Key: string(v016cdptypes.KeyDebtParam),
}},
AllowedDebtParam: v015committee.AllowedDebtParam{
Denom: true,
ReferenceAsset: false,
ConversionFactor: true,
DebtFloor: true,
},
},
v016permission: &v016committee.ParamsChangePermission{
AllowedParamsChanges: v016committee.AllowedParamsChanges{
{
Subspace: v016cdptypes.ModuleName,
Key: string(v016cdptypes.KeyDebtParam),
SingleSubparamAllowedAttrs: []string{"conversion_factor", "debt_floor", "denom"},
},
},
},
},
{
name: "allowed debt params - no requirements",
v015permission: v015committee.SubParamChangePermission{
AllowedParams: v015committee.AllowedParams{{
Subspace: v016cdptypes.ModuleName,
Key: string(v016cdptypes.KeyDebtParam),
}},
},
v016permission: &v016committee.ParamsChangePermission{
AllowedParamsChanges: v016committee.AllowedParamsChanges{
{
Subspace: v016cdptypes.ModuleName,
Key: string(v016cdptypes.KeyDebtParam),
SingleSubparamAllowedAttrs: []string{},
},
},
},
},
{
name: "param not allowed",
v015permission: v015committee.SubParamChangePermission{
AllowedDebtParam: v015committee.AllowedDebtParam{
Denom: true,
ReferenceAsset: false,
ConversionFactor: true,
DebtFloor: true,
},
},
v016permission: &v016committee.ParamsChangePermission{
AllowedParamsChanges: v016committee.AllowedParamsChanges{},
},
},
{
name: "allowed asset params",
v015permission: v015committee.SubParamChangePermission{
AllowedParams: v015committee.AllowedParams{{
Subspace: v016bep3types.ModuleName,
Key: string(v016bep3types.KeyAssetParams),
}},
AllowedAssetParams: v015committee.AllowedAssetParams{
{
Denom: "bnb",
CoinID: true,
MaxSwapAmount: true,
Active: true,
},
{
Denom: "btc",
Limit: true,
MinBlockLock: true,
Active: true,
},
},
},
v016permission: &v016committee.ParamsChangePermission{
AllowedParamsChanges: v016committee.AllowedParamsChanges{
{
Subspace: v016bep3types.ModuleName,
Key: string(v016bep3types.KeyAssetParams),
MultiSubparamsRequirements: []v016committee.SubparamRequirement{
{
Key: "denom",
Val: "bnb",
AllowedSubparamAttrChanges: []string{"active", "coin_id", "max_swap_amount"},
},
{
Key: "denom",
Val: "btc",
AllowedSubparamAttrChanges: []string{"active", "limit", "min_block_lock"},
},
},
},
},
},
},
{
name: "allowed asset params - no requirements",
v015permission: v015committee.SubParamChangePermission{
AllowedParams: v015committee.AllowedParams{{
Subspace: v016bep3types.ModuleName,
Key: string(v016bep3types.KeyAssetParams),
}},
},
v016permission: &v016committee.ParamsChangePermission{
AllowedParamsChanges: v016committee.AllowedParamsChanges{
{
Subspace: v016bep3types.ModuleName,
Key: string(v016bep3types.KeyAssetParams),
MultiSubparamsRequirements: []v016committee.SubparamRequirement{},
},
},
},
},
{
name: "allowed markets",
v015permission: v015committee.SubParamChangePermission{
AllowedParams: v015committee.AllowedParams{{
Subspace: v016pricefeedtypes.ModuleName,
Key: string(v016pricefeedtypes.KeyMarkets),
}},
AllowedMarkets: v015committee.AllowedMarkets{
{
MarketID: "bnb-btc",
BaseAsset: false,
QuoteAsset: true,
Active: true,
},
{
MarketID: "btc-usd",
BaseAsset: true,
Oracles: true,
Active: true,
},
},
},
v016permission: &v016committee.ParamsChangePermission{
AllowedParamsChanges: v016committee.AllowedParamsChanges{
{
Subspace: v016pricefeedtypes.ModuleName,
Key: string(v016pricefeedtypes.KeyMarkets),
MultiSubparamsRequirements: []v016committee.SubparamRequirement{
{
Key: "market_id",
Val: "bnb-btc",
AllowedSubparamAttrChanges: []string{"active", "quote_asset"},
},
{
Key: "market_id",
Val: "btc-usd",
AllowedSubparamAttrChanges: []string{"active", "base_asset", "oracles"},
},
},
},
},
},
},
{
name: "allowed markets - no requirements",
v015permission: v015committee.SubParamChangePermission{
AllowedParams: v015committee.AllowedParams{{
Subspace: v016pricefeedtypes.ModuleName,
Key: string(v016pricefeedtypes.KeyMarkets),
}},
},
v016permission: &v016committee.ParamsChangePermission{
AllowedParamsChanges: v016committee.AllowedParamsChanges{
{
Subspace: v016pricefeedtypes.ModuleName,
Key: string(v016pricefeedtypes.KeyMarkets),
MultiSubparamsRequirements: []v016committee.SubparamRequirement{},
},
},
},
},
{
name: "allowed money markets",
v015permission: v015committee.SubParamChangePermission{
AllowedParams: v015committee.AllowedParams{{
Subspace: v016hardtypes.ModuleName,
Key: string(v016hardtypes.KeyMoneyMarkets),
}},
AllowedMoneyMarkets: v015committee.AllowedMoneyMarkets{
{
Denom: "bnb",
BorrowLimit: true,
ConversionFactor: false,
ReserveFactor: true,
KeeperRewardPercentage: true,
},
{
Denom: "btc",
BorrowLimit: false,
SpotMarketID: true,
InterestRateModel: true,
},
},
},
v016permission: &v016committee.ParamsChangePermission{
AllowedParamsChanges: v016committee.AllowedParamsChanges{
{
Subspace: v016hardtypes.ModuleName,
Key: string(v016hardtypes.KeyMoneyMarkets),
MultiSubparamsRequirements: []v016committee.SubparamRequirement{
{
Key: "denom",
Val: "bnb",
AllowedSubparamAttrChanges: []string{"borrow_limit", "keeper_reward_percentage", "reserve_factor"},
},
{
Key: "denom",
Val: "btc",
AllowedSubparamAttrChanges: []string{"interest_rate_model", "spot_market_id"},
},
},
},
},
},
},
{
name: "allowed money markets - no requirements",
v015permission: v015committee.SubParamChangePermission{
AllowedParams: v015committee.AllowedParams{{
Subspace: v016hardtypes.ModuleName,
Key: string(v016hardtypes.KeyMoneyMarkets),
}},
},
v016permission: &v016committee.ParamsChangePermission{
AllowedParamsChanges: v016committee.AllowedParamsChanges{
{
Subspace: v016hardtypes.ModuleName,
Key: string(v016hardtypes.KeyMoneyMarkets),
MultiSubparamsRequirements: []v016committee.SubparamRequirement{},
},
},
},
},
{
name: "allowed params",
v015permission: v015committee.SubParamChangePermission{
AllowedParams: v015committee.AllowedParams{{
Subspace: v016hardtypes.ModuleName,
Key: string(v016hardtypes.KeyMinimumBorrowUSDValue),
}},
},
v016permission: &v016committee.ParamsChangePermission{
AllowedParamsChanges: v016committee.AllowedParamsChanges{
{
Subspace: v016hardtypes.ModuleName,
Key: string(v016hardtypes.KeyMinimumBorrowUSDValue),
},
},
},
},
}
for _, tc := range testcases {
s.Run(tc.name, func() {
oldCommittee := v015committee.MemberCommittee{
BaseCommittee: v015committee.BaseCommittee{
ID: 2,
Description: "test",
Members: s.addresses,
Permissions: []v015committee.Permission{tc.v015permission},
VoteThreshold: sdk.NewDec(40),
ProposalDuration: time.Hour * 24 * 7,
TallyOption: v015committee.FirstPastThePost,
},
}
expectedProposal, err := v016committee.NewMemberCommittee(2, "test", s.addresses, []v016committee.Permission{tc.v016permission}, oldCommittee.VoteThreshold, oldCommittee.ProposalDuration, v016committee.TALLY_OPTION_FIRST_PAST_THE_POST)
s.Require().NoError(err)
s.v15genstate.Committees = []v015committee.Committee{oldCommittee}
genState := Migrate(s.v15genstate, s.v15pricefeedgenstate)
s.Require().Len(genState.Committees, 1)
s.Equal(expectedProposal, genState.GetCommittees()[0])
})
}
}

View File

@ -1,440 +0,0 @@
package v0_16
import (
"io/ioutil"
"path/filepath"
"testing"
"time"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
v036distr "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v036"
v040distr "github.com/cosmos/cosmos-sdk/x/distribution/types"
v036gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v036"
v040gov "github.com/cosmos/cosmos-sdk/x/gov/types"
v036params "github.com/cosmos/cosmos-sdk/x/params/legacy/v036"
v040params "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
v038upgrade "github.com/cosmos/cosmos-sdk/x/upgrade/legacy/v038"
v040upgrade "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/stretchr/testify/suite"
app "github.com/kava-labs/kava/app"
v015committee "github.com/kava-labs/kava/x/committee/legacy/v0_15"
v016committee "github.com/kava-labs/kava/x/committee/types"
v015kavadist "github.com/kava-labs/kava/x/kavadist/legacy/v0_15"
v016kavadist "github.com/kava-labs/kava/x/kavadist/types"
v015pricefeed "github.com/kava-labs/kava/x/pricefeed/legacy/v0_15"
v016pricefeedtypes "github.com/kava-labs/kava/x/pricefeed/types"
)
type migrateTestSuite struct {
suite.Suite
addresses []sdk.AccAddress
v15genstate v015committee.GenesisState
v15pricefeedgenstate v015pricefeed.GenesisState
cdc codec.Codec
legacyCdc *codec.LegacyAmino
}
func (s *migrateTestSuite) SetupTest() {
app.SetSDKConfig()
s.v15genstate = v015committee.GenesisState{
Committees: v015committee.Committees{},
Proposals: []v015committee.Proposal{},
NextProposalID: 1,
Votes: []v015committee.Vote{},
}
config := app.MakeEncodingConfig()
s.cdc = config.Marshaler
legacyCodec := codec.NewLegacyAmino()
v015committee.RegisterLegacyAminoCodec(legacyCodec)
v036distr.RegisterLegacyAminoCodec(legacyCodec)
v038upgrade.RegisterLegacyAminoCodec(legacyCodec)
v036params.RegisterLegacyAminoCodec(legacyCodec)
v015kavadist.RegisterLegacyAminoCodec(legacyCodec)
s.legacyCdc = legacyCodec
_, accAddresses := app.GeneratePrivKeyAddressPairs(10)
s.addresses = accAddresses
}
func (s *migrateTestSuite) TestMigrate_JSON() {
file := filepath.Join("testdata", "v15-committee.json")
data, err := ioutil.ReadFile(file)
s.Require().NoError(err)
err = s.legacyCdc.UnmarshalJSON(data, &s.v15genstate)
s.Require().NoError(err)
pricefeedFile := filepath.Join("testdata", "v15-pricefeed.json")
pricefeedData, err := ioutil.ReadFile(pricefeedFile)
s.Require().NoError(err)
err = s.legacyCdc.UnmarshalJSON(pricefeedData, &s.v15pricefeedgenstate)
s.Require().NoError(err)
genstate := Migrate(s.v15genstate, s.v15pricefeedgenstate)
actual := s.cdc.MustMarshalJSON(genstate)
file = filepath.Join("testdata", "v16-committee.json")
expected, err := ioutil.ReadFile(file)
s.Require().NoError(err)
s.Require().JSONEq(string(expected), string(actual))
}
func (s *migrateTestSuite) TestMigrate_PricefeedPermissions() {
file := filepath.Join("testdata", "v15-committee.json")
data, err := ioutil.ReadFile(file)
s.Require().NoError(err)
err = s.legacyCdc.UnmarshalJSON(data, &s.v15genstate)
s.Require().NoError(err)
pricefeedFile := filepath.Join("testdata", "v15-pricefeed.json")
pricefeedData, err := ioutil.ReadFile(pricefeedFile)
s.Require().NoError(err)
err = s.legacyCdc.UnmarshalJSON(pricefeedData, &s.v15pricefeedgenstate)
s.Require().NoError(err)
genstate := Migrate(s.v15genstate, s.v15pricefeedgenstate)
uniqueMarkets := make(map[string]bool)
for _, permission := range genstate.GetCommittees()[0].GetPermissions() {
paramChangePermission, ok := permission.(v016committee.ParamsChangePermission)
if !ok {
continue
}
for _, allowedParamChanges := range paramChangePermission.AllowedParamsChanges {
if allowedParamChanges.Subspace == v016pricefeedtypes.ModuleName {
for _, req := range allowedParamChanges.MultiSubparamsRequirements {
_, found := uniqueMarkets[req.Val]
s.Require().Falsef(
found,
"pricefeed market MultiSubparamsRequirement for %v is duplicated",
req.Val,
)
uniqueMarkets[req.Val] = true
}
}
}
}
}
func (s *migrateTestSuite) TestMigrate_TokenCommittee() {
oldTokenCommittee := v015committee.TokenCommittee{
BaseCommittee: v015committee.BaseCommittee{
ID: 1,
Description: "test",
Members: s.addresses,
Permissions: []v015committee.Permission{},
VoteThreshold: sdk.NewDec(40),
ProposalDuration: time.Hour * 24 * 7,
TallyOption: v015committee.Deadline,
},
Quorum: sdk.NewDec(40),
TallyDenom: "ukava",
}
expectedTokenCommittee, err := v016committee.NewTokenCommittee(1, "test", s.addresses, []v016committee.Permission{}, oldTokenCommittee.VoteThreshold, oldTokenCommittee.ProposalDuration, v016committee.TALLY_OPTION_DEADLINE, oldTokenCommittee.Quorum, oldTokenCommittee.TallyDenom)
s.Require().NoError(err)
s.v15genstate.Committees = []v015committee.Committee{oldTokenCommittee}
genState := Migrate(s.v15genstate, s.v15pricefeedgenstate)
s.Require().Len(genState.Committees, 1)
s.Equal(expectedTokenCommittee, genState.GetCommittees()[0])
}
func (s *migrateTestSuite) TestMigrate_Committee_TallyOption() {
testcases := []struct {
name string
v015tallyOption v015committee.TallyOption
v016tallyOption v016committee.TallyOption
}{
{
name: "null tally option",
v015tallyOption: v015committee.NullTallyOption,
v016tallyOption: v016committee.TALLY_OPTION_UNSPECIFIED,
},
{
name: "first past the post tally option",
v015tallyOption: v015committee.FirstPastThePost,
v016tallyOption: v016committee.TALLY_OPTION_FIRST_PAST_THE_POST,
},
{
name: "deadline tally",
v015tallyOption: v015committee.Deadline,
v016tallyOption: v016committee.TALLY_OPTION_DEADLINE,
},
}
for _, tc := range testcases {
s.Run(tc.name, func() {
oldCommittee := v015committee.MemberCommittee{
BaseCommittee: v015committee.BaseCommittee{
ID: 2,
Description: "test",
Members: s.addresses,
Permissions: []v015committee.Permission{},
VoteThreshold: sdk.NewDec(40),
ProposalDuration: time.Hour * 24 * 7,
TallyOption: tc.v015tallyOption,
},
}
expectedProposal, err := v016committee.NewMemberCommittee(2, "test", s.addresses, []v016committee.Permission{}, oldCommittee.VoteThreshold, oldCommittee.ProposalDuration, tc.v016tallyOption)
s.Require().NoError(err)
s.v15genstate.Committees = []v015committee.Committee{oldCommittee}
genState := Migrate(s.v15genstate, s.v15pricefeedgenstate)
s.Require().Len(genState.Committees, 1)
s.Equal(expectedProposal.GetTallyOption(), genState.GetCommittees()[0].GetTallyOption())
})
}
}
func (s *migrateTestSuite) TestMigrate_Committee_Permissions() {
testcases := []struct {
name string
v015permission v015committee.Permission
v016permission v016committee.Permission
}{
{
name: "god permission",
v015permission: v015committee.GodPermission{},
v016permission: &v016committee.GodPermission{},
},
{
name: "text permission",
v015permission: v015committee.TextPermission{},
v016permission: &v016committee.TextPermission{},
},
{
name: "software upgrade permission",
v015permission: v015committee.SoftwareUpgradePermission{},
v016permission: &v016committee.SoftwareUpgradePermission{},
},
{
name: "simple param change permission",
v015permission: v015committee.SimpleParamChangePermission{
AllowedParams: []v015committee.AllowedParam{
{Subspace: "staking", Key: "bondDenom"},
{Subspace: "test", Key: "testkey"},
},
},
v016permission: &v016committee.ParamsChangePermission{
AllowedParamsChanges: []v016committee.AllowedParamsChange{
{Subspace: "staking", Key: "bondDenom"},
{Subspace: "test", Key: "testkey"},
},
},
},
{
name: "sub param change permission",
v015permission: v015committee.SubParamChangePermission{
AllowedParams: []v015committee.AllowedParam{
{Subspace: "staking", Key: "bondDenom"},
{Subspace: "test", Key: "testkey"},
},
},
v016permission: &v016committee.ParamsChangePermission{
AllowedParamsChanges: []v016committee.AllowedParamsChange{
{Subspace: "staking", Key: "bondDenom"},
{Subspace: "test", Key: "testkey"},
},
},
},
}
for _, tc := range testcases {
s.Run(tc.name, func() {
oldCommittee := v015committee.MemberCommittee{
BaseCommittee: v015committee.BaseCommittee{
ID: 2,
Description: "test",
Members: s.addresses,
Permissions: []v015committee.Permission{tc.v015permission},
VoteThreshold: sdk.NewDec(40),
ProposalDuration: time.Hour * 24 * 7,
TallyOption: v015committee.FirstPastThePost,
},
}
expectedProposal, err := v016committee.NewMemberCommittee(2, "test", s.addresses, []v016committee.Permission{tc.v016permission}, oldCommittee.VoteThreshold, oldCommittee.ProposalDuration, v016committee.TALLY_OPTION_FIRST_PAST_THE_POST)
s.Require().NoError(err)
s.v15genstate.Committees = []v015committee.Committee{oldCommittee}
genState := Migrate(s.v15genstate, s.v15pricefeedgenstate)
s.Require().Len(genState.Committees, 1)
s.Equal(expectedProposal, genState.GetCommittees()[0])
})
}
}
func (s *migrateTestSuite) TestMigrate_Proposals() {
testcases := []struct {
name string
v015proposal v015committee.PubProposal
v016proposal v016committee.PubProposal
}{
{
name: "text proposal",
v015proposal: v036gov.NewTextProposal("A Title", "A description of this proposal."),
v016proposal: v040gov.NewTextProposal("A Title", "A description of this proposal."),
},
{
name: "community poll spend proposal",
v015proposal: v036distr.CommunityPoolSpendProposal{
Title: "Community Pool Spend",
Description: "Fund the community pool.",
Recipient: s.addresses[0],
Amount: sdk.NewCoins(sdk.NewInt64Coin("ukava", 10)),
},
v016proposal: &v040distr.CommunityPoolSpendProposal{
Title: "Community Pool Spend",
Description: "Fund the community pool.",
Recipient: s.addresses[0].String(),
Amount: sdk.NewCoins(sdk.NewInt64Coin("ukava", 10)),
},
},
{
name: "software upgrade with deprecated plan time",
v015proposal: v038upgrade.SoftwareUpgradeProposal{
Title: "Test",
Description: "Test",
Plan: v038upgrade.Plan{Name: "Test", Height: 100, Time: time.Now()},
},
v016proposal: &v040upgrade.SoftwareUpgradeProposal{
Title: "Test",
Description: "Test",
Plan: v040upgrade.Plan{Name: "Test", Height: 100},
},
},
{
name: "param change proposal",
v015proposal: v036params.ParameterChangeProposal{
Title: "Test",
Description: "Test",
Changes: []v036params.ParamChange{
{Subspace: "Test", Key: "Test", Value: "Test"},
},
},
v016proposal: &v040params.ParameterChangeProposal{
Title: "Test",
Description: "Test",
Changes: []v040params.ParamChange{
{Subspace: "Test", Key: "Test", Value: "Test"},
},
},
},
{
name: "kavadist community pool multi spend proposal",
v015proposal: v015kavadist.CommunityPoolMultiSpendProposal{
Title: "Test",
Description: "Test",
RecipientList: v015kavadist.MultiSpendRecipients{
v015kavadist.MultiSpendRecipient{
Address: s.addresses[0],
Amount: sdk.NewCoins(sdk.NewInt64Coin("ukava", 10)),
},
},
},
v016proposal: &v016kavadist.CommunityPoolMultiSpendProposal{
Title: "Test",
Description: "Test",
RecipientList: []v016kavadist.MultiSpendRecipient{
{
Address: s.addresses[0].String(),
Amount: sdk.NewCoins(sdk.NewInt64Coin("ukava", 10)),
},
},
},
},
{
name: "cancel software upgrade proposal",
v015proposal: v038upgrade.CancelSoftwareUpgradeProposal{
Title: "Test",
Description: "Test",
},
v016proposal: &v040upgrade.CancelSoftwareUpgradeProposal{
Title: "Test",
Description: "Test",
},
},
}
for _, tc := range testcases {
s.Run(tc.name, func() {
deadline := time.Now().Add(2 * time.Hour)
oldProposal := v015committee.Proposal{
PubProposal: tc.v015proposal,
ID: 1,
CommitteeID: 2,
Deadline: deadline,
}
expectedProposal, err := v016committee.NewProposal(tc.v016proposal, 1, 2, deadline)
s.Require().NoError(err)
s.v15genstate.Proposals = []v015committee.Proposal{oldProposal}
genState := Migrate(s.v15genstate, s.v15pricefeedgenstate)
s.Require().Len(genState.Proposals, 1)
s.Equal(expectedProposal, genState.Proposals[0])
})
}
}
func (s *migrateTestSuite) TestMigrate_Votes() {
testcases := []struct {
name string
v015voteType v015committee.VoteType
v016VoteType v016committee.VoteType
}{
{
name: "yes vote",
v015voteType: v015committee.Yes,
v016VoteType: v016committee.VOTE_TYPE_YES,
},
{
name: "no vote",
v015voteType: v015committee.No,
v016VoteType: v016committee.VOTE_TYPE_NO,
},
{
name: "null vote",
v015voteType: v015committee.NullVoteType,
v016VoteType: v016committee.VOTE_TYPE_UNSPECIFIED,
},
{
name: "abstain vote",
v015voteType: v015committee.Abstain,
v016VoteType: v016committee.VOTE_TYPE_ABSTAIN,
},
}
for _, tc := range testcases {
s.Run(tc.name, func() {
oldVote := v015committee.Vote{
ProposalID: 1,
Voter: s.addresses[0],
VoteType: tc.v015voteType,
}
expectedVote := v016committee.Vote{
ProposalID: 1,
Voter: s.addresses[0],
VoteType: tc.v016VoteType,
}
s.v15genstate.Votes = []v015committee.Vote{oldVote}
genState := Migrate(s.v15genstate, s.v15pricefeedgenstate)
s.Require().Len(genState.Votes, 1)
s.Equal(expectedVote, genState.Votes[0])
})
}
}
func TestMigrateTestSuite(t *testing.T) {
suite.Run(t, new(migrateTestSuite))
}

View File

@ -1,658 +0,0 @@
{
"committees": [
{
"type": "kava/MemberCommittee",
"value": {
"base_committee": {
"type": "kava/MemberCommittee",
"id": "1",
"description": "Kava Stability Committee",
"members": ["kava1n96qpdfcz2m7y364ewk8srv9zuq6ucwduyjaag"],
"permissions": [
{
"type": "kava/SubParamChangePermission",
"value": {
"allowed_params": [
{
"subspace": "auction",
"key": "BidDuration"
},
{
"subspace": "auction",
"key": "IncrementSurplus"
},
{
"subspace": "auction",
"key": "IncrementDebt"
},
{
"subspace": "auction",
"key": "IncrementCollateral"
},
{
"subspace": "bep3",
"key": "AssetParams"
},
{
"subspace": "cdp",
"key": "GlobalDebtLimit"
},
{
"subspace": "cdp",
"key": "SurplusThreshold"
},
{
"subspace": "cdp",
"key": "SurplusLot"
},
{
"subspace": "cdp",
"key": "DebtThreshold"
},
{
"subspace": "cdp",
"key": "DebtLot"
},
{
"subspace": "cdp",
"key": "DistributionFrequency"
},
{
"subspace": "cdp",
"key": "CollateralParams"
},
{
"subspace": "cdp",
"key": "DebtParam"
},
{
"subspace": "incentive",
"key": "Active"
},
{
"subspace": "kavadist",
"key": "Active"
},
{
"subspace": "pricefeed",
"key": "Markets"
},
{
"subspace": "hard",
"key": "MoneyMarkets"
},
{
"subspace": "hard",
"key": "MinimumBorrowUSDValue"
}
],
"allowed_collateral_params": [
{
"type": "bnb-a",
"denom": false,
"liquidation_ratio": false,
"debt_limit": true,
"stability_fee": true,
"auction_size": true,
"liquidation_penalty": false,
"prefix": false,
"spot_market_id": false,
"liquidation_market_id": false,
"conversion_factor": false,
"keeper_reward_percentage": true,
"check_collateralization_index_count": true
},
{
"type": "busd-a",
"denom": false,
"liquidation_ratio": false,
"debt_limit": true,
"stability_fee": true,
"auction_size": true,
"liquidation_penalty": false,
"prefix": false,
"spot_market_id": false,
"liquidation_market_id": false,
"conversion_factor": false,
"keeper_reward_percentage": true,
"check_collateralization_index_count": true
},
{
"type": "busd-b",
"denom": false,
"liquidation_ratio": false,
"debt_limit": true,
"stability_fee": true,
"auction_size": true,
"liquidation_penalty": false,
"prefix": false,
"spot_market_id": false,
"liquidation_market_id": false,
"conversion_factor": false,
"keeper_reward_percentage": true,
"check_collateralization_index_count": true
},
{
"type": "btcb-a",
"denom": false,
"liquidation_ratio": false,
"debt_limit": true,
"stability_fee": true,
"auction_size": true,
"liquidation_penalty": false,
"prefix": false,
"spot_market_id": false,
"liquidation_market_id": false,
"conversion_factor": false,
"keeper_reward_percentage": true,
"check_collateralization_index_count": true
},
{
"type": "xrpb-a",
"denom": false,
"liquidation_ratio": false,
"debt_limit": true,
"stability_fee": true,
"auction_size": true,
"liquidation_penalty": false,
"prefix": false,
"spot_market_id": false,
"liquidation_market_id": false,
"conversion_factor": false,
"keeper_reward_percentage": true,
"check_collateralization_index_count": true
},
{
"type": "ukava-a",
"denom": false,
"liquidation_ratio": false,
"debt_limit": true,
"stability_fee": true,
"auction_size": true,
"liquidation_penalty": false,
"prefix": false,
"spot_market_id": false,
"liquidation_market_id": false,
"conversion_factor": false,
"keeper_reward_percentage": true,
"check_collateralization_index_count": true
},
{
"type": "hard-a",
"denom": false,
"liquidation_ratio": false,
"debt_limit": true,
"stability_fee": true,
"auction_size": true,
"liquidation_penalty": false,
"prefix": false,
"spot_market_id": false,
"liquidation_market_id": false,
"conversion_factor": false,
"keeper_reward_percentage": true,
"check_collateralization_index_count": true
},
{
"type": "hbtc-a",
"denom": false,
"liquidation_ratio": false,
"debt_limit": true,
"stability_fee": true,
"auction_size": true,
"liquidation_penalty": false,
"prefix": false,
"spot_market_id": false,
"liquidation_market_id": false,
"conversion_factor": false,
"keeper_reward_percentage": true,
"check_collateralization_index_count": true
}
],
"allowed_debt_param": {
"denom": false,
"reference_asset": false,
"conversion_factor": false,
"debt_floor": true
},
"allowed_asset_params": [
{
"denom": "bnb",
"coin_id": false,
"limit": true,
"active": true,
"max_swap_amount": true,
"min_block_lock": true
},
{
"denom": "busd",
"coin_id": true,
"limit": true,
"active": true,
"max_swap_amount": true,
"min_block_lock": true
},
{
"denom": "btcb",
"coin_id": false,
"limit": true,
"active": true,
"max_swap_amount": true,
"min_block_lock": true
},
{
"denom": "xrpb",
"coin_id": false,
"limit": true,
"active": true,
"max_swap_amount": true,
"min_block_lock": true
}
],
"allowed_markets": [
{
"market_id": "bnb:usd",
"base_asset": false,
"quote_asset": false,
"oracles": false,
"active": true
},
{
"market_id": "bnb:usd:30",
"base_asset": false,
"quote_asset": false,
"oracles": false,
"active": true
},
{
"market_id": "btc:usd",
"base_asset": false,
"quote_asset": false,
"oracles": false,
"active": true
},
{
"market_id": "btc:usd:30",
"base_asset": false,
"quote_asset": false,
"oracles": false,
"active": true
},
{
"market_id": "xrp:usd",
"base_asset": false,
"quote_asset": false,
"oracles": false,
"active": true
},
{
"market_id": "xrp:usd:30",
"base_asset": false,
"quote_asset": false,
"oracles": false,
"active": true
},
{
"market_id": "busd:usd",
"base_asset": false,
"quote_asset": false,
"oracles": false,
"active": true
},
{
"market_id": "busd:usd:30",
"base_asset": false,
"quote_asset": false,
"oracles": false,
"active": true
}
],
"allowed_money_markets": [
{
"denom": "bnb",
"borrow_limit": true,
"spot_market_id": false,
"conversion_factor": false,
"interest_rate_model": true,
"reserve_factor": true,
"keeper_reward_percentage": true
},
{
"denom": "busd",
"borrow_limit": true,
"spot_market_id": false,
"conversion_factor": false,
"interest_rate_model": true,
"reserve_factor": true,
"keeper_reward_percentage": true
},
{
"denom": "btcb",
"borrow_limit": true,
"spot_market_id": false,
"conversion_factor": false,
"interest_rate_model": true,
"reserve_factor": true,
"keeper_reward_percentage": true
},
{
"denom": "xrpb",
"borrow_limit": true,
"spot_market_id": false,
"conversion_factor": false,
"interest_rate_model": true,
"reserve_factor": true,
"keeper_reward_percentage": true
},
{
"denom": "usdx",
"borrow_limit": true,
"spot_market_id": false,
"conversion_factor": false,
"interest_rate_model": true,
"reserve_factor": true,
"keeper_reward_percentage": true
},
{
"denom": "ukava",
"borrow_limit": true,
"spot_market_id": false,
"conversion_factor": false,
"interest_rate_model": true,
"reserve_factor": true,
"keeper_reward_percentage": true
},
{
"denom": "hard",
"borrow_limit": true,
"spot_market_id": false,
"conversion_factor": false,
"interest_rate_model": true,
"reserve_factor": true,
"keeper_reward_percentage": true
}
]
}
},
{
"type": "kava/TextPermission",
"value": {}
}
],
"vote_threshold": "0.500000000000000000",
"proposal_duration": "600000000000",
"tally_option": "FirstPastThePost"
}
}
},
{
"type": "kava/MemberCommittee",
"value": {
"base_committee": {
"id": "2",
"description": "Kava Safety Committee",
"members": ["kava1n96qpdfcz2m7y364ewk8srv9zuq6ucwduyjaag"],
"permissions": [
{
"type": "kava/SoftwareUpgradePermission",
"value": {}
}
],
"vote_threshold": "0.500000000000000000",
"proposal_duration": "604800000000000",
"tally_option": "FirstPastThePost"
}
}
},
{
"type": "kava/TokenCommittee",
"value": {
"base_committee": {
"id": "3",
"description": "Hard Governance Committee",
"members": ["kava1n96qpdfcz2m7y364ewk8srv9zuq6ucwduyjaag"],
"permissions": [
{
"type": "kava/SubParamChangePermission",
"value": {
"allowed_params": [
{
"subspace": "hard",
"key": "MoneyMarkets"
},
{
"subspace": "hard",
"key": "MinimumBorrowUSDValue"
},
{
"subspace": "incentive",
"key": "HardSupplyRewardPeriods"
},
{
"subspace": "incentive",
"key": "HardBorrowRewardPeriods"
},
{
"subspace": "incentive",
"key": "HardDelegatorRewardPeriods"
}
],
"allowed_collateral_params": null,
"allowed_debt_param": {
"denom": false,
"reference_asset": false,
"conversion_factor": false,
"debt_floor": false
},
"allowed_asset_params": null,
"allowed_markets": null,
"allowed_money_markets": [
{
"denom": "bnb",
"borrow_limit": true,
"spot_market_id": true,
"conversion_factor": false,
"interest_rate_model": true,
"reserve_factor": true,
"keeper_reward_percentage": true
},
{
"denom": "busd",
"borrow_limit": true,
"spot_market_id": true,
"conversion_factor": false,
"interest_rate_model": true,
"reserve_factor": true,
"keeper_reward_percentage": true
},
{
"denom": "btcb",
"borrow_limit": true,
"spot_market_id": true,
"conversion_factor": false,
"interest_rate_model": true,
"reserve_factor": true,
"keeper_reward_percentage": true
},
{
"denom": "xrpb",
"borrow_limit": true,
"spot_market_id": true,
"conversion_factor": false,
"interest_rate_model": true,
"reserve_factor": true,
"keeper_reward_percentage": true
},
{
"denom": "usdx",
"borrow_limit": true,
"spot_market_id": true,
"conversion_factor": false,
"interest_rate_model": true,
"reserve_factor": true,
"keeper_reward_percentage": true
},
{
"denom": "ukava",
"borrow_limit": true,
"spot_market_id": true,
"conversion_factor": false,
"interest_rate_model": true,
"reserve_factor": true,
"keeper_reward_percentage": true
},
{
"denom": "hard",
"borrow_limit": true,
"spot_market_id": true,
"conversion_factor": false,
"interest_rate_model": true,
"reserve_factor": true,
"keeper_reward_percentage": true
}
]
}
}
],
"vote_threshold": "0.500000000000000000",
"proposal_duration": "600000000000",
"tally_option": "Deadline"
},
"quorum": "0.330000000000000000",
"tally_denom": "hard"
}
},
{
"type": "kava/TokenCommittee",
"value": {
"base_committee": {
"id": "4",
"description": "Swp Governance Committee",
"members": ["kava1n96qpdfcz2m7y364ewk8srv9zuq6ucwduyjaag"],
"permissions": [
{
"type": "kava/SubParamChangePermission",
"value": {
"allowed_params": [
{
"subspace": "swap",
"key": "AllowedPools"
},
{
"subspace": "swap",
"key": "SwapFee"
},
{
"subspace": "incentive",
"key": "HardDelegatorRewardPeriods"
},
{
"subspace": "incentive",
"key": "SwapRewardPeriods"
}
],
"allowed_collateral_params": null,
"allowed_debt_param": {
"denom": false,
"reference_asset": false,
"conversion_factor": false,
"debt_floor": false
},
"allowed_asset_params": null,
"allowed_markets": null,
"allowed_money_markets": null
}
}
],
"vote_threshold": "0.500000000000000000",
"proposal_duration": "600000000000",
"tally_option": "Deadline"
},
"quorum": "0.330000000000000000",
"tally_denom": "swp"
}
},
{
"type": "kava/MemberCommittee",
"value": {
"base_committee": {
"id": "5",
"description": "Kava God Committee (testing only)",
"members": ["kava1n96qpdfcz2m7y364ewk8srv9zuq6ucwduyjaag"],
"permissions": [
{
"type": "kava/GodPermission",
"value": {}
}
],
"vote_threshold": "0.500000000000000000",
"proposal_duration": "604800000000000",
"tally_option": "FirstPastThePost"
}
}
}
],
"next_proposal_id": "1",
"proposals": [
{
"pub_proposal": {
"type": "kava/CommunityPoolMultiSpendProposal",
"value": {
"title": "Test",
"description": "Test",
"recipient_list": [
{
"address": "kava1ze7y9qwdddejmy7jlw4cymqqlt2wh05yhwmrv2",
"amount": [{ "denom": "ukava", "amount": "10" }]
}
]
}
},
"id": "1",
"committee_id": "2",
"deadline": "2021-11-24T18:48:08.693415Z"
},
{
"pub_proposal": {
"type": "cosmos-sdk/CommunityPoolSpendProposal",
"value": {
"title": "Community Pool Spend",
"description": "Fund the community pool.",
"recipient": "kava1ze7y9qwdddejmy7jlw4cymqqlt2wh05yhwmrv2",
"amount": [{ "denom": "ukava", "amount": "10" }]
}
},
"id": "1",
"committee_id": "2",
"deadline": "2021-11-24T18:49:44.219341Z"
},
{
"pub_proposal": {
"type": "cosmos-sdk/SoftwareUpgradeProposal",
"value": {
"title": "Test",
"description": "Test",
"plan": {
"name": "Test",
"time": "2021-11-24T16:49:44.219327Z",
"height": "100"
}
}
},
"id": "1",
"committee_id": "2",
"deadline": "2021-11-24T18:49:44.219693Z"
}
],
"votes": [
{
"proposal_id": "1",
"voter": "kava1ze7y9qwdddejmy7jlw4cymqqlt2wh05yhwmrv2",
"vote_type": "Yes"
},
{
"proposal_id": "1",
"voter": "kava1ze7y9qwdddejmy7jlw4cymqqlt2wh05yhwmrv2",
"vote_type": "Abstain"
}
]
}

View File

@ -1,312 +0,0 @@
{
"params": {
"markets": [
{
"market_id": "bnb:usd",
"base_asset": "bnb",
"quote_asset": "usd",
"oracles": [
"kava12dyshua9nkvx9w8ywp72wdnzrc4t4mnnycz0dl",
"kava1tuxyepdrkwraa22k99w04c0wa64tgh70mv87fs",
"kava1ueak7nzesm3pnev6lngp6lgk0ry02djz8pjpcg",
"kava1sl62nqm89c780yxm3m9lp3tacmpnfljq6tytvl",
"kava1ujfrlcd0ted58mzplnyxzklsw0sqevlgxndanp",
"kava17fatl3wzxvk4rwfu3tqsctdp5x9vute67j9ufj",
"kava19rjk5qmmwywnzfccwzyn02jywgpwjqf60afj92",
"kava1xd39avn2f008jmvua0eupg39zsp2xn3wf802vn",
"kava1pt6q4kdmwawr3thm9cd82pq7hml8u84rd0f3jy",
"kava13tpwqygswyzupqfggfgh9dmtgthgucn5wpfksh"
],
"active": true
},
{
"market_id": "bnb:usd:30",
"base_asset": "bnb",
"quote_asset": "usd",
"oracles": [
"kava12dyshua9nkvx9w8ywp72wdnzrc4t4mnnycz0dl",
"kava1tuxyepdrkwraa22k99w04c0wa64tgh70mv87fs",
"kava1ueak7nzesm3pnev6lngp6lgk0ry02djz8pjpcg",
"kava1sl62nqm89c780yxm3m9lp3tacmpnfljq6tytvl",
"kava1ujfrlcd0ted58mzplnyxzklsw0sqevlgxndanp",
"kava17fatl3wzxvk4rwfu3tqsctdp5x9vute67j9ufj",
"kava19rjk5qmmwywnzfccwzyn02jywgpwjqf60afj92",
"kava1xd39avn2f008jmvua0eupg39zsp2xn3wf802vn",
"kava1pt6q4kdmwawr3thm9cd82pq7hml8u84rd0f3jy",
"kava13tpwqygswyzupqfggfgh9dmtgthgucn5wpfksh"
],
"active": true
},
{
"market_id": "btc:usd",
"base_asset": "btc",
"quote_asset": "usd",
"oracles": [
"kava12dyshua9nkvx9w8ywp72wdnzrc4t4mnnycz0dl",
"kava1tuxyepdrkwraa22k99w04c0wa64tgh70mv87fs",
"kava1ueak7nzesm3pnev6lngp6lgk0ry02djz8pjpcg",
"kava1sl62nqm89c780yxm3m9lp3tacmpnfljq6tytvl",
"kava1ujfrlcd0ted58mzplnyxzklsw0sqevlgxndanp",
"kava17fatl3wzxvk4rwfu3tqsctdp5x9vute67j9ufj",
"kava19rjk5qmmwywnzfccwzyn02jywgpwjqf60afj92",
"kava1xd39avn2f008jmvua0eupg39zsp2xn3wf802vn",
"kava1pt6q4kdmwawr3thm9cd82pq7hml8u84rd0f3jy",
"kava13tpwqygswyzupqfggfgh9dmtgthgucn5wpfksh"
],
"active": true
},
{
"market_id": "btc:usd:30",
"base_asset": "btc",
"quote_asset": "usd",
"oracles": [
"kava12dyshua9nkvx9w8ywp72wdnzrc4t4mnnycz0dl",
"kava1tuxyepdrkwraa22k99w04c0wa64tgh70mv87fs",
"kava1ueak7nzesm3pnev6lngp6lgk0ry02djz8pjpcg",
"kava1sl62nqm89c780yxm3m9lp3tacmpnfljq6tytvl",
"kava1ujfrlcd0ted58mzplnyxzklsw0sqevlgxndanp",
"kava17fatl3wzxvk4rwfu3tqsctdp5x9vute67j9ufj",
"kava19rjk5qmmwywnzfccwzyn02jywgpwjqf60afj92",
"kava1xd39avn2f008jmvua0eupg39zsp2xn3wf802vn",
"kava1pt6q4kdmwawr3thm9cd82pq7hml8u84rd0f3jy",
"kava13tpwqygswyzupqfggfgh9dmtgthgucn5wpfksh"
],
"active": true
},
{
"market_id": "xrp:usd",
"base_asset": "xrp",
"quote_asset": "usd",
"oracles": [
"kava12dyshua9nkvx9w8ywp72wdnzrc4t4mnnycz0dl",
"kava1tuxyepdrkwraa22k99w04c0wa64tgh70mv87fs",
"kava1ueak7nzesm3pnev6lngp6lgk0ry02djz8pjpcg",
"kava1sl62nqm89c780yxm3m9lp3tacmpnfljq6tytvl",
"kava1ujfrlcd0ted58mzplnyxzklsw0sqevlgxndanp",
"kava17fatl3wzxvk4rwfu3tqsctdp5x9vute67j9ufj",
"kava19rjk5qmmwywnzfccwzyn02jywgpwjqf60afj92",
"kava1xd39avn2f008jmvua0eupg39zsp2xn3wf802vn",
"kava1pt6q4kdmwawr3thm9cd82pq7hml8u84rd0f3jy",
"kava13tpwqygswyzupqfggfgh9dmtgthgucn5wpfksh"
],
"active": true
},
{
"market_id": "xrp:usd:30",
"base_asset": "xrp",
"quote_asset": "usd",
"oracles": [
"kava12dyshua9nkvx9w8ywp72wdnzrc4t4mnnycz0dl",
"kava1tuxyepdrkwraa22k99w04c0wa64tgh70mv87fs",
"kava1ueak7nzesm3pnev6lngp6lgk0ry02djz8pjpcg",
"kava1sl62nqm89c780yxm3m9lp3tacmpnfljq6tytvl",
"kava1ujfrlcd0ted58mzplnyxzklsw0sqevlgxndanp",
"kava17fatl3wzxvk4rwfu3tqsctdp5x9vute67j9ufj",
"kava19rjk5qmmwywnzfccwzyn02jywgpwjqf60afj92",
"kava1xd39avn2f008jmvua0eupg39zsp2xn3wf802vn",
"kava1pt6q4kdmwawr3thm9cd82pq7hml8u84rd0f3jy",
"kava13tpwqygswyzupqfggfgh9dmtgthgucn5wpfksh"
],
"active": true
},
{
"market_id": "busd:usd",
"base_asset": "busd",
"quote_asset": "usd",
"oracles": [
"kava12dyshua9nkvx9w8ywp72wdnzrc4t4mnnycz0dl",
"kava1tuxyepdrkwraa22k99w04c0wa64tgh70mv87fs",
"kava1ueak7nzesm3pnev6lngp6lgk0ry02djz8pjpcg",
"kava1sl62nqm89c780yxm3m9lp3tacmpnfljq6tytvl",
"kava1ujfrlcd0ted58mzplnyxzklsw0sqevlgxndanp",
"kava17fatl3wzxvk4rwfu3tqsctdp5x9vute67j9ufj",
"kava19rjk5qmmwywnzfccwzyn02jywgpwjqf60afj92",
"kava1xd39avn2f008jmvua0eupg39zsp2xn3wf802vn",
"kava1pt6q4kdmwawr3thm9cd82pq7hml8u84rd0f3jy",
"kava13tpwqygswyzupqfggfgh9dmtgthgucn5wpfksh"
],
"active": true
},
{
"market_id": "busd:usd:30",
"base_asset": "busd",
"quote_asset": "usd",
"oracles": [
"kava12dyshua9nkvx9w8ywp72wdnzrc4t4mnnycz0dl",
"kava1tuxyepdrkwraa22k99w04c0wa64tgh70mv87fs",
"kava1ueak7nzesm3pnev6lngp6lgk0ry02djz8pjpcg",
"kava1sl62nqm89c780yxm3m9lp3tacmpnfljq6tytvl",
"kava1ujfrlcd0ted58mzplnyxzklsw0sqevlgxndanp",
"kava17fatl3wzxvk4rwfu3tqsctdp5x9vute67j9ufj",
"kava19rjk5qmmwywnzfccwzyn02jywgpwjqf60afj92",
"kava1xd39avn2f008jmvua0eupg39zsp2xn3wf802vn",
"kava1pt6q4kdmwawr3thm9cd82pq7hml8u84rd0f3jy",
"kava13tpwqygswyzupqfggfgh9dmtgthgucn5wpfksh"
],
"active": true
},
{
"market_id": "kava:usd",
"base_asset": "kava",
"quote_asset": "usd",
"oracles": [
"kava12dyshua9nkvx9w8ywp72wdnzrc4t4mnnycz0dl",
"kava1tuxyepdrkwraa22k99w04c0wa64tgh70mv87fs",
"kava1ueak7nzesm3pnev6lngp6lgk0ry02djz8pjpcg",
"kava1sl62nqm89c780yxm3m9lp3tacmpnfljq6tytvl",
"kava1ujfrlcd0ted58mzplnyxzklsw0sqevlgxndanp",
"kava17fatl3wzxvk4rwfu3tqsctdp5x9vute67j9ufj",
"kava19rjk5qmmwywnzfccwzyn02jywgpwjqf60afj92",
"kava1xd39avn2f008jmvua0eupg39zsp2xn3wf802vn",
"kava1pt6q4kdmwawr3thm9cd82pq7hml8u84rd0f3jy",
"kava13tpwqygswyzupqfggfgh9dmtgthgucn5wpfksh"
],
"active": true
},
{
"market_id": "kava:usd:30",
"base_asset": "kava",
"quote_asset": "usd",
"oracles": [
"kava12dyshua9nkvx9w8ywp72wdnzrc4t4mnnycz0dl",
"kava1tuxyepdrkwraa22k99w04c0wa64tgh70mv87fs",
"kava1ueak7nzesm3pnev6lngp6lgk0ry02djz8pjpcg",
"kava1sl62nqm89c780yxm3m9lp3tacmpnfljq6tytvl",
"kava1ujfrlcd0ted58mzplnyxzklsw0sqevlgxndanp",
"kava17fatl3wzxvk4rwfu3tqsctdp5x9vute67j9ufj",
"kava19rjk5qmmwywnzfccwzyn02jywgpwjqf60afj92",
"kava1xd39avn2f008jmvua0eupg39zsp2xn3wf802vn",
"kava1pt6q4kdmwawr3thm9cd82pq7hml8u84rd0f3jy",
"kava13tpwqygswyzupqfggfgh9dmtgthgucn5wpfksh"
],
"active": true
},
{
"market_id": "hard:usd",
"base_asset": "hard",
"quote_asset": "usd",
"oracles": [
"kava12dyshua9nkvx9w8ywp72wdnzrc4t4mnnycz0dl",
"kava1tuxyepdrkwraa22k99w04c0wa64tgh70mv87fs",
"kava1ueak7nzesm3pnev6lngp6lgk0ry02djz8pjpcg",
"kava1sl62nqm89c780yxm3m9lp3tacmpnfljq6tytvl",
"kava1ujfrlcd0ted58mzplnyxzklsw0sqevlgxndanp",
"kava17fatl3wzxvk4rwfu3tqsctdp5x9vute67j9ufj",
"kava19rjk5qmmwywnzfccwzyn02jywgpwjqf60afj92",
"kava1xd39avn2f008jmvua0eupg39zsp2xn3wf802vn",
"kava1pt6q4kdmwawr3thm9cd82pq7hml8u84rd0f3jy",
"kava13tpwqygswyzupqfggfgh9dmtgthgucn5wpfksh"
],
"active": true
},
{
"market_id": "hard:usd:30",
"base_asset": "hard",
"quote_asset": "usd",
"oracles": [
"kava12dyshua9nkvx9w8ywp72wdnzrc4t4mnnycz0dl",
"kava1tuxyepdrkwraa22k99w04c0wa64tgh70mv87fs",
"kava1ueak7nzesm3pnev6lngp6lgk0ry02djz8pjpcg",
"kava1sl62nqm89c780yxm3m9lp3tacmpnfljq6tytvl",
"kava1ujfrlcd0ted58mzplnyxzklsw0sqevlgxndanp",
"kava17fatl3wzxvk4rwfu3tqsctdp5x9vute67j9ufj",
"kava19rjk5qmmwywnzfccwzyn02jywgpwjqf60afj92",
"kava1xd39avn2f008jmvua0eupg39zsp2xn3wf802vn",
"kava1pt6q4kdmwawr3thm9cd82pq7hml8u84rd0f3jy",
"kava13tpwqygswyzupqfggfgh9dmtgthgucn5wpfksh"
],
"active": true
},
{
"market_id": "usdx:usd",
"base_asset": "usdx",
"quote_asset": "usd",
"oracles": [
"kava12dyshua9nkvx9w8ywp72wdnzrc4t4mnnycz0dl",
"kava1tuxyepdrkwraa22k99w04c0wa64tgh70mv87fs",
"kava1ueak7nzesm3pnev6lngp6lgk0ry02djz8pjpcg",
"kava1sl62nqm89c780yxm3m9lp3tacmpnfljq6tytvl",
"kava1ujfrlcd0ted58mzplnyxzklsw0sqevlgxndanp",
"kava17fatl3wzxvk4rwfu3tqsctdp5x9vute67j9ufj",
"kava19rjk5qmmwywnzfccwzyn02jywgpwjqf60afj92",
"kava1xd39avn2f008jmvua0eupg39zsp2xn3wf802vn",
"kava1pt6q4kdmwawr3thm9cd82pq7hml8u84rd0f3jy",
"kava13tpwqygswyzupqfggfgh9dmtgthgucn5wpfksh"
],
"active": true
},
{
"market_id": "usdx:usd:30",
"base_asset": "usdx",
"quote_asset": "usd",
"oracles": [
"kava12dyshua9nkvx9w8ywp72wdnzrc4t4mnnycz0dl",
"kava1tuxyepdrkwraa22k99w04c0wa64tgh70mv87fs",
"kava1ueak7nzesm3pnev6lngp6lgk0ry02djz8pjpcg",
"kava1sl62nqm89c780yxm3m9lp3tacmpnfljq6tytvl",
"kava1ujfrlcd0ted58mzplnyxzklsw0sqevlgxndanp",
"kava17fatl3wzxvk4rwfu3tqsctdp5x9vute67j9ufj",
"kava19rjk5qmmwywnzfccwzyn02jywgpwjqf60afj92",
"kava1xd39avn2f008jmvua0eupg39zsp2xn3wf802vn",
"kava1pt6q4kdmwawr3thm9cd82pq7hml8u84rd0f3jy",
"kava13tpwqygswyzupqfggfgh9dmtgthgucn5wpfksh"
],
"active": true
},
{
"market_id": "usdx:usd:720",
"base_asset": "usdx",
"quote_asset": "usd",
"oracles": [
"kava12dyshua9nkvx9w8ywp72wdnzrc4t4mnnycz0dl",
"kava1tuxyepdrkwraa22k99w04c0wa64tgh70mv87fs",
"kava1ueak7nzesm3pnev6lngp6lgk0ry02djz8pjpcg",
"kava1sl62nqm89c780yxm3m9lp3tacmpnfljq6tytvl",
"kava1ujfrlcd0ted58mzplnyxzklsw0sqevlgxndanp",
"kava17fatl3wzxvk4rwfu3tqsctdp5x9vute67j9ufj",
"kava19rjk5qmmwywnzfccwzyn02jywgpwjqf60afj92",
"kava1xd39avn2f008jmvua0eupg39zsp2xn3wf802vn",
"kava1pt6q4kdmwawr3thm9cd82pq7hml8u84rd0f3jy",
"kava13tpwqygswyzupqfggfgh9dmtgthgucn5wpfksh"
],
"active": true
},
{
"market_id": "swp:usd",
"base_asset": "swp",
"quote_asset": "usd",
"oracles": [
"kava12dyshua9nkvx9w8ywp72wdnzrc4t4mnnycz0dl",
"kava1tuxyepdrkwraa22k99w04c0wa64tgh70mv87fs",
"kava1ueak7nzesm3pnev6lngp6lgk0ry02djz8pjpcg",
"kava1sl62nqm89c780yxm3m9lp3tacmpnfljq6tytvl",
"kava1ujfrlcd0ted58mzplnyxzklsw0sqevlgxndanp",
"kava17fatl3wzxvk4rwfu3tqsctdp5x9vute67j9ufj",
"kava19rjk5qmmwywnzfccwzyn02jywgpwjqf60afj92",
"kava1xd39avn2f008jmvua0eupg39zsp2xn3wf802vn",
"kava1pt6q4kdmwawr3thm9cd82pq7hml8u84rd0f3jy",
"kava13tpwqygswyzupqfggfgh9dmtgthgucn5wpfksh"
],
"active": true
},
{
"market_id": "swp:usd:30",
"base_asset": "swp",
"quote_asset": "usd",
"oracles": [
"kava12dyshua9nkvx9w8ywp72wdnzrc4t4mnnycz0dl",
"kava1tuxyepdrkwraa22k99w04c0wa64tgh70mv87fs",
"kava1ueak7nzesm3pnev6lngp6lgk0ry02djz8pjpcg",
"kava1sl62nqm89c780yxm3m9lp3tacmpnfljq6tytvl",
"kava1ujfrlcd0ted58mzplnyxzklsw0sqevlgxndanp",
"kava17fatl3wzxvk4rwfu3tqsctdp5x9vute67j9ufj",
"kava19rjk5qmmwywnzfccwzyn02jywgpwjqf60afj92",
"kava1xd39avn2f008jmvua0eupg39zsp2xn3wf802vn",
"kava1pt6q4kdmwawr3thm9cd82pq7hml8u84rd0f3jy",
"kava13tpwqygswyzupqfggfgh9dmtgthgucn5wpfksh"
],
"active": true
}
]
}
}

View File

@ -1,780 +0,0 @@
{
"next_proposal_id": "1",
"committees": [
{
"@type": "/kava.committee.v1beta1.MemberCommittee",
"base_committee": {
"id": "1",
"description": "Kava Stability Committee",
"members": ["kava1n96qpdfcz2m7y364ewk8srv9zuq6ucwduyjaag"],
"permissions": [
{
"@type": "/kava.committee.v1beta1.ParamsChangePermission",
"allowed_params_changes": [
{
"subspace": "auction",
"key": "BidDuration",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "auction",
"key": "IncrementSurplus",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "auction",
"key": "IncrementDebt",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "auction",
"key": "IncrementCollateral",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "cdp",
"key": "GlobalDebtLimit",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "cdp",
"key": "SurplusThreshold",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "cdp",
"key": "SurplusLot",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "cdp",
"key": "DebtThreshold",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "cdp",
"key": "DebtLot",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "cdp",
"key": "DistributionFrequency",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "incentive",
"key": "Active",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "kavadist",
"key": "Active",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "hard",
"key": "MinimumBorrowUSDValue",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "cdp",
"key": "CollateralParams",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": [
{
"key": "type",
"val": "bnb-a",
"allowed_subparam_attr_changes": [
"auction_size",
"check_collateralization_index_count",
"debt_limit",
"keeper_reward_percentage",
"stability_fee"
]
},
{
"key": "type",
"val": "busd-a",
"allowed_subparam_attr_changes": [
"auction_size",
"check_collateralization_index_count",
"debt_limit",
"keeper_reward_percentage",
"stability_fee"
]
},
{
"key": "type",
"val": "busd-b",
"allowed_subparam_attr_changes": [
"auction_size",
"check_collateralization_index_count",
"debt_limit",
"keeper_reward_percentage",
"stability_fee"
]
},
{
"key": "type",
"val": "btcb-a",
"allowed_subparam_attr_changes": [
"auction_size",
"check_collateralization_index_count",
"debt_limit",
"keeper_reward_percentage",
"stability_fee"
]
},
{
"key": "type",
"val": "xrpb-a",
"allowed_subparam_attr_changes": [
"auction_size",
"check_collateralization_index_count",
"debt_limit",
"keeper_reward_percentage",
"stability_fee"
]
},
{
"key": "type",
"val": "ukava-a",
"allowed_subparam_attr_changes": [
"auction_size",
"check_collateralization_index_count",
"debt_limit",
"keeper_reward_percentage",
"stability_fee"
]
},
{
"key": "type",
"val": "hard-a",
"allowed_subparam_attr_changes": [
"auction_size",
"check_collateralization_index_count",
"debt_limit",
"keeper_reward_percentage",
"stability_fee"
]
},
{
"key": "type",
"val": "hbtc-a",
"allowed_subparam_attr_changes": [
"auction_size",
"check_collateralization_index_count",
"debt_limit",
"keeper_reward_percentage",
"stability_fee"
]
},
{
"key": "type",
"val": "swp-a",
"allowed_subparam_attr_changes": [
"auction_size",
"check_collateralization_index_count",
"debt_limit",
"keeper_reward_percentage",
"stability_fee"
]
}
]
},
{
"subspace": "cdp",
"key": "DebtParam",
"single_subparam_allowed_attrs": ["debt_floor"],
"multi_subparams_requirements": []
},
{
"subspace": "bep3",
"key": "AssetParams",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": [
{
"key": "denom",
"val": "bnb",
"allowed_subparam_attr_changes": [
"active",
"limit",
"max_swap_amount",
"min_block_lock"
]
},
{
"key": "denom",
"val": "busd",
"allowed_subparam_attr_changes": [
"active",
"coin_id",
"limit",
"max_swap_amount",
"min_block_lock"
]
},
{
"key": "denom",
"val": "btcb",
"allowed_subparam_attr_changes": [
"active",
"limit",
"max_swap_amount",
"min_block_lock"
]
},
{
"key": "denom",
"val": "xrpb",
"allowed_subparam_attr_changes": [
"active",
"limit",
"max_swap_amount",
"min_block_lock"
]
}
]
},
{
"subspace": "pricefeed",
"key": "Markets",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": [
{
"key": "market_id",
"val": "bnb:usd",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "bnb:usd:30",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "btc:usd",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "btc:usd:30",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "xrp:usd",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "xrp:usd:30",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "busd:usd",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "busd:usd:30",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "kava:usd",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "kava:usd:30",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "hard:usd",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "hard:usd:30",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "usdx:usd",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "usdx:usd:30",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "usdx:usd:720",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "swp:usd",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "swp:usd:30",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "atom:usd",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "atom:usd:30",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "akt:usd",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "akt:usd:30",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "luna:usd",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "luna:usd:30",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "osmo:usd",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "osmo:usd:30",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "ust:usd",
"allowed_subparam_attr_changes": ["active"]
},
{
"key": "market_id",
"val": "ust:usd:30",
"allowed_subparam_attr_changes": ["active"]
}
]
},
{
"subspace": "hard",
"key": "MoneyMarkets",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": [
{
"key": "denom",
"val": "bnb",
"allowed_subparam_attr_changes": [
"borrow_limit",
"interest_rate_model",
"keeper_reward_percentage",
"reserve_factor"
]
},
{
"key": "denom",
"val": "busd",
"allowed_subparam_attr_changes": [
"borrow_limit",
"interest_rate_model",
"keeper_reward_percentage",
"reserve_factor"
]
},
{
"key": "denom",
"val": "btcb",
"allowed_subparam_attr_changes": [
"borrow_limit",
"interest_rate_model",
"keeper_reward_percentage",
"reserve_factor"
]
},
{
"key": "denom",
"val": "xrpb",
"allowed_subparam_attr_changes": [
"borrow_limit",
"interest_rate_model",
"keeper_reward_percentage",
"reserve_factor"
]
},
{
"key": "denom",
"val": "usdx",
"allowed_subparam_attr_changes": [
"borrow_limit",
"interest_rate_model",
"keeper_reward_percentage",
"reserve_factor"
]
},
{
"key": "denom",
"val": "ukava",
"allowed_subparam_attr_changes": [
"borrow_limit",
"interest_rate_model",
"keeper_reward_percentage",
"reserve_factor"
]
},
{
"key": "denom",
"val": "hard",
"allowed_subparam_attr_changes": [
"borrow_limit",
"interest_rate_model",
"keeper_reward_percentage",
"reserve_factor"
]
},
{
"key": "denom",
"val": "swp",
"allowed_subparam_attr_changes": [
"borrow_limit",
"interest_rate_model",
"keeper_reward_percentage",
"reserve_factor"
]
},
{
"key": "denom",
"val": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2",
"allowed_subparam_attr_changes": [
"borrow_limit",
"interest_rate_model",
"keeper_reward_percentage",
"reserve_factor"
]
}
]
}
]
},
{ "@type": "/kava.committee.v1beta1.TextPermission" }
],
"vote_threshold": "0.500000000000000000",
"proposal_duration": "600s",
"tally_option": "TALLY_OPTION_FIRST_PAST_THE_POST"
}
},
{
"@type": "/kava.committee.v1beta1.MemberCommittee",
"base_committee": {
"id": "2",
"description": "Kava Safety Committee",
"members": ["kava1n96qpdfcz2m7y364ewk8srv9zuq6ucwduyjaag"],
"permissions": [
{ "@type": "/kava.committee.v1beta1.SoftwareUpgradePermission" }
],
"vote_threshold": "0.500000000000000000",
"proposal_duration": "604800s",
"tally_option": "TALLY_OPTION_FIRST_PAST_THE_POST"
}
},
{
"@type": "/kava.committee.v1beta1.TokenCommittee",
"base_committee": {
"id": "3",
"description": "Hard Governance Committee",
"members": ["kava1n96qpdfcz2m7y364ewk8srv9zuq6ucwduyjaag"],
"permissions": [
{
"@type": "/kava.committee.v1beta1.ParamsChangePermission",
"allowed_params_changes": [
{
"subspace": "hard",
"key": "MinimumBorrowUSDValue",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "incentive",
"key": "HardSupplyRewardPeriods",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "incentive",
"key": "HardBorrowRewardPeriods",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "incentive",
"key": "HardDelegatorRewardPeriods",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "hard",
"key": "MoneyMarkets",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": [
{
"key": "denom",
"val": "bnb",
"allowed_subparam_attr_changes": [
"borrow_limit",
"interest_rate_model",
"keeper_reward_percentage",
"reserve_factor",
"spot_market_id"
]
},
{
"key": "denom",
"val": "busd",
"allowed_subparam_attr_changes": [
"borrow_limit",
"interest_rate_model",
"keeper_reward_percentage",
"reserve_factor",
"spot_market_id"
]
},
{
"key": "denom",
"val": "btcb",
"allowed_subparam_attr_changes": [
"borrow_limit",
"interest_rate_model",
"keeper_reward_percentage",
"reserve_factor",
"spot_market_id"
]
},
{
"key": "denom",
"val": "xrpb",
"allowed_subparam_attr_changes": [
"borrow_limit",
"interest_rate_model",
"keeper_reward_percentage",
"reserve_factor",
"spot_market_id"
]
},
{
"key": "denom",
"val": "usdx",
"allowed_subparam_attr_changes": [
"borrow_limit",
"interest_rate_model",
"keeper_reward_percentage",
"reserve_factor",
"spot_market_id"
]
},
{
"key": "denom",
"val": "ukava",
"allowed_subparam_attr_changes": [
"borrow_limit",
"interest_rate_model",
"keeper_reward_percentage",
"reserve_factor",
"spot_market_id"
]
},
{
"key": "denom",
"val": "hard",
"allowed_subparam_attr_changes": [
"borrow_limit",
"interest_rate_model",
"keeper_reward_percentage",
"reserve_factor",
"spot_market_id"
]
},
{
"key": "denom",
"val": "swp",
"allowed_subparam_attr_changes": [
"borrow_limit",
"interest_rate_model",
"keeper_reward_percentage",
"reserve_factor",
"spot_market_id"
]
},
{
"key": "denom",
"val": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2",
"allowed_subparam_attr_changes": [
"borrow_limit",
"interest_rate_model",
"keeper_reward_percentage",
"reserve_factor",
"spot_market_id"
]
}
]
}
]
}
],
"vote_threshold": "0.500000000000000000",
"proposal_duration": "600s",
"tally_option": "TALLY_OPTION_DEADLINE"
},
"quorum": "0.330000000000000000",
"tally_denom": "hard"
},
{
"@type": "/kava.committee.v1beta1.TokenCommittee",
"base_committee": {
"id": "4",
"description": "Swp Governance Committee",
"members": ["kava1n96qpdfcz2m7y364ewk8srv9zuq6ucwduyjaag"],
"permissions": [
{
"@type": "/kava.committee.v1beta1.ParamsChangePermission",
"allowed_params_changes": [
{
"subspace": "swap",
"key": "AllowedPools",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "swap",
"key": "SwapFee",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "incentive",
"key": "HardDelegatorRewardPeriods",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
},
{
"subspace": "incentive",
"key": "SwapRewardPeriods",
"single_subparam_allowed_attrs": [],
"multi_subparams_requirements": []
}
]
}
],
"vote_threshold": "0.500000000000000000",
"proposal_duration": "600s",
"tally_option": "TALLY_OPTION_DEADLINE"
},
"quorum": "0.330000000000000000",
"tally_denom": "swp"
},
{
"@type": "/kava.committee.v1beta1.MemberCommittee",
"base_committee": {
"id": "5",
"description": "Kava God Committee (testing only)",
"members": ["kava1n96qpdfcz2m7y364ewk8srv9zuq6ucwduyjaag"],
"permissions": [{ "@type": "/kava.committee.v1beta1.GodPermission" }],
"vote_threshold": "0.500000000000000000",
"proposal_duration": "604800s",
"tally_option": "TALLY_OPTION_FIRST_PAST_THE_POST"
}
}
],
"proposals": [
{
"content": {
"@type": "/kava.kavadist.v1beta1.CommunityPoolMultiSpendProposal",
"title": "Test",
"description": "Test",
"recipient_list": [
{
"address": "kava1ze7y9qwdddejmy7jlw4cymqqlt2wh05yhwmrv2",
"amount": [{ "denom": "ukava", "amount": "10" }]
}
]
},
"id": "1",
"committee_id": "2",
"deadline": "2021-11-24T18:48:08.693415Z"
},
{
"content": {
"@type": "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal",
"title": "Community Pool Spend",
"description": "Fund the community pool.",
"recipient": "kava1ze7y9qwdddejmy7jlw4cymqqlt2wh05yhwmrv2",
"amount": [{ "denom": "ukava", "amount": "10" }]
},
"id": "1",
"committee_id": "2",
"deadline": "2021-11-24T18:49:44.219341Z"
},
{
"content": {
"@type": "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal",
"title": "Test",
"description": "Test",
"plan": {
"name": "Test",
"time": "0001-01-01T00:00:00Z",
"height": "100",
"info": "",
"upgraded_client_state": null
}
},
"id": "1",
"committee_id": "2",
"deadline": "2021-11-24T18:49:44.219693Z"
}
],
"votes": [
{
"proposal_id": "1",
"voter": "kava1ze7y9qwdddejmy7jlw4cymqqlt2wh05yhwmrv2",
"vote_type": "VOTE_TYPE_YES"
},
{
"proposal_id": "1",
"voter": "kava1ze7y9qwdddejmy7jlw4cymqqlt2wh05yhwmrv2",
"vote_type": "VOTE_TYPE_ABSTAIN"
}
]
}