-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af211da
commit 4fc582e
Showing
14 changed files
with
626 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
syntax = "proto3"; | ||
package bitsong.fantoken.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types"; | ||
|
||
message EventIssue { | ||
string denom = 1; | ||
} | ||
|
||
message EventDisableMint { | ||
string denom = 1; | ||
} | ||
|
||
message EventMint { | ||
string recipient = 1; | ||
string coin = 2; | ||
} | ||
|
||
message EventBurn { | ||
string sender = 1; | ||
string coin = 2; | ||
} | ||
|
||
message EventSetAuthority { | ||
string denom = 1; | ||
string old_authority = 2 [ (gogoproto.moretags) = "yaml:\"old_authority\"" ]; | ||
string new_authority = 3 [ (gogoproto.moretags) = "yaml:\"new_authority\"" ]; | ||
} | ||
|
||
message EventSetMinter { | ||
string denom = 1; | ||
string old_minter = 2 [ (gogoproto.moretags) = "yaml:\"old_minter\"" ]; | ||
string new_minter = 3 [ (gogoproto.moretags) = "yaml:\"new_minter\"" ]; | ||
} | ||
|
||
message EventSetUri { | ||
string denom = 1; | ||
} |
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,46 @@ | ||
syntax = "proto3"; | ||
package bitsong.fantoken.v1beta1; | ||
|
||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types"; | ||
option (gogoproto.goproto_getters_all) = false; | ||
|
||
message Metadata { | ||
// name defines the name of the fantoken (eg: Kitty Punk) | ||
string name = 1; | ||
|
||
// symbol is the token symbol usually shown on exchanges (eg: KITTY) | ||
string symbol = 2; | ||
|
||
// URI to a document (on or off-chain) that contains additional | ||
// information.Optional. | ||
string uri = 3 [ (gogoproto.customname) = "URI" ]; | ||
|
||
// sdk.AccAddress allowed to set a new uri | ||
string authority = 4; | ||
} | ||
|
||
// FanToken defines a standard for the fungible token | ||
message FanToken { | ||
option (gogoproto.goproto_getters) = false; | ||
option (gogoproto.goproto_stringer) = false; | ||
|
||
// denom represents the string name of the given denom unit (e.g ft<hash>). | ||
string denom = 1; | ||
|
||
string max_supply = 2 [ | ||
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", | ||
(gogoproto.moretags) = "yaml:\"max_supply\"", | ||
(gogoproto.nullable) = false | ||
]; | ||
|
||
// sdk.AccAddress allowed to mint new fantoken | ||
string minter = 3; | ||
|
||
Metadata meta_data = 4 [ | ||
(gogoproto.moretags) = "yaml:\"meta_data\"", | ||
(gogoproto.nullable) = false | ||
]; | ||
} |
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,17 @@ | ||
syntax = "proto3"; | ||
package bitsong.fantoken.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "bitsong/fantoken/v1beta1/fantoken.proto"; | ||
import "bitsong/fantoken/v1beta1/params.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
|
||
option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types"; | ||
|
||
// GenesisState defines the fantoken module's genesis state | ||
message GenesisState { | ||
bitsong.fantoken.v1beta1.Params params = 1 [ (gogoproto.nullable) = false ]; | ||
|
||
repeated bitsong.fantoken.v1beta1.FanToken fan_tokens = 2 | ||
[ (gogoproto.nullable) = false ]; | ||
} |
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,42 @@ | ||
syntax = "proto3"; | ||
package bitsong.fantoken.v1beta1; | ||
|
||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types"; | ||
option (gogoproto.goproto_getters_all) = false; | ||
|
||
message UpdateFeesProposal { | ||
option (gogoproto.equal) = true; | ||
option (gogoproto.goproto_stringer) = false; | ||
|
||
string title = 1; | ||
string description = 2; | ||
|
||
cosmos.base.v1beta1.Coin issue_fee = 3 [ | ||
(gogoproto.moretags) = "yaml:\"issue_fee\"", | ||
(gogoproto.nullable) = false | ||
]; | ||
|
||
cosmos.base.v1beta1.Coin mint_fee = 4 [ | ||
(gogoproto.moretags) = "yaml:\"mint_fee\"", | ||
(gogoproto.nullable) = false | ||
]; | ||
|
||
cosmos.base.v1beta1.Coin burn_fee = 5 [ | ||
(gogoproto.moretags) = "yaml:\"burn_fee\"", | ||
(gogoproto.nullable) = false | ||
]; | ||
} | ||
|
||
message UpdateFeesProposalWithDeposit { | ||
option (gogoproto.goproto_stringer) = true; | ||
|
||
string title = 1; | ||
string description = 2; | ||
string issue_fee = 3; | ||
string mint_fee = 4; | ||
string burn_fee = 5; | ||
string deposit = 7; | ||
} |
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,29 @@ | ||
syntax = "proto3"; | ||
package bitsong.fantoken.v1beta1; | ||
|
||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types"; | ||
option (gogoproto.goproto_getters_all) = false; | ||
|
||
// Params defines fantoken module's parameters | ||
message Params { | ||
option (gogoproto.equal) = true; | ||
option (gogoproto.goproto_stringer) = false; | ||
|
||
cosmos.base.v1beta1.Coin issue_fee = 1 [ | ||
(gogoproto.moretags) = "yaml:\"issue_fee\"", | ||
(gogoproto.nullable) = false | ||
]; | ||
|
||
cosmos.base.v1beta1.Coin mint_fee = 2 [ | ||
(gogoproto.moretags) = "yaml:\"mint_fee\"", | ||
(gogoproto.nullable) = false | ||
]; | ||
|
||
cosmos.base.v1beta1.Coin burn_fee = 3 [ | ||
(gogoproto.moretags) = "yaml:\"burn_fee\"", | ||
(gogoproto.nullable) = false | ||
]; | ||
} |
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,57 @@ | ||
syntax = "proto3"; | ||
package bitsong.fantoken.v1beta1; | ||
|
||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "cosmos/base/query/v1beta1/pagination.proto"; | ||
import "gogoproto/gogo.proto"; | ||
import "google/api/annotations.proto"; | ||
import "bitsong/fantoken/v1beta1/fantoken.proto"; | ||
import "bitsong/fantoken/v1beta1/params.proto"; | ||
|
||
option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types"; | ||
|
||
// Query creates service with fantoken as RPC | ||
service Query { | ||
|
||
// FanToken returns fantoken with fantoken name | ||
rpc FanToken(QueryFanTokenRequest) returns (QueryFanTokenResponse) { | ||
option (google.api.http).get = "/bitsong/fantoken/v1beta1/denom/{denom}"; | ||
} | ||
|
||
// FanTokens returns the fantoken list | ||
rpc FanTokens(QueryFanTokensRequest) returns (QueryFanTokensResponse) { | ||
option (google.api.http).get = "/bitsong/fantoken/v1beta1/fantokens"; | ||
} | ||
|
||
// Params queries the fantoken parameters | ||
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { | ||
option (google.api.http).get = "/bitsong/fantoken/v1beta1/params"; | ||
} | ||
} | ||
|
||
// QueryFanTokenRequest is request type for the Query/FanToken RPC method | ||
message QueryFanTokenRequest { string denom = 1; } | ||
|
||
// QueryFanTokenResponse is response type for the Query/FanToken RPC method | ||
message QueryFanTokenResponse { bitsong.fantoken.v1beta1.FanToken fantoken = 1; } | ||
|
||
// QueryFanTokensRequest is request type for the Query/FanTokens RPC method | ||
message QueryFanTokensRequest { | ||
string authority = 1; | ||
// pagination defines an optional pagination for the request. | ||
cosmos.base.query.v1beta1.PageRequest pagination = 2; | ||
} | ||
|
||
// QueryFanTokensResponse is response type for the Query/FanTokens RPC method | ||
message QueryFanTokensResponse { | ||
repeated bitsong.fantoken.v1beta1.FanToken fantokens = 1; | ||
cosmos.base.query.v1beta1.PageResponse pagination = 2; | ||
} | ||
|
||
// QueryParametersRequest is request type for the Query/Parameters RPC method | ||
message QueryParamsRequest {} | ||
|
||
// QueryParametersResponse is response type for the Query/Parameters RPC method | ||
message QueryParamsResponse { | ||
bitsong.fantoken.v1beta1.Params params = 1 [ (gogoproto.nullable) = false ]; | ||
} |
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,135 @@ | ||
syntax = "proto3"; | ||
package bitsong.fantoken; | ||
|
||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types"; | ||
option (gogoproto.goproto_getters_all) = false; | ||
|
||
// Msg defines the oracle Msg service | ||
service Msg { | ||
// Issue defines a method for issuing a new fan token | ||
rpc Issue(MsgIssue) returns (MsgIssueResponse); | ||
|
||
// Mint defines a method for minting some fan tokens | ||
rpc Mint(MsgMint) returns (MsgMintResponse); | ||
|
||
// Burn defines a method for burning some fan tokens | ||
rpc Burn(MsgBurn) returns (MsgBurnResponse); | ||
|
||
// DisableMint defines a method for disable the mint function | ||
rpc DisableMint(MsgDisableMint) returns (MsgDisableMintResponse); | ||
|
||
rpc SetMinter(MsgSetMinter) returns (MsgSetMinterResponse); | ||
rpc SetAuthority(MsgSetAuthority) returns (MsgSetAuthorityResponse); | ||
rpc SetUri(MsgSetUri) returns (MsgSetUriResponse); | ||
} | ||
|
||
// MsgIssue defines a message for issuing a new fan token | ||
message MsgIssue { | ||
|
||
// 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 | ||
string symbol = 1; | ||
|
||
// 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 | ||
string name = 2; | ||
|
||
// max_supply that represents the maximum number of possible mintable tokens. It is an integer number, expressed in micro unit 10^6 | ||
string max_supply = 3 [ | ||
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", | ||
(gogoproto.moretags) = "yaml:\"max_supply\"", | ||
(gogoproto.nullable) = false | ||
]; | ||
|
||
// authority which is who can set a new uri metadata | ||
string authority = 4; | ||
|
||
// minter who is who can mint new fantoken and disable the minter process, the minter key also pay the gas fee | ||
string minter = 5; | ||
|
||
// 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 | ||
string uri = 6 [ (gogoproto.customname) = "URI" ]; | ||
} | ||
|
||
// MsgIssueResponse defines the MsgIssue response type | ||
message MsgIssueResponse {} | ||
|
||
// MsgDisableMint defines a message for disable the mint function | ||
message MsgDisableMint { | ||
string denom = 1; | ||
string minter = 2; | ||
} | ||
|
||
// MsgDisableMintResponse defines the MsgDisableMint response type | ||
message MsgDisableMintResponse {} | ||
|
||
// MsgMint defines a message for minting a new fan token | ||
message MsgMint { | ||
string recipient = 1; | ||
|
||
// coin mean the amount + denom, eg: 10000ftFADJID34MCDM | ||
cosmos.base.v1beta1.Coin coin = 2 [ | ||
(gogoproto.moretags) = "yaml:\"coin\"", | ||
(gogoproto.nullable) = false | ||
]; | ||
|
||
string minter = 3; | ||
} | ||
|
||
// MsgMintResponse defines the MsgMint response type | ||
message MsgMintResponse {} | ||
|
||
// MsgBurn defines a message for burning some fan tokens | ||
message MsgBurn { | ||
// coin mean the amount + denom, eg: 10000ftFADJID34MCDM | ||
cosmos.base.v1beta1.Coin coin = 1 [ | ||
(gogoproto.moretags) = "yaml:\"coin\"", | ||
(gogoproto.nullable) = false | ||
]; | ||
|
||
string sender = 2; | ||
} | ||
|
||
// MsgBurnResponse defines the MsgBurn response type | ||
message MsgBurnResponse {} | ||
|
||
// MsgSetMinter defines a message for changing the fan token minter address | ||
message MsgSetMinter { | ||
|
||
// denom the fan token denom | ||
string denom = 1; | ||
|
||
// old_minter, the actual minter | ||
string old_minter = 2 [ (gogoproto.moretags) = "yaml:\"old_minter\"" ]; | ||
|
||
// new_minter, the new fan token minter | ||
string new_minter = 3 [ (gogoproto.moretags) = "yaml:\"new_minter\"" ]; | ||
} | ||
|
||
// MsgSetMinterResponse defines the MsgTransferAuthority response type | ||
message MsgSetMinterResponse {} | ||
|
||
// MsgSetAuthority defines a message for changing the fan token minter address | ||
message MsgSetAuthority { | ||
|
||
// denom the fan token denom | ||
string denom = 1; | ||
|
||
// old_authority, the actual metadata authority | ||
string old_authority = 2 [ (gogoproto.moretags) = "yaml:\"old_authority\"" ]; | ||
|
||
// new_authority, the new fan token metadata authority | ||
string new_authority = 3 [ (gogoproto.moretags) = "yaml:\"new_authority\"" ]; | ||
} | ||
|
||
// MsgSetAuthorityResponse defines the MsgTransferAuthority response type | ||
message MsgSetAuthorityResponse {} | ||
|
||
message MsgSetUri { | ||
string authority = 1; | ||
string denom = 2; | ||
string uri = 3 [ (gogoproto.customname) = "URI" ]; | ||
} | ||
|
||
message MsgSetUriResponse{} |
Oops, something went wrong.