-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bounty v2 #786
Merged
Bounty v2 #786
Changes from 71 commits
Commits
Show all changes
78 commits
Select commit
Hold shift + click to select a range
efce5cf
first buildable version
7ce1465
add createprogram
7c05b70
add bounty to app
0d7c0bc
modify privkey prints
5c3c8c8
fix file I/O for key storage
ed2eabb
fix dateLayout and run gofmt
xiumingdou 2921860
register interfaces
xiumingdou 6e8859d
fix lint
xiumingdou b22342a
add simulation interfaces
xiumingdou 9570f6e
fix json format issue in ExportGenesis
xiumingdou 0ef24b3
fix comments and imports
xiumingdou 518b7d6
refactor program creation
xiumingdou f171029
compile .proto changes
xiumingdou 415747e
fix refactor
xiumingdou c820996
Revert "compile .proto changes"
xiumingdou bdb483a
recompile .proto files
xiumingdou 77b5e7b
Address review comments
xiumingdou 1343d49
git add the bounty genesis.go
xiumingdou eda4225
Bounty encryption (#565)
kevin-yuhh 625d386
Add bounty module account (#577)
skyargos 6b4f26f
Finding submit (#574)
kevin-yuhh 4b4cbb6
Bounty query for programs and findings (#578)
skyargos 526bca5
Bounty cli help information (#582)
skyargos 7d500bf
Host accept or reject findings (#580)
skyargos e4040d8
encrypt desc and poc before broadcast (#586)
kevin-yuhh b6228ec
Add bounty upgrade (#584)
skyargos 89bcf97
Release finding (#585)
kevin-yuhh c5d0ad0
Bounty program validate (#593)
kevin-yuhh e1a15f7
finding withdrawal (#590)
0311xuyang 7359565
Bounty: fix cli cancel bug (#594)
skyargos 9b506bb
Bounty any parse (#596)
kevin-yuhh c31441d
add publickey verification (#601)
kevin-yuhh 15c935d
[Bounty] terminate a program (#600)
haozhan9 9d7b0b7
add any UnpackInterfaces (#606)
kevin-yuhh bc350ab
Bounty genesis (#579)
kevin-yuhh 3c70341
Add return error in GetNextFindingID and GetNextProgramID (#609)
kevin-yuhh 471f6bb
Bounty tests (#591)
0311xuyang 9c40571
Bounty base64 (#696)
kevin-yuhh ffb9032
merge master (#705)
kevin-yuhh 916f091
Modify program and finding fields
skyargos 7212c8d
Merge branch 'master' into bounty-v2
skyargos 21f5291
Fix conflicts
skyargos 9bb6d5c
Optimize structure
skyargos 39fe306
Fix lint error
skyargos 0ffcd87
Modify desc of program to string type
skyargos 65564a8
Add test case
skyargos 10718a3
Add test case
skyargos da24f66
update go.mod
skyargos cd6dbd3
Fix e2e test
skyargos 6348953
Add test case
skyargos 6923d96
Fix e2e test
skyargos 4d8d086
Fix e2e test
skyargos 8d9af12
Fix program e2e test
skyargos 9e94af0
Fix release finding
skyargos 7446fad
Add bounty admin
skyargos fe1f7ae
fix lint error
skyargos bf820a4
fix test error
skyargos e493a5f
fix e2e test
skyargos 796581c
add confirm finding paid
skyargos 6386e69
fix test error
skyargos 57f3aa1
fix test error
skyargos afc9836
fix test error
skyargos f5f0c0e
add fingerprint
skyargos 4dd7fa2
fix lint error
skyargos d894da8
add msg check
skyargos e24a7ff
add test case
skyargos 3a7e395
add confirmFindingPaid cmd
skyargos e2c53fb
fix lint error
skyargos cfc9ddf
add a GRPC for program fingerprint
skyargos 432822e
add cmd cli for query
skyargos 98c79b3
add activate finding
skyargos a39b82e
fix review comment
skyargos 2d798fe
Merge branch 'master' into bounty-v2
skyargos c21c0e3
fix lint error
skyargos 788a638
delete coverage.txt
skyargos a49b885
fix cli information
skyargos 71c27dd
change name from release to publish
skyargos 2d9cd27
modify some error messages
skyargos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 { | ||
skyargos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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\""]; | ||
} | ||
skyargos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to remove this file and the upgrade_handler.go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current branch is merged with master.
and then a new path is submitted for upgrade and the old files are deleted.