-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add tokenfactory module * lint * fix test scripts
- Loading branch information
Showing
54 changed files
with
11,307 additions
and
3 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
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,11 @@ | ||
package params | ||
|
||
// Simulation parameter constants | ||
const ( | ||
DefaultWeightMsgCreateDenom int = 100 | ||
DefaultWeightMsgMint int = 100 | ||
DefaultWeightMsgBurn int = 100 | ||
DefaultWeightMsgChangeAdmin int = 100 | ||
DefaultWeightMsgSetDenomMetadata int = 100 | ||
DefaultWeightMsgForceTransfer int = 100 | ||
) |
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
17 changes: 17 additions & 0 deletions
17
proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto
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 osmosis.tokenfactory.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
|
||
option go_package = "github.com/OmniFlix/omniflixhub/v2/x/tokenfactory/types"; | ||
|
||
// DenomAuthorityMetadata specifies metadata for addresses that have specific | ||
// capabilities over a token factory denom. Right now there is only one Admin | ||
// permission, but is planned to be extended to the future. | ||
message DenomAuthorityMetadata { | ||
option (gogoproto.equal) = true; | ||
|
||
// Can be empty for no admin, or a valid osmosis address | ||
string admin = 1 [ (gogoproto.moretags) = "yaml:\"admin\"" ]; | ||
} |
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,32 @@ | ||
syntax = "proto3"; | ||
package osmosis.tokenfactory.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; | ||
import "osmosis/tokenfactory/v1beta1/params.proto"; | ||
|
||
option go_package = "github.com/OmniFlix/omniflixhub/v2/x/tokenfactory/types"; | ||
|
||
// GenesisState defines the tokenfactory module's genesis state. | ||
message GenesisState { | ||
// params defines the paramaters of the module. | ||
Params params = 1 [ (gogoproto.nullable) = false ]; | ||
|
||
repeated GenesisDenom factory_denoms = 2 [ | ||
(gogoproto.moretags) = "yaml:\"factory_denoms\"", | ||
(gogoproto.nullable) = false | ||
]; | ||
} | ||
|
||
// GenesisDenom defines a tokenfactory denom that is defined within genesis | ||
// state. The structure contains DenomAuthorityMetadata which defines the | ||
// denom's admin. | ||
message GenesisDenom { | ||
option (gogoproto.equal) = true; | ||
|
||
string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; | ||
DenomAuthorityMetadata authority_metadata = 2 [ | ||
(gogoproto.moretags) = "yaml:\"authority_metadata\"", | ||
(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,26 @@ | ||
syntax = "proto3"; | ||
package osmosis.tokenfactory.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
|
||
option go_package = "github.com/OmniFlix/omniflixhub/v2/x/tokenfactory/types"; | ||
|
||
// Params defines the parameters for the tokenfactory module. | ||
message Params { | ||
repeated cosmos.base.v1beta1.Coin denom_creation_fee = 1 [ | ||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", | ||
(gogoproto.moretags) = "yaml:\"denom_creation_fee\"", | ||
(gogoproto.nullable) = false | ||
]; | ||
|
||
// if denom_creation_fee is an empty array, then this field is used to add more gas consumption | ||
// to the base cost. | ||
// https://github.com/CosmWasm/token-factory/issues/11 | ||
uint64 denom_creation_gas_consume = 2 [ | ||
(gogoproto.moretags) = "yaml:\"denom_creation_gas_consume\"", | ||
(gogoproto.nullable) = true | ||
]; | ||
} |
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,71 @@ | ||
syntax = "proto3"; | ||
package osmosis.tokenfactory.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "google/api/annotations.proto"; | ||
import "cosmos/base/query/v1beta1/pagination.proto"; | ||
import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; | ||
import "osmosis/tokenfactory/v1beta1/params.proto"; | ||
|
||
option go_package = "github.com/OmniFlix/omniflixhub/v2/x/tokenfactory/types"; | ||
|
||
// Query defines the gRPC querier service. | ||
service Query { | ||
// Params defines a gRPC query method that returns the tokenfactory module's | ||
// parameters. | ||
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { | ||
option (google.api.http).get = "/osmosis/tokenfactory/v1beta1/params"; | ||
} | ||
|
||
// DenomAuthorityMetadata defines a gRPC query method for fetching | ||
// DenomAuthorityMetadata for a particular denom. | ||
rpc DenomAuthorityMetadata(QueryDenomAuthorityMetadataRequest) | ||
returns (QueryDenomAuthorityMetadataResponse) { | ||
option (google.api.http).get = | ||
"/osmosis/tokenfactory/v1beta1/denoms/{denom}/authority_metadata"; | ||
} | ||
|
||
// DenomsFromCreator defines a gRPC query method for fetching all | ||
// denominations created by a specific admin/creator. | ||
rpc DenomsFromCreator(QueryDenomsFromCreatorRequest) | ||
returns (QueryDenomsFromCreatorResponse) { | ||
option (google.api.http).get = | ||
"/osmosis/tokenfactory/v1beta1/denoms_from_creator/{creator}"; | ||
} | ||
} | ||
|
||
// QueryParamsRequest is the request type for the Query/Params RPC method. | ||
message QueryParamsRequest {} | ||
|
||
// QueryParamsResponse is the response type for the Query/Params RPC method. | ||
message QueryParamsResponse { | ||
// params defines the parameters of the module. | ||
Params params = 1 [ (gogoproto.nullable) = false ]; | ||
} | ||
|
||
// QueryDenomAuthorityMetadataRequest defines the request structure for the | ||
// DenomAuthorityMetadata gRPC query. | ||
message QueryDenomAuthorityMetadataRequest { | ||
string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; | ||
} | ||
|
||
// QueryDenomAuthorityMetadataResponse defines the response structure for the | ||
// DenomAuthorityMetadata gRPC query. | ||
message QueryDenomAuthorityMetadataResponse { | ||
DenomAuthorityMetadata authority_metadata = 1 [ | ||
(gogoproto.moretags) = "yaml:\"authority_metadata\"", | ||
(gogoproto.nullable) = false | ||
]; | ||
} | ||
|
||
// QueryDenomsFromCreatorRequest defines the request structure for the | ||
// DenomsFromCreator gRPC query. | ||
message QueryDenomsFromCreatorRequest { | ||
string creator = 1 [ (gogoproto.moretags) = "yaml:\"creator\"" ]; | ||
} | ||
|
||
// QueryDenomsFromCreatorRequest defines the response structure for the | ||
// DenomsFromCreator gRPC query. | ||
message QueryDenomsFromCreatorResponse { | ||
repeated string denoms = 1 [ (gogoproto.moretags) = "yaml:\"denoms\"" ]; | ||
} |
Oops, something went wrong.