-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add bounty module --------- Co-authored-by: yoongbok lee <[email protected]> Co-authored-by: Xiuming Dou <[email protected]> Co-authored-by: yuhonghai <[email protected]> Co-authored-by: Xu Yang <[email protected]> Co-authored-by: haozhan9 <[email protected]> Co-authored-by: 0311xuyang <[email protected]>
- Loading branch information
1 parent
11baca2
commit 9a881da
Showing
60 changed files
with
17,528 additions
and
673 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
syntax = "proto3"; | ||
package shentu.bounty.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
import "google/protobuf/any.proto"; | ||
|
||
option go_package = "github.com/shentufoundation/shentu/x/bounty/types"; | ||
|
||
message Program { | ||
option (gogoproto.equal) = false; | ||
option (gogoproto.goproto_getters) = false; | ||
|
||
string program_id = 1 [(gogoproto.moretags) = "yaml:\"program_id\""]; | ||
string name = 2 [(gogoproto.moretags) = "yaml:\"name\""]; | ||
// JSON by ProgramDetail | ||
string detail = 3 [(gogoproto.moretags) = "yaml:\"detail\""]; | ||
string admin_address = 4 [(gogoproto.moretags) = "yaml:\"admin_address\""]; | ||
ProgramStatus status = 5 [(gogoproto.moretags) = "yaml:\"status\""]; | ||
google.protobuf.Timestamp create_time = 6 | ||
[(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"create_time\""]; | ||
} | ||
|
||
message Finding { | ||
option (gogoproto.equal) = false; | ||
option (gogoproto.goproto_getters) = false; | ||
|
||
string program_id = 1 [(gogoproto.moretags) = "yaml:\"program_id\""]; | ||
string finding_id = 2 [(gogoproto.moretags) = "yaml:\"finding_id\""]; | ||
string title = 3; | ||
string description = 4 [(gogoproto.moretags) = "yaml:\"description\""]; | ||
string proof_of_concept = 5 [(gogoproto.moretags) = "yaml:\"proof_of_concept\""]; | ||
// hash(description + proof_of_concept + submitter) | ||
string finding_hash = 6 [(gogoproto.moretags) = "yaml:\"finding_hash\""]; | ||
string submitter_address = 7 [(gogoproto.moretags) = "yaml:\"submitter_address\""]; | ||
SeverityLevel severity_level = 8 [(gogoproto.moretags) = "yaml:\"severity_level\""]; | ||
FindingStatus status = 9 [(gogoproto.moretags) = "yaml:\"status\""]; | ||
// JSON by FindingDetail | ||
string detail = 10 [(gogoproto.moretags) = "yaml:\"detail\""]; | ||
string payment_hash = 11 [(gogoproto.moretags) = "yaml:\"payment_hash\""]; | ||
google.protobuf.Timestamp create_time = 12 | ||
[(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"create_time\""]; | ||
} | ||
|
||
message ProgramFingerprint { | ||
option (gogoproto.equal) = false; | ||
option (gogoproto.goproto_getters) = false; | ||
|
||
string program_id = 1 [(gogoproto.jsontag) = "id", (gogoproto.moretags) = "yaml:\"id\""]; | ||
string name = 2 [(gogoproto.moretags) = "yaml:\"name\""]; | ||
// JSON by ProgramDetail | ||
string detail = 3 [(gogoproto.moretags) = "yaml:\"detail\""]; | ||
string admin_address = 4 [(gogoproto.moretags) = "yaml:\"admin_address\""]; | ||
ProgramStatus status = 5 [(gogoproto.moretags) = "yaml:\"status\""]; | ||
} | ||
|
||
message FindingFingerprint { | ||
option (gogoproto.equal) = false; | ||
option (gogoproto.goproto_getters) = false; | ||
|
||
string program_id = 1 [(gogoproto.moretags) = "yaml:\"program_id\""]; | ||
string finding_id = 2 [(gogoproto.jsontag) = "id", (gogoproto.moretags) = "yaml:\"id\""]; | ||
string title = 3; | ||
// hash(description + proof_of_concept + submitter) | ||
string finding_hash = 4 [(gogoproto.moretags) = "yaml:\"finding_hash\""]; | ||
SeverityLevel severity_level = 5 [(gogoproto.moretags) = "yaml:\"severity_level\""]; | ||
FindingStatus status = 6 [(gogoproto.moretags) = "yaml:\"status\""]; | ||
// JSON by FindingDetail | ||
string detail = 7 [(gogoproto.moretags) = "yaml:\"detail\""]; | ||
string payment_hash = 8 [(gogoproto.moretags) = "yaml:\"payment_hash\""]; | ||
} | ||
|
||
enum ProgramStatus { | ||
option (gogoproto.goproto_enum_prefix) = false; | ||
|
||
PROGRAM_STATUS_INACTIVE = 0 [(gogoproto.enumvalue_customname) = "ProgramStatusInactive"]; | ||
PROGRAM_STATUS_ACTIVE = 1 [(gogoproto.enumvalue_customname) = "ProgramStatusActive"]; | ||
PROGRAM_STATUS_CLOSED = 2 [(gogoproto.enumvalue_customname) = "ProgramStatusClosed"]; | ||
} | ||
|
||
enum SeverityLevel { | ||
option (gogoproto.goproto_enum_prefix) = false; | ||
|
||
SEVERITY_LEVEL_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "Unspecified"]; | ||
SEVERITY_LEVEL_CRITICAL = 1 [(gogoproto.enumvalue_customname) = "Critical"]; | ||
SEVERITY_LEVEL_HIGH = 2 [(gogoproto.enumvalue_customname) = "High"]; | ||
SEVERITY_LEVEL_MEDIUM = 3 [(gogoproto.enumvalue_customname) = "Medium"]; | ||
SEVERITY_LEVEL_LOW = 4 [(gogoproto.enumvalue_customname) = "Low"]; | ||
SEVERITY_LEVEL_INFORMATIONAL = 5 [(gogoproto.enumvalue_customname) = "Informational"]; | ||
} | ||
|
||
enum FindingStatus { | ||
option (gogoproto.goproto_enum_prefix) = false; | ||
|
||
FINDING_STATUS_SUBMITTED = 0 [(gogoproto.enumvalue_customname) = "FindingStatusSubmitted"]; | ||
FINDING_STATUS_ACTIVE = 1 [(gogoproto.enumvalue_customname) = "FindingStatusActive"]; | ||
FINDING_STATUS_CONFIRMED = 2 [(gogoproto.enumvalue_customname) = "FindingStatusConfirmed"]; | ||
FINDING_STATUS_PAID = 3 [(gogoproto.enumvalue_customname) = "FindingStatusPaid"]; | ||
FINDING_STATUS_CLOSED = 4 [(gogoproto.enumvalue_customname) = "FindingStatusClosed"]; | ||
} | ||
|
||
//message BountyLevel { | ||
// option (gogoproto.equal) = false; | ||
// option (gogoproto.goproto_getters) = false; | ||
// | ||
// SeverityLevel severity_level = 1 [(gogoproto.moretags) = "yaml:\"severity_level\""]; | ||
// bool poc = 2; | ||
// cosmos.base.v1beta1.Coin min_bounty = 3 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"min_bounty\""]; | ||
// cosmos.base.v1beta1.Coin max_bounty = 4 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"max_bounty\""]; | ||
//} | ||
|
||
//// ProgramDetail defines a program detail. | ||
//type ProgramDetail struct { | ||
// Type string `json:"type"` | ||
// Logo string `json:"logo"` | ||
// Desc string `json:"desc"` | ||
// Targets []string `json:"targets"` | ||
// ScopeRules string `json:"scope_rules"` | ||
// KnownIssues string `json:"known_issues"` | ||
// TotalBounty int `json:"total_bounty"` | ||
// BountyLevels []BountyLevel `json:"bounty_levels"` | ||
// PaymentInfo string `json:"payment_info"` | ||
// PaymentChain string `json:"payment_chain"` | ||
// ProgramSLA []SLAItem `json:"sla"` | ||
//} | ||
|
||
//// FindingDetail defines a finding detail. | ||
//type FindingDetail struct{ | ||
// ProgramTarget []string `json:"program_target"` | ||
// Impacts []string `json:"impacts"` | ||
// Attachments []string `json:"attachments"` | ||
// ReceiverInfo ReceiverInfo `json:"receiver_info"` | ||
// PaidInfo PaidInfo `json:"paid_info"` | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
syntax = "proto3"; | ||
package shentu.bounty.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
|
||
import "shentu/bounty/v1/bounty.proto"; | ||
|
||
option go_package = "github.com/shentufoundation/shentu/x/bounty/types"; | ||
|
||
message GenesisState { | ||
option (gogoproto.equal) = false; | ||
option (gogoproto.goproto_getters) = false; | ||
|
||
repeated Program programs = 1 [(gogoproto.moretags) = "yaml:\"programs\"", (gogoproto.nullable) = false]; | ||
repeated Finding findings = 2 [(gogoproto.moretags) = "yaml:\"findings\"", (gogoproto.nullable) = false]; | ||
} |
Oops, something went wrong.