github.com/Finschia/finschia-sdk@v0.48.1/proto/lbm/foundation/v1/foundation.proto (about)

     1  syntax = "proto3";
     2  package lbm.foundation.v1;
     3  
     4  option go_package            = "github.com/Finschia/finschia-sdk/x/foundation";
     5  option (gogoproto.equal_all) = true;
     6  
     7  import "gogoproto/gogo.proto";
     8  import "google/protobuf/duration.proto";
     9  import "google/protobuf/timestamp.proto";
    10  import "google/protobuf/any.proto";
    11  import "cosmos/base/v1beta1/coin.proto";
    12  import "cosmos_proto/cosmos.proto";
    13  
    14  // Params defines the parameters for the foundation module.
    15  message Params {
    16    string foundation_tax = 1
    17        [(gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Dec", (gogoproto.nullable) = false];
    18    reserved 2; // previously used tag number for 'censored_msg_type_urls'.
    19  }
    20  
    21  message Censorship {
    22    string              msg_type_url = 1;
    23    CensorshipAuthority authority    = 2;
    24  }
    25  
    26  enum CensorshipAuthority {
    27    option (gogoproto.goproto_enum_prefix) = false;
    28  
    29    // CENSORSHIP_AUTHORITY_UNSPECIFIED defines an invalid authority.
    30    CENSORSHIP_AUTHORITY_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "CensorshipAuthorityUnspecified"];
    31    // CENSORSHIP_AUTHORITY_GOVERNANCE defines x/gov authority.
    32    CENSORSHIP_AUTHORITY_GOVERNANCE = 1 [(gogoproto.enumvalue_customname) = "CensorshipAuthorityGovernance"];
    33    // CENSORSHIP_AUTHORITY_FOUNDATION defines x/foundation authority.
    34    CENSORSHIP_AUTHORITY_FOUNDATION = 2 [(gogoproto.enumvalue_customname) = "CensorshipAuthorityFoundation"];
    35  }
    36  
    37  // Member represents a foundation member with an account address and metadata.
    38  message Member {
    39    // address is the member's account address.
    40    string address = 1;
    41  
    42    // metadata is any arbitrary metadata to attached to the member.
    43    string metadata = 2;
    44  
    45    // added_at is a timestamp specifying when a member was added.
    46    google.protobuf.Timestamp added_at = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
    47  }
    48  
    49  // MemberRequest represents a foundation member to be used in Msg server requests.
    50  // Contrary to `Member`, it doesn't have any `added_at` field
    51  // since this field cannot be set as part of requests.
    52  message MemberRequest {
    53    // address is the member's account address.
    54    string address = 1;
    55  
    56    // remove is the flag which allows one to remove the member by setting the flag to true.
    57    bool remove = 2;
    58  
    59    // metadata is any arbitrary metadata attached to the member.
    60    string metadata = 3;
    61  }
    62  
    63  // ThresholdDecisionPolicy is a decision policy where a proposal passes when it
    64  // satisfies the two following conditions:
    65  // 1. The sum of all `YES` voters' weights is greater or equal than the defined
    66  //    `threshold`.
    67  // 2. The voting and execution periods of the proposal respect the parameters
    68  //    given by `windows`.
    69  message ThresholdDecisionPolicy {
    70    option (cosmos_proto.implements_interface) = "DecisionPolicy";
    71  
    72    // threshold is the minimum sum of yes votes that must be met or exceeded for a proposal to succeed.
    73    string threshold = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Dec"];
    74  
    75    // windows defines the different windows for voting and execution.
    76    DecisionPolicyWindows windows = 2;
    77  }
    78  
    79  // PercentageDecisionPolicy is a decision policy where a proposal passes when
    80  // it satisfies the two following conditions:
    81  // 1. The percentage of all `YES` voters' weights out of the total group weight
    82  //    is greater or equal than the given `percentage`.
    83  // 2. The voting and execution periods of the proposal respect the parameters
    84  //    given by `windows`.
    85  message PercentageDecisionPolicy {
    86    option (cosmos_proto.implements_interface) = "DecisionPolicy";
    87  
    88    // percentage is the minimum percentage the sum of yes votes must meet for a proposal to succeed.
    89    string percentage = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Dec"];
    90  
    91    // windows defines the different windows for voting and execution.
    92    DecisionPolicyWindows windows = 2;
    93  }
    94  
    95  // DecisionPolicyWindows defines the different windows for voting and execution.
    96  message DecisionPolicyWindows {
    97    // voting_period is the duration from submission of a proposal to the end of voting period
    98    // Within this times votes can be submitted with MsgVote.
    99    google.protobuf.Duration voting_period = 1 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false];
   100  
   101    // min_execution_period is the minimum duration after the proposal submission
   102    // where members can start sending MsgExec. This means that the window for
   103    // sending a MsgExec transaction is:
   104    // `[ submission + min_execution_period ; submission + voting_period + max_execution_period]`
   105    // where max_execution_period is a app-specific config, defined in the keeper.
   106    // If not set, min_execution_period will default to 0.
   107    //
   108    // Please make sure to set a `min_execution_period` that is smaller than
   109    // `voting_period + max_execution_period`, or else the above execution window
   110    // is empty, meaning that all proposals created with this decision policy
   111    // won't be able to be executed.
   112    google.protobuf.Duration min_execution_period = 2 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false];
   113  }
   114  
   115  // OutsourcingDecisionPolicy is a dummy decision policy which is set after
   116  // the proposal feature has been outsourced to x/group.
   117  message OutsourcingDecisionPolicy {
   118    option (cosmos_proto.implements_interface) = "DecisionPolicy";
   119  
   120    string description = 1;
   121  }
   122  
   123  // VoteOption enumerates the valid vote options for a given proposal.
   124  enum VoteOption {
   125    option (gogoproto.goproto_enum_prefix) = false;
   126  
   127    // VOTE_OPTION_UNSPECIFIED defines a no-op vote option.
   128    VOTE_OPTION_UNSPECIFIED = 0;
   129    // VOTE_OPTION_YES defines a yes vote option.
   130    VOTE_OPTION_YES = 1;
   131    // VOTE_OPTION_ABSTAIN defines an abstain vote option.
   132    VOTE_OPTION_ABSTAIN = 2;
   133    // VOTE_OPTION_NO defines a no vote option.
   134    VOTE_OPTION_NO = 3;
   135    // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option.
   136    VOTE_OPTION_NO_WITH_VETO = 4;
   137  }
   138  
   139  // FoundationInfo represents the high-level on-chain information for the foundation.
   140  message FoundationInfo {
   141    option (gogoproto.goproto_getters) = false;
   142  
   143    // version is used to track changes to the foundation's membership structure that
   144    // would break existing proposals. Whenever any member is added or removed,
   145    // this version is incremented and will cause proposals based on older versions
   146    // of the foundation to fail
   147    uint64 version = 1;
   148  
   149    // total_weight is the number of the foundation members.
   150    string total_weight = 2 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Dec"];
   151  
   152    // decision_policy specifies the foundation's decision policy.
   153    google.protobuf.Any decision_policy = 3 [(cosmos_proto.accepts_interface) = "DecisionPolicy"];
   154  }
   155  
   156  // Proposal defines a foundation proposal. Any member of the foundation can submit a proposal
   157  // for a group policy to decide upon.
   158  // A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal
   159  // passes as well as some optional metadata associated with the proposal.
   160  message Proposal {
   161    option (gogoproto.goproto_getters) = false;
   162  
   163    // id is the unique id of the proposal.
   164    uint64 id = 1;
   165  
   166    // metadata is any arbitrary metadata to attached to the proposal.
   167    string metadata = 2;
   168  
   169    // proposers are the account addresses of the proposers.
   170    repeated string proposers = 3;
   171  
   172    // submit_time is a timestamp specifying when a proposal was submitted.
   173    google.protobuf.Timestamp submit_time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
   174  
   175    // foundation_version tracks the version of the foundation that this proposal corresponds to.
   176    // When foundation info is changed, existing proposals from previous foundation versions will become invalid.
   177    uint64 foundation_version = 5;
   178  
   179    // status represents the high level position in the life cycle of the proposal. Initial value is Submitted.
   180    ProposalStatus status = 6;
   181  
   182    // final_tally_result contains the sums of all votes for this
   183    // proposal for each vote option, after tallying. When querying a proposal
   184    // via gRPC, this field is not populated until the proposal's voting period
   185    // has ended.
   186    TallyResult final_tally_result = 7 [(gogoproto.nullable) = false];
   187  
   188    // voting_period_end is the timestamp before which voting must be done.
   189    // Unless a successfull MsgExec is called before (to execute a proposal whose
   190    // tally is successful before the voting period ends), tallying will be done
   191    // at this point, and the `final_tally_result`, as well
   192    // as `status` and `result` fields will be accordingly updated.
   193    google.protobuf.Timestamp voting_period_end = 8 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
   194  
   195    // executor_result is the final result based on the votes and election rule. Initial value is NotRun.
   196    ProposalExecutorResult executor_result = 9;
   197  
   198    // messages is a list of Msgs that will be executed if the proposal passes.
   199    repeated google.protobuf.Any messages = 10;
   200  }
   201  
   202  // ProposalStatus defines proposal statuses.
   203  enum ProposalStatus {
   204    option (gogoproto.goproto_enum_prefix) = false;
   205  
   206    // An empty value is invalid and not allowed.
   207    PROPOSAL_STATUS_UNSPECIFIED = 0;
   208  
   209    // Initial status of a proposal when submitted.
   210    PROPOSAL_STATUS_SUBMITTED = 1;
   211  
   212    // Final status of a proposal when the final tally is done and the outcome
   213    // passes the foundation's decision policy.
   214    PROPOSAL_STATUS_ACCEPTED = 2;
   215  
   216    // Final status of a proposal when the final tally is done and the outcome
   217    // is rejected by the foundation's decision policy.
   218    PROPOSAL_STATUS_REJECTED = 3;
   219  
   220    // Final status of a proposal when the decision policy is modified before the
   221    // final tally.
   222    PROPOSAL_STATUS_ABORTED = 4;
   223  
   224    // A proposal can be withdrawn before the voting start time by the owner.
   225    // When this happens the final status is Withdrawn.
   226    PROPOSAL_STATUS_WITHDRAWN = 5;
   227  }
   228  
   229  // ProposalExecutorResult defines types of proposal executor results.
   230  enum ProposalExecutorResult {
   231    option (gogoproto.goproto_enum_prefix) = false;
   232  
   233    // An empty value is not allowed.
   234    PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED = 0;
   235  
   236    // We have not yet run the executor.
   237    PROPOSAL_EXECUTOR_RESULT_NOT_RUN = 1;
   238  
   239    // The executor was successful and proposed action updated state.
   240    PROPOSAL_EXECUTOR_RESULT_SUCCESS = 2;
   241  
   242    // The executor returned an error and proposed action didn't update state.
   243    PROPOSAL_EXECUTOR_RESULT_FAILURE = 3;
   244  }
   245  
   246  // TallyResult represents the sum of votes for each vote option.
   247  message TallyResult {
   248    option (gogoproto.goproto_getters) = false;
   249  
   250    // yes_count is the sum of yes votes.
   251    string yes_count = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Dec"];
   252  
   253    // abstain_count is the sum of abstainers.
   254    string abstain_count = 2 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Dec"];
   255  
   256    // no is the sum of no votes.
   257    string no_count = 3 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Dec"];
   258  
   259    // no_with_veto_count is the sum of veto.
   260    string no_with_veto_count = 4
   261        [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Dec"];
   262  }
   263  
   264  // Vote represents a vote for a proposal.
   265  message Vote {
   266    // proposal is the unique ID of the proposal.
   267    uint64 proposal_id = 1;
   268  
   269    // voter is the account address of the voter.
   270    string voter = 2;
   271  
   272    // option is the voter's choice on the proposal.
   273    VoteOption option = 3;
   274  
   275    // metadata is any arbitrary metadata to attached to the vote.
   276    string metadata = 4;
   277  
   278    // submit_time is the timestamp when the vote was submitted.
   279    google.protobuf.Timestamp submit_time = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
   280  }
   281  
   282  // Pool is used for tracking treasury.
   283  message Pool {
   284    repeated cosmos.base.v1beta1.DecCoin treasury = 1
   285        [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/Finschia/finschia-sdk/types.DecCoins"];
   286  }
   287  
   288  // FoundationExecProposal is x/gov proposal to trigger the x/foundation messages on behalf of x/gov.
   289  message FoundationExecProposal {
   290    string title       = 1;
   291    string description = 2;
   292  
   293    // x/foundation messages to execute
   294    // all the signers must be x/gov authority.
   295    repeated google.protobuf.Any messages = 3;
   296  }