Skip to content

Commit 4fc582e

Browse files
committed
add bitsong & create release
1 parent af211da commit 4fc582e

File tree

14 files changed

+626
-0
lines changed

14 files changed

+626
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
syntax = "proto3";
2+
package bitsong.fantoken.v1beta1;
3+
4+
import "gogoproto/gogo.proto";
5+
6+
option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types";
7+
8+
message EventIssue {
9+
string denom = 1;
10+
}
11+
12+
message EventDisableMint {
13+
string denom = 1;
14+
}
15+
16+
message EventMint {
17+
string recipient = 1;
18+
string coin = 2;
19+
}
20+
21+
message EventBurn {
22+
string sender = 1;
23+
string coin = 2;
24+
}
25+
26+
message EventSetAuthority {
27+
string denom = 1;
28+
string old_authority = 2 [ (gogoproto.moretags) = "yaml:\"old_authority\"" ];
29+
string new_authority = 3 [ (gogoproto.moretags) = "yaml:\"new_authority\"" ];
30+
}
31+
32+
message EventSetMinter {
33+
string denom = 1;
34+
string old_minter = 2 [ (gogoproto.moretags) = "yaml:\"old_minter\"" ];
35+
string new_minter = 3 [ (gogoproto.moretags) = "yaml:\"new_minter\"" ];
36+
}
37+
38+
message EventSetUri {
39+
string denom = 1;
40+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
syntax = "proto3";
2+
package bitsong.fantoken.v1beta1;
3+
4+
import "cosmos/base/v1beta1/coin.proto";
5+
import "gogoproto/gogo.proto";
6+
7+
option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types";
8+
option (gogoproto.goproto_getters_all) = false;
9+
10+
message Metadata {
11+
// name defines the name of the fantoken (eg: Kitty Punk)
12+
string name = 1;
13+
14+
// symbol is the token symbol usually shown on exchanges (eg: KITTY)
15+
string symbol = 2;
16+
17+
// URI to a document (on or off-chain) that contains additional
18+
// information.Optional.
19+
string uri = 3 [ (gogoproto.customname) = "URI" ];
20+
21+
// sdk.AccAddress allowed to set a new uri
22+
string authority = 4;
23+
}
24+
25+
// FanToken defines a standard for the fungible token
26+
message FanToken {
27+
option (gogoproto.goproto_getters) = false;
28+
option (gogoproto.goproto_stringer) = false;
29+
30+
// denom represents the string name of the given denom unit (e.g ft<hash>).
31+
string denom = 1;
32+
33+
string max_supply = 2 [
34+
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
35+
(gogoproto.moretags) = "yaml:\"max_supply\"",
36+
(gogoproto.nullable) = false
37+
];
38+
39+
// sdk.AccAddress allowed to mint new fantoken
40+
string minter = 3;
41+
42+
Metadata meta_data = 4 [
43+
(gogoproto.moretags) = "yaml:\"meta_data\"",
44+
(gogoproto.nullable) = false
45+
];
46+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
syntax = "proto3";
2+
package bitsong.fantoken.v1beta1;
3+
4+
import "gogoproto/gogo.proto";
5+
import "bitsong/fantoken/v1beta1/fantoken.proto";
6+
import "bitsong/fantoken/v1beta1/params.proto";
7+
import "cosmos/base/v1beta1/coin.proto";
8+
9+
option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types";
10+
11+
// GenesisState defines the fantoken module's genesis state
12+
message GenesisState {
13+
bitsong.fantoken.v1beta1.Params params = 1 [ (gogoproto.nullable) = false ];
14+
15+
repeated bitsong.fantoken.v1beta1.FanToken fan_tokens = 2
16+
[ (gogoproto.nullable) = false ];
17+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
syntax = "proto3";
2+
package bitsong.fantoken.v1beta1;
3+
4+
import "cosmos/base/v1beta1/coin.proto";
5+
import "gogoproto/gogo.proto";
6+
7+
option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types";
8+
option (gogoproto.goproto_getters_all) = false;
9+
10+
message UpdateFeesProposal {
11+
option (gogoproto.equal) = true;
12+
option (gogoproto.goproto_stringer) = false;
13+
14+
string title = 1;
15+
string description = 2;
16+
17+
cosmos.base.v1beta1.Coin issue_fee = 3 [
18+
(gogoproto.moretags) = "yaml:\"issue_fee\"",
19+
(gogoproto.nullable) = false
20+
];
21+
22+
cosmos.base.v1beta1.Coin mint_fee = 4 [
23+
(gogoproto.moretags) = "yaml:\"mint_fee\"",
24+
(gogoproto.nullable) = false
25+
];
26+
27+
cosmos.base.v1beta1.Coin burn_fee = 5 [
28+
(gogoproto.moretags) = "yaml:\"burn_fee\"",
29+
(gogoproto.nullable) = false
30+
];
31+
}
32+
33+
message UpdateFeesProposalWithDeposit {
34+
option (gogoproto.goproto_stringer) = true;
35+
36+
string title = 1;
37+
string description = 2;
38+
string issue_fee = 3;
39+
string mint_fee = 4;
40+
string burn_fee = 5;
41+
string deposit = 7;
42+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
syntax = "proto3";
2+
package bitsong.fantoken.v1beta1;
3+
4+
import "cosmos/base/v1beta1/coin.proto";
5+
import "gogoproto/gogo.proto";
6+
7+
option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types";
8+
option (gogoproto.goproto_getters_all) = false;
9+
10+
// Params defines fantoken module's parameters
11+
message Params {
12+
option (gogoproto.equal) = true;
13+
option (gogoproto.goproto_stringer) = false;
14+
15+
cosmos.base.v1beta1.Coin issue_fee = 1 [
16+
(gogoproto.moretags) = "yaml:\"issue_fee\"",
17+
(gogoproto.nullable) = false
18+
];
19+
20+
cosmos.base.v1beta1.Coin mint_fee = 2 [
21+
(gogoproto.moretags) = "yaml:\"mint_fee\"",
22+
(gogoproto.nullable) = false
23+
];
24+
25+
cosmos.base.v1beta1.Coin burn_fee = 3 [
26+
(gogoproto.moretags) = "yaml:\"burn_fee\"",
27+
(gogoproto.nullable) = false
28+
];
29+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
syntax = "proto3";
2+
package bitsong.fantoken.v1beta1;
3+
4+
import "cosmos/base/v1beta1/coin.proto";
5+
import "cosmos/base/query/v1beta1/pagination.proto";
6+
import "gogoproto/gogo.proto";
7+
import "google/api/annotations.proto";
8+
import "bitsong/fantoken/v1beta1/fantoken.proto";
9+
import "bitsong/fantoken/v1beta1/params.proto";
10+
11+
option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types";
12+
13+
// Query creates service with fantoken as RPC
14+
service Query {
15+
16+
// FanToken returns fantoken with fantoken name
17+
rpc FanToken(QueryFanTokenRequest) returns (QueryFanTokenResponse) {
18+
option (google.api.http).get = "/bitsong/fantoken/v1beta1/denom/{denom}";
19+
}
20+
21+
// FanTokens returns the fantoken list
22+
rpc FanTokens(QueryFanTokensRequest) returns (QueryFanTokensResponse) {
23+
option (google.api.http).get = "/bitsong/fantoken/v1beta1/fantokens";
24+
}
25+
26+
// Params queries the fantoken parameters
27+
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
28+
option (google.api.http).get = "/bitsong/fantoken/v1beta1/params";
29+
}
30+
}
31+
32+
// QueryFanTokenRequest is request type for the Query/FanToken RPC method
33+
message QueryFanTokenRequest { string denom = 1; }
34+
35+
// QueryFanTokenResponse is response type for the Query/FanToken RPC method
36+
message QueryFanTokenResponse { bitsong.fantoken.v1beta1.FanToken fantoken = 1; }
37+
38+
// QueryFanTokensRequest is request type for the Query/FanTokens RPC method
39+
message QueryFanTokensRequest {
40+
string authority = 1;
41+
// pagination defines an optional pagination for the request.
42+
cosmos.base.query.v1beta1.PageRequest pagination = 2;
43+
}
44+
45+
// QueryFanTokensResponse is response type for the Query/FanTokens RPC method
46+
message QueryFanTokensResponse {
47+
repeated bitsong.fantoken.v1beta1.FanToken fantokens = 1;
48+
cosmos.base.query.v1beta1.PageResponse pagination = 2;
49+
}
50+
51+
// QueryParametersRequest is request type for the Query/Parameters RPC method
52+
message QueryParamsRequest {}
53+
54+
// QueryParametersResponse is response type for the Query/Parameters RPC method
55+
message QueryParamsResponse {
56+
bitsong.fantoken.v1beta1.Params params = 1 [ (gogoproto.nullable) = false ];
57+
}
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
syntax = "proto3";
2+
package bitsong.fantoken;
3+
4+
import "cosmos/base/v1beta1/coin.proto";
5+
import "gogoproto/gogo.proto";
6+
7+
option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types";
8+
option (gogoproto.goproto_getters_all) = false;
9+
10+
// Msg defines the oracle Msg service
11+
service Msg {
12+
// Issue defines a method for issuing a new fan token
13+
rpc Issue(MsgIssue) returns (MsgIssueResponse);
14+
15+
// Mint defines a method for minting some fan tokens
16+
rpc Mint(MsgMint) returns (MsgMintResponse);
17+
18+
// Burn defines a method for burning some fan tokens
19+
rpc Burn(MsgBurn) returns (MsgBurnResponse);
20+
21+
// DisableMint defines a method for disable the mint function
22+
rpc DisableMint(MsgDisableMint) returns (MsgDisableMintResponse);
23+
24+
rpc SetMinter(MsgSetMinter) returns (MsgSetMinterResponse);
25+
rpc SetAuthority(MsgSetAuthority) returns (MsgSetAuthorityResponse);
26+
rpc SetUri(MsgSetUri) returns (MsgSetUriResponse);
27+
}
28+
29+
// MsgIssue defines a message for issuing a new fan token
30+
message MsgIssue {
31+
32+
// symbol which corresponds to the symbol of the fan token. It is a string and cannot change for the whole life of the fan token
33+
string symbol = 1;
34+
35+
// name which corresponds to the name of the fan token. It is a string and cannot change for the whole life of the fan token
36+
string name = 2;
37+
38+
// max_supply that represents the maximum number of possible mintable tokens. It is an integer number, expressed in micro unit 10^6
39+
string max_supply = 3 [
40+
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
41+
(gogoproto.moretags) = "yaml:\"max_supply\"",
42+
(gogoproto.nullable) = false
43+
];
44+
45+
// authority which is who can set a new uri metadata
46+
string authority = 4;
47+
48+
// minter who is who can mint new fantoken and disable the minter process, the minter key also pay the gas fee
49+
string minter = 5;
50+
51+
// URI which is the current uri of the fan token. It is a string can change during the fan token lifecycle thanks to the MsgEdit
52+
string uri = 6 [ (gogoproto.customname) = "URI" ];
53+
}
54+
55+
// MsgIssueResponse defines the MsgIssue response type
56+
message MsgIssueResponse {}
57+
58+
// MsgDisableMint defines a message for disable the mint function
59+
message MsgDisableMint {
60+
string denom = 1;
61+
string minter = 2;
62+
}
63+
64+
// MsgDisableMintResponse defines the MsgDisableMint response type
65+
message MsgDisableMintResponse {}
66+
67+
// MsgMint defines a message for minting a new fan token
68+
message MsgMint {
69+
string recipient = 1;
70+
71+
// coin mean the amount + denom, eg: 10000ftFADJID34MCDM
72+
cosmos.base.v1beta1.Coin coin = 2 [
73+
(gogoproto.moretags) = "yaml:\"coin\"",
74+
(gogoproto.nullable) = false
75+
];
76+
77+
string minter = 3;
78+
}
79+
80+
// MsgMintResponse defines the MsgMint response type
81+
message MsgMintResponse {}
82+
83+
// MsgBurn defines a message for burning some fan tokens
84+
message MsgBurn {
85+
// coin mean the amount + denom, eg: 10000ftFADJID34MCDM
86+
cosmos.base.v1beta1.Coin coin = 1 [
87+
(gogoproto.moretags) = "yaml:\"coin\"",
88+
(gogoproto.nullable) = false
89+
];
90+
91+
string sender = 2;
92+
}
93+
94+
// MsgBurnResponse defines the MsgBurn response type
95+
message MsgBurnResponse {}
96+
97+
// MsgSetMinter defines a message for changing the fan token minter address
98+
message MsgSetMinter {
99+
100+
// denom the fan token denom
101+
string denom = 1;
102+
103+
// old_minter, the actual minter
104+
string old_minter = 2 [ (gogoproto.moretags) = "yaml:\"old_minter\"" ];
105+
106+
// new_minter, the new fan token minter
107+
string new_minter = 3 [ (gogoproto.moretags) = "yaml:\"new_minter\"" ];
108+
}
109+
110+
// MsgSetMinterResponse defines the MsgTransferAuthority response type
111+
message MsgSetMinterResponse {}
112+
113+
// MsgSetAuthority defines a message for changing the fan token minter address
114+
message MsgSetAuthority {
115+
116+
// denom the fan token denom
117+
string denom = 1;
118+
119+
// old_authority, the actual metadata authority
120+
string old_authority = 2 [ (gogoproto.moretags) = "yaml:\"old_authority\"" ];
121+
122+
// new_authority, the new fan token metadata authority
123+
string new_authority = 3 [ (gogoproto.moretags) = "yaml:\"new_authority\"" ];
124+
}
125+
126+
// MsgSetAuthorityResponse defines the MsgTransferAuthority response type
127+
message MsgSetAuthorityResponse {}
128+
129+
message MsgSetUri {
130+
string authority = 1;
131+
string denom = 2;
132+
string uri = 3 [ (gogoproto.customname) = "URI" ];
133+
}
134+
135+
message MsgSetUriResponse{}

0 commit comments

Comments
 (0)