From 961a4cab767630f3090fc5fbfb4dbb9e67a3040f Mon Sep 17 00:00:00 2001 From: discoverdefiteam Date: Sat, 16 Sep 2023 23:22:14 -0400 Subject: [PATCH] update proto & config --- INTEGRATION.md | 205 --------- config.yml | 8 +- proto/buf.gen.gogo.yml | 8 - proto/buf.lock | 8 +- proto/cosmwasm/wasm/v1/authz.proto | 131 ------ proto/cosmwasm/wasm/v1/genesis.proto | 56 --- proto/cosmwasm/wasm/v1/ibc.proto | 37 -- proto/cosmwasm/wasm/v1/proposal.proto | 329 --------------- proto/cosmwasm/wasm/v1/query.proto | 268 ------------ proto/cosmwasm/wasm/v1/tx.proto | 391 ------------------ proto/cosmwasm/wasm/v1/types.proto | 148 ------- proto/gaia/globalfee/v1beta1/genesis.proto | 31 ++ proto/gaia/globalfee/v1beta1/query.proto | 32 ++ proto/gaia/globalfee/v1beta1/tx.proto | 40 ++ .../v1beta1/authorityMetadata.proto} | 4 +- .../tokenfactory/v1beta1/genesis.proto | 4 +- .../tokenfactory/v1beta1/params.proto | 10 +- .../tokenfactory/v1beta1/query.proto | 6 +- .../tokenfactory/v1beta1/tx.proto | 87 ++-- proto/terp/feeshare/v1/feeshare.proto | 18 + proto/terp/feeshare/v1/genesis.proto | 31 ++ proto/terp/feeshare/v1/query.proto | 119 ++++++ proto/terp/feeshare/v1/tx.proto | 97 +++++ 23 files changed, 449 insertions(+), 1619 deletions(-) delete mode 100644 INTEGRATION.md delete mode 100644 proto/buf.gen.gogo.yml delete mode 100644 proto/cosmwasm/wasm/v1/authz.proto delete mode 100644 proto/cosmwasm/wasm/v1/genesis.proto delete mode 100644 proto/cosmwasm/wasm/v1/ibc.proto delete mode 100644 proto/cosmwasm/wasm/v1/proposal.proto delete mode 100644 proto/cosmwasm/wasm/v1/query.proto delete mode 100644 proto/cosmwasm/wasm/v1/tx.proto delete mode 100644 proto/cosmwasm/wasm/v1/types.proto create mode 100644 proto/gaia/globalfee/v1beta1/genesis.proto create mode 100644 proto/gaia/globalfee/v1beta1/query.proto create mode 100644 proto/gaia/globalfee/v1beta1/tx.proto rename proto/{cosmwasm/tokenfactory/v1beta1/authority_metadata.proto => osmosis/tokenfactory/v1beta1/authorityMetadata.proto} (90%) rename proto/{cosmwasm => osmosis}/tokenfactory/v1beta1/genesis.proto (88%) rename proto/{cosmwasm => osmosis}/tokenfactory/v1beta1/params.proto (58%) rename proto/{cosmwasm => osmosis}/tokenfactory/v1beta1/query.proto (95%) rename proto/{cosmwasm => osmosis}/tokenfactory/v1beta1/tx.proto (64%) create mode 100644 proto/terp/feeshare/v1/feeshare.proto create mode 100644 proto/terp/feeshare/v1/genesis.proto create mode 100644 proto/terp/feeshare/v1/query.proto create mode 100644 proto/terp/feeshare/v1/tx.proto diff --git a/INTEGRATION.md b/INTEGRATION.md deleted file mode 100644 index 5907e20..0000000 --- a/INTEGRATION.md +++ /dev/null @@ -1,205 +0,0 @@ - - -# Integration - -If you want to use Wasm in your own app, here is how you can get this working -quickly and easily. -First start with This [article](https://medium.com/cosmwasm/cosmwasm-for-ctos-iv-native-integrations-713140bf75fc) -in the "CosmWasm for CTOs" series that gives you a high level view. -Then check to make sure you fit the pre-requisites, -then integrate the `x/wasm` module as described below, and finally, you -can add custom messages and queries to your custom Go/SDK modules, exposing -them to any chain-specific contract. - -## Prerequisites - -The pre-requisites of integrating `x/wasm` into your custom app is to be using -a compatible version of the Cosmos SDK, and to accept some limits to the -hardware it runs on. - -| wasmd | Cosmos SDK | -|:-----:|:----------:| -| v0.30 | v0.45.11 | -| v0.29 | v0.45.8 | -| v0.28 | v0.45.5 | -| v0.27 | v0.45.4 | -| v0.26 | v0.45.1 | -| v0.25 | v0.45.1 | -| v0.24 | v0.45.0 | -| v0.23 | v0.45.0 | -| v0.22 | v0.45.0 | -| v0.21 | v0.42.x | - - -We currently only support Intel/AMD64 CPUs and OSX or Linux. For Linux, the standard build -commands work for `glibc` systems (Ubuntu, Debian, CentOS, etc). If you wish to compile -for a `muslc` based system (like alpine), you need to compile a static library wasmvm locally -and compile go with the `muslc` build tag. Or just use the [Dockerfile](./Dockerfile), -which builds a static go binary in an alpine system. - -This limit comes from the Rust dll we use to run the wasm code, which comes -from [`wasmvm`](https://github.com/CosmWasm/wasmvm). There are open issues -for adding [ARM support](https://github.com/CosmWasm/wasmvm/issues/53), and -adding [Windows support](https://github.com/CosmWasm/wasmvm/issues/28). -However, these issues are not high on the roadmap and unless you are championing -them, please count on the current limits for the near future. - -## Quick Trial - -The simplest way to try out CosmWasm is simply to run `wasmd` out of the box, -and focus on writing, uploading, and using your custom contracts. There is -plenty that can be done there, and lots to learn. - -Once you are happy with it and want to use a custom Cosmos SDK app, -you may consider simply forking `wasmd`. *I highly advise against this*. -You should try one of the methods below. - -## Integrating wasmd - -### As external module - -The simplest way to use `wasmd` is just to import `x/wasm` and wire it up -in `app.go`. You now have access to the whole module and you custom modules -running side by side. (But the CosmWasm contracts will only have access -to `bank` and `staking`... more below on [customization](#Adding-Custom-Hooks)). - -The requirement here is that you have imported the standard sdk modules -from the Cosmos SDK, and enabled them in `app.go`. If so, you can just look -at [`wasmd/app/app.go`](https://github.com/terpnetwork/terp-core/blob/master/app/app.go#) -for how to do so (just search there for lines with `wasm`). - -`wasmd` also comes with 2 custom `ante handlers`: -* `CountTXDecorator` adds the TX position in the block into the context and passes it to the contracts -* `LimitSimulationGasDecorator` prevents an "infinite gas" query - -In order to support these features you would need to add our custom -ante handlers into the `ante handler chain` as in: [`app/ante.go`](https://github.com/terpnetwork/terp-core/blob/master/app/ante.go) - -### Copied into your app - -Sometimes, however, you will need to copy `x/wasm` into your app. This should -be in limited cases, and makes upgrading more difficult, so please take the -above path if possible. This is required if you have either disabled some key -SDK modules in your app (eg. using PoA not staking and need to disable those -callbacks and feature support), or if you have copied in the core `x/*` modules -from the Cosmos SDK into your application and customized them somehow. - -In either case, your best approach is to copy the `x/wasm` module from the -latest release into your application. Your goal is to make **minimal changes** -in this module, and rather add your customizations in a separate module. -This is due to the fact that you will have to copy and customize `x/wasm` -from upstream on all future `wasmd` releases, and this should be as simple -as possible. - -If, for example, you have forked the standard SDK libs, you just want to -change the imports (from eg. `github.com/cosmos/cosmos-sdk/x/bank` to -`github.com/YOUR/APP/x/bank`), and adjust any calls if there are compiler -errors due to differing APIs (maybe you use Decimals not Ints for currencies?). - -By the end of this, you should be able to run the standard CosmWasm contracts -in your application, alongside all your custom logic. - -## Adding custom hooks - -Once you have gotten this integration working and are happy with the -flexibility it offers you, you will probably start wishing for deeper -integration with your custom SDK modules. "It sure is nice to have custom -tokens with a bonding curve from my native token, but I would love -to trade them on the exchange I wrote as a Go module. Or maybe use them -to add options to the exchange." - -At this point, you need to dig down deeper and see how you can add this -power without forking either CosmWasm or `wasmd`. - -### Calling contracts from native code - -This is perhaps the easiest part. Let's say your native exchange module -wants to call into a token that lives as a CosmWasm module. You need to -pass the `wasm.Keeper` into your `exchange.Keeper`. If you know the format -for sending messages and querying the contract (exported as json schema -from each contract), and have a way of configuring addresses of supported -token contracts, your exchange code can simply call `wasm.Keeper.Execute` -with a properly formatted message to move funds, or `wasm.Keeper.SmartQuery` -to check balances. - -If you look at the unit tests in [`x/wasm/internal/keeper`](https://github.com/terpnetwork/terp-core/tree/master/x/wasm/internal/keeper), -it should be pretty straight forward. - -### Extending the Contract Interface - -If you want to let the contracts access your native modules, the first -step is to define a set of Messages and Queries that you want to expose, -and then add them as `CosmosMsg::Custom` and `QueryRequest::Custom` -variants. You can see an example of the [bindings for Terra](https://github.com/CosmWasm/terra-contracts/tree/master/packages/bindings). - -Once you have those bindings, use them to build a -[simple contact using much of the API](https://github.com/CosmWasm/terra-contracts/tree/master/contracts/maker). -Don't worry too much about the details, this should be usable, but mainly -you will want to upload it to your chain and use for integration tests -with your native Cosmos SDK modules. Once that is solid, then add more -and more complex contracts. - -You will then likely want to add a `mocks` package so you can provide -mocks for the functionality of your native modules when unit testing -the contracts (provide static data for exchange rates when your contracts -query it). You can see an example of [mocks for Terra contracts](https://github.com/CosmWasm/terra-contracts/tree/master/packages/mocks). - -What these three steps provide is basically a chain-specific extension to the CosmWasm contract SDK. -Any CosmWasm contract can import you library (bindings and mocks) and easily get started using -your custom, chain-specific extensions just as easily as using the standard CosmWasm interfaces. -What is left is actually wiring them up in your chain so they work as desired. - -Note, in order to ensure that no one tries to run the contracts on an unsupported chain, -you will want to include a `requires_XYZ` directive in your `bindings` library, this will -mean that only blockchain apps that explicitly declare their support for the `XYZ` extensions -(please rename XYZ to your project name) will allow the contract to be uploaded, and others -get error messages upon upload, not while running a critical feature later on. -You just need to add [a line like this](https://github.com/CosmWasm/terra-contracts/blob/master/packages/bindings/src/lib.rs#L13-L16) -to your binding library to add the requirement to any contract that imports your `bindings` lib. - -### Calling into the SDK - -Before I show how this works, I want to remind you, if you have copied `x/wasm`, -please **do not make these changes to `x/wasm`**. - -We will add a new module, eg. `x/contracts`, that will contain custom -bindings between CosmWasm contracts and your native modules. There are two entry points -for you to use. The first is -[`CustomQuerier`](https://github.com/terpnetwork/terp-core/blob/v0.8.0-rc1/x/wasm/internal/keeper/query_plugins.go#L35), -which allows you to handle your custom queries. The second is -[`CustomEncoder`](https://github.com/terpnetwork/terp-core/blob/v0.8.0-rc1/x/wasm/internal/keeper/handler_plugin.go#L30) -which allows you to convert the `CosmosMsg::Custom(YourMessage)` types to `[]sdk.Msg` to be dispatched. - -Writing stubs for these is rather simple. You can look at the `reflect_test.go` file to see this in action. -In particular, here [we define a `CustomQuerier`](https://github.com/terpnetwork/terp-core/blob/v0.8.0-rc1/x/wasm/internal/keeper/reflect_test.go#L355-L385), -and here [we define a `CustomHandler`](https://github.com/terpnetwork/terp-core/blob/v0.8.0-rc1/x/wasm/internal/keeper/reflect_test.go#L303-L353). -This code is responsible to take `json.RawMessage` from the raw bytes serialized from your custom types in rust and parse it into -Go structs. Then take these go structs and properly convert them for your custom SDK modules. - -You can look at the implementations for the `staking` module to see how to build these for non-trivial -cases, including passing in the `Keeper` via a closure. Here we -[encode staking messages](https://github.com/terpnetwork/terp-core/blob/v0.8.0-rc1/x/wasm/internal/keeper/handler_plugin.go#L114-L192). -Note that withdraw returns 2 messages, which is an option you can use if needed to translate into native messages. -When we [handle staking queries](https://github.com/terpnetwork/terp-core/blob/v0.8.0-rc1/x/wasm/internal/keeper/query_plugins.go#L109-L172) -we take in a `Keeper in the closure` and dispatch the custom `QueryRequest` from the contract to the native `Keeper` interface, -then encodes a response. When defining the return types, note that for proper parsing in the Rust contract, you -should properly name the JSON fields and use the `omitempty` keyword if Rust expects `Option`. You must also use -`omitempty` and pointers for all fields that correspond to a Rust `enum`, so exactly one field is serialized. - -### Wiring it all together - -Once you have writen and tested these custom callbacks for your module, you need to enable it in your application. -The first step is to write an integration test with a contract compiled with your custom SDK to ensure it works properly, -then you need to configure this in `app.go`. - -For the test cases, you must -[define the supported feature set](https://github.com/terpnetwork/terp-core/blob/ade03a1d39a9b8882e9a1ce80572d39d57bb9bc3/x/wasm/internal/keeper/reflect_test.go#L52) -to include your custom name (remember `requires_XYZ` above?). Then, when creating `TestInput`, -you can [pass in your custom encoder and querier](https://github.com/terpnetwork/terp-core/blob/ade03a1d39a9b8882e9a1ce80572d39d57bb9bc3/x/wasm/internal/keeper/reflect_test.go#L52). -Run a few tests with your compiled contract, ideally exercising the majority of the interfaces to ensure that all parsing between the contract and -the SDK is implemented properly. - -Once you have tested this and are happy with the results, you can wire it up in `app.go`. -Just edit [the default `NewKeeper` constructor](https://github.com/terpnetwork/terp-core/blob/v0.8.0-rc1/app/app.go#L257-L258) -to have the proper `availableCapabilities` and pass in the `CustomEncoder` and `CustomQuerier` as the last two arguments to `NewKeeper`. -Now you can compile your chain and upload your custom contracts on it. \ No newline at end of file diff --git a/config.yml b/config.yml index ce1af9f..77b0d9b 100644 --- a/config.yml +++ b/config.yml @@ -1,10 +1,14 @@ accounts: - name: alex - coins: ["20000token", "200000000stake"] + coins: ["444token", "444stake"] + - name: athena + coins: ["10000token", "100000000stake"] - name: bob + oins: ["10000token", "100000000stake"] + - name: jen coins: ["10000token", "100000000stake"] validator: - name: alex + name: athena staked: "100000000stake" client: openapi: diff --git a/proto/buf.gen.gogo.yml b/proto/buf.gen.gogo.yml deleted file mode 100644 index 855ea25..0000000 --- a/proto/buf.gen.gogo.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: v1 -plugins: - - name: gocosmos - out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types - - name: grpc-gateway - out: .. - opt: logtostderr=true,allow_colon_final_segments=true \ No newline at end of file diff --git a/proto/buf.lock b/proto/buf.lock index 9de2779..c26fa3c 100644 --- a/proto/buf.lock +++ b/proto/buf.lock @@ -5,15 +5,19 @@ deps: owner: cosmos repository: cosmos-proto commit: 1935555c206d4afb9e94615dfd0fad31 + digest: shake256:c74d91a3ac7ae07d579e90eee33abf9b29664047ac8816500cf22c081fec0d72d62c89ce0bebafc1f6fec7aa5315be72606717740ca95007248425102c365377 - remote: buf.build owner: cosmos repository: cosmos-sdk commit: 954f7b05f38440fc8250134b15adec47 + digest: shake256:2ab4404fd04a7d1d52df0e2d0f2d477a3d83ffd88d876957bf3fedfd702c8e52833d65b3ce1d89a3c5adf2aab512616b0e4f51d8463f07eda9a8a3317ee3ac54 - remote: buf.build owner: cosmos repository: gogo-proto - commit: 34d970b699f84aa382f3c29773a60836 + commit: 5e5b9fdd01804356895f8f79a6f1ddc1 + digest: shake256:0b85da49e2e5f9ebc4806eae058e2f56096ff3b1c59d1fb7c190413dd15f45dd456f0b69ced9059341c80795d2b6c943de15b120a9e0308b499e43e4b5fc2952 - remote: buf.build owner: googleapis repository: googleapis - commit: 75b4300737fb4efca0831636be94e517 + commit: 711e289f6a384c4caeebaff7c6931ade + digest: shake256:e08fb55dad7469f69df00304eed31427d2d1576e9aab31e6bf86642688e04caaf0372f15fe6974cf79432779a635b3ea401ca69c943976dc42749524e4c25d94 diff --git a/proto/cosmwasm/wasm/v1/authz.proto b/proto/cosmwasm/wasm/v1/authz.proto deleted file mode 100644 index 9916639..0000000 --- a/proto/cosmwasm/wasm/v1/authz.proto +++ /dev/null @@ -1,131 +0,0 @@ -syntax = "proto3"; -package cosmwasm.wasm.v1; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "google/protobuf/any.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; -option (gogoproto.goproto_getters_all) = false; - -// ContractExecutionAuthorization defines authorization for wasm execute. -// Since: wasmd 0.30 -message ContractExecutionAuthorization { - option (amino.name) = "wasm/ContractExecutionAuthorization"; - option (cosmos_proto.implements_interface) = - "cosmos.authz.v1beta1.Authorization"; - - // Grants for contract executions - repeated ContractGrant grants = 1 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; -} - -// ContractMigrationAuthorization defines authorization for wasm contract -// migration. Since: wasmd 0.30 -message ContractMigrationAuthorization { - option (amino.name) = "wasm/ContractMigrationAuthorization"; - option (cosmos_proto.implements_interface) = - "cosmos.authz.v1beta1.Authorization"; - - // Grants for contract migrations - repeated ContractGrant grants = 1 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; -} - -// ContractGrant a granted permission for a single contract -// Since: wasmd 0.30 -message ContractGrant { - // Contract is the bech32 address of the smart contract - string contract = 1; - - // Limit defines execution limits that are enforced and updated when the grant - // is applied. When the limit lapsed the grant is removed. - google.protobuf.Any limit = 2 [ (cosmos_proto.accepts_interface) = - "cosmwasm.wasm.v1.ContractAuthzLimitX" ]; - - // Filter define more fine-grained control on the message payload passed - // to the contract in the operation. When no filter applies on execution, the - // operation is prohibited. - google.protobuf.Any filter = 3 - [ (cosmos_proto.accepts_interface) = - "cosmwasm.wasm.v1.ContractAuthzFilterX" ]; -} - -// MaxCallsLimit limited number of calls to the contract. No funds transferable. -// Since: wasmd 0.30 -message MaxCallsLimit { - option (amino.name) = "wasm/MaxCallsLimit"; - option (cosmos_proto.implements_interface) = - "cosmwasm.wasm.v1.ContractAuthzLimitX"; - - // Remaining number that is decremented on each execution - uint64 remaining = 1; -} - -// MaxFundsLimit defines the maximal amounts that can be sent to the contract. -// Since: wasmd 0.30 -message MaxFundsLimit { - option (amino.name) = "wasm/MaxFundsLimit"; - option (cosmos_proto.implements_interface) = - "cosmwasm.wasm.v1.ContractAuthzLimitX"; - - // Amounts is the maximal amount of tokens transferable to the contract. - repeated cosmos.base.v1beta1.Coin amounts = 1 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// CombinedLimit defines the maximal amounts that can be sent to a contract and -// the maximal number of calls executable. Both need to remain >0 to be valid. -// Since: wasmd 0.30 -message CombinedLimit { - option (amino.name) = "wasm/CombinedLimit"; - option (cosmos_proto.implements_interface) = - "cosmwasm.wasm.v1.ContractAuthzLimitX"; - - // Remaining number that is decremented on each execution - uint64 calls_remaining = 1; - // Amounts is the maximal amount of tokens transferable to the contract. - repeated cosmos.base.v1beta1.Coin amounts = 2 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// AllowAllMessagesFilter is a wildcard to allow any type of contract payload -// message. -// Since: wasmd 0.30 -message AllowAllMessagesFilter { - option (amino.name) = "wasm/AllowAllMessagesFilter"; - option (cosmos_proto.implements_interface) = - "cosmwasm.wasm.v1.ContractAuthzFilterX"; -} - -// AcceptedMessageKeysFilter accept only the specific contract message keys in -// the json object to be executed. -// Since: wasmd 0.30 -message AcceptedMessageKeysFilter { - option (amino.name) = "wasm/AcceptedMessageKeysFilter"; - option (cosmos_proto.implements_interface) = - "cosmwasm.wasm.v1.ContractAuthzFilterX"; - - // Messages is the list of unique keys - repeated string keys = 1; -} - -// AcceptedMessagesFilter accept only the specific raw contract messages to be -// executed. -// Since: wasmd 0.30 -message AcceptedMessagesFilter { - option (amino.name) = "wasm/AcceptedMessagesFilter"; - option (cosmos_proto.implements_interface) = - "cosmwasm.wasm.v1.ContractAuthzFilterX"; - - // Messages is the list of raw contract messages - repeated bytes messages = 1 [ (gogoproto.casttype) = "RawContractMessage" ]; -} \ No newline at end of file diff --git a/proto/cosmwasm/wasm/v1/genesis.proto b/proto/cosmwasm/wasm/v1/genesis.proto deleted file mode 100644 index 68e8b18..0000000 --- a/proto/cosmwasm/wasm/v1/genesis.proto +++ /dev/null @@ -1,56 +0,0 @@ -syntax = "proto3"; -package cosmwasm.wasm.v1; - -import "gogoproto/gogo.proto"; -import "cosmwasm/wasm/v1/types.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; - -// GenesisState - genesis state of x/wasm -message GenesisState { - Params params = 1 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; - repeated Code codes = 2 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.jsontag) = "codes,omitempty" - ]; - repeated Contract contracts = 3 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.jsontag) = "contracts,omitempty" - ]; - repeated Sequence sequences = 4 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.jsontag) = "sequences,omitempty" - ]; -} - -// Code struct encompasses CodeInfo and CodeBytes -message Code { - uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; - CodeInfo code_info = 2 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; - bytes code_bytes = 3; - // Pinned to wasmvm cache - bool pinned = 4; -} - -// Contract struct encompasses ContractAddress, ContractInfo, and ContractState -message Contract { - string contract_address = 1; - ContractInfo contract_info = 2 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; - repeated Model contract_state = 3 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; - repeated ContractCodeHistoryEntry contract_code_history = 4 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; -} - -// Sequence key and value of an id generation counter -message Sequence { - bytes id_key = 1 [ (gogoproto.customname) = "IDKey" ]; - uint64 value = 2; -} \ No newline at end of file diff --git a/proto/cosmwasm/wasm/v1/ibc.proto b/proto/cosmwasm/wasm/v1/ibc.proto deleted file mode 100644 index 2a130f2..0000000 --- a/proto/cosmwasm/wasm/v1/ibc.proto +++ /dev/null @@ -1,37 +0,0 @@ -syntax = "proto3"; -package cosmwasm.wasm.v1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; -option (gogoproto.goproto_getters_all) = false; - -// MsgIBCSend -message MsgIBCSend { - // the channel by which the packet will be sent - string channel = 2 [ (gogoproto.moretags) = "yaml:\"source_channel\"" ]; - - // Timeout height relative to the current block height. - // The timeout is disabled when set to 0. - uint64 timeout_height = 4 - [ (gogoproto.moretags) = "yaml:\"timeout_height\"" ]; - // Timeout timestamp (in nanoseconds) relative to the current block timestamp. - // The timeout is disabled when set to 0. - uint64 timeout_timestamp = 5 - [ (gogoproto.moretags) = "yaml:\"timeout_timestamp\"" ]; - - // Data is the payload to transfer. We must not make assumption what format or - // content is in here. - bytes data = 6; -} - -// MsgIBCSendResponse -message MsgIBCSendResponse { - // Sequence number of the IBC packet sent - uint64 sequence = 1; -} - -// MsgIBCCloseChannel port and channel need to be owned by the contract -message MsgIBCCloseChannel { - string channel = 2 [ (gogoproto.moretags) = "yaml:\"source_channel\"" ]; -} \ No newline at end of file diff --git a/proto/cosmwasm/wasm/v1/proposal.proto b/proto/cosmwasm/wasm/v1/proposal.proto deleted file mode 100644 index aed8fe3..0000000 --- a/proto/cosmwasm/wasm/v1/proposal.proto +++ /dev/null @@ -1,329 +0,0 @@ -syntax = "proto3"; -package cosmwasm.wasm.v1; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmwasm/wasm/v1/types.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.goproto_getters_all) = false; -option (gogoproto.equal_all) = true; - -// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -// an explicit StoreCodeProposal. To submit WASM code to the system, -// a simple MsgStoreCode can be invoked from the x/gov module via -// a v1 governance proposal. -message StoreCodeProposal { - option deprecated = true; - option (amino.name) = "wasm/StoreCodeProposal"; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - - // Title is a short summary - string title = 1; - // Description is a human readable text - string description = 2; - // RunAs is the address that is passed to the contract's environment as sender - string run_as = 3; - // WASMByteCode can be raw or gzip compressed - bytes wasm_byte_code = 4 [ (gogoproto.customname) = "WASMByteCode" ]; - // Used in v1beta1 - reserved 5, 6; - // InstantiatePermission to apply on contract creation, optional - AccessConfig instantiate_permission = 7; - // UnpinCode code on upload, optional - bool unpin_code = 8; - // Source is the URL where the code is hosted - string source = 9; - // Builder is the docker image used to build the code deterministically, used - // for smart contract verification - string builder = 10; - // CodeHash is the SHA256 sum of the code outputted by builder, used for smart - // contract verification - bytes code_hash = 11; -} - -// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -// an explicit InstantiateContractProposal. To instantiate a contract, -// a simple MsgInstantiateContract can be invoked from the x/gov module via -// a v1 governance proposal. -message InstantiateContractProposal { - option deprecated = true; - option (amino.name) = "wasm/InstantiateContractProposal"; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - - // Title is a short summary - string title = 1; - // Description is a human readable text - string description = 2; - // RunAs is the address that is passed to the contract's environment as sender - string run_as = 3; - // Admin is an optional address that can execute migrations - string admin = 4; - // CodeID is the reference to the stored WASM code - uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; - // Label is optional metadata to be stored with a constract instance. - string label = 6; - // Msg json encoded message to be passed to the contract on instantiation - bytes msg = 7 [ (gogoproto.casttype) = "RawContractMessage" ]; - // Funds coins that are transferred to the contract on instantiation - repeated cosmos.base.v1beta1.Coin funds = 8 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -// an explicit InstantiateContract2Proposal. To instantiate contract 2, -// a simple MsgInstantiateContract2 can be invoked from the x/gov module via -// a v1 governance proposal. -message InstantiateContract2Proposal { - option deprecated = true; - option (amino.name) = "wasm/InstantiateContract2Proposal"; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - - // Title is a short summary - string title = 1; - // Description is a human readable text - string description = 2; - // RunAs is the address that is passed to the contract's enviroment as sender - string run_as = 3; - // Admin is an optional address that can execute migrations - string admin = 4; - // CodeID is the reference to the stored WASM code - uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; - // Label is optional metadata to be stored with a constract instance. - string label = 6; - // Msg json encode message to be passed to the contract on instantiation - bytes msg = 7 [ (gogoproto.casttype) = "RawContractMessage" ]; - // Funds coins that are transferred to the contract on instantiation - repeated cosmos.base.v1beta1.Coin funds = 8 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - // Salt is an arbitrary value provided by the sender. Size can be 1 to 64. - bytes salt = 9; - // FixMsg include the msg value into the hash for the predictable address. - // Default is false - bool fix_msg = 10; -} - -// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -// an explicit MigrateContractProposal. To migrate a contract, -// a simple MsgMigrateContract can be invoked from the x/gov module via -// a v1 governance proposal. -message MigrateContractProposal { - option deprecated = true; - option (amino.name) = "wasm/MigrateContractProposal"; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - - // Title is a short summary - string title = 1; - // Description is a human readable text - string description = 2; - // Note: skipping 3 as this was previously used for unneeded run_as - - // Contract is the address of the smart contract - string contract = 4; - // CodeID references the new WASM code - uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; - // Msg json encoded message to be passed to the contract on migration - bytes msg = 6 [ (gogoproto.casttype) = "RawContractMessage" ]; -} - -// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -// an explicit SudoContractProposal. To call sudo on a contract, -// a simple MsgSudoContract can be invoked from the x/gov module via -// a v1 governance proposal. -message SudoContractProposal { - option deprecated = true; - option (amino.name) = "wasm/SudoContractProposal"; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - - // Title is a short summary - string title = 1; - // Description is a human readable text - string description = 2; - // Contract is the address of the smart contract - string contract = 3; - // Msg json encoded message to be passed to the contract as sudo - bytes msg = 4 [ (gogoproto.casttype) = "RawContractMessage" ]; -} - -// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -// an explicit ExecuteContractProposal. To call execute on a contract, -// a simple MsgExecuteContract can be invoked from the x/gov module via -// a v1 governance proposal. -message ExecuteContractProposal { - option deprecated = true; - option (amino.name) = "wasm/ExecuteContractProposal"; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - - // Title is a short summary - string title = 1; - // Description is a human readable text - string description = 2; - // RunAs is the address that is passed to the contract's environment as sender - string run_as = 3; - // Contract is the address of the smart contract - string contract = 4; - // Msg json encoded message to be passed to the contract as execute - bytes msg = 5 [ (gogoproto.casttype) = "RawContractMessage" ]; - // Funds coins that are transferred to the contract on instantiation - repeated cosmos.base.v1beta1.Coin funds = 6 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -// an explicit UpdateAdminProposal. To set an admin for a contract, -// a simple MsgUpdateAdmin can be invoked from the x/gov module via -// a v1 governance proposal. -message UpdateAdminProposal { - option deprecated = true; - option (amino.name) = "wasm/UpdateAdminProposal"; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - - // Title is a short summary - string title = 1; - // Description is a human readable text - string description = 2; - // NewAdmin address to be set - string new_admin = 3 [ (gogoproto.moretags) = "yaml:\"new_admin\"" ]; - // Contract is the address of the smart contract - string contract = 4; -} - -// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -// an explicit ClearAdminProposal. To clear the admin of a contract, -// a simple MsgClearAdmin can be invoked from the x/gov module via -// a v1 governance proposal. -message ClearAdminProposal { - option deprecated = true; - option (amino.name) = "wasm/ClearAdminProposal"; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - - // Title is a short summary - string title = 1; - // Description is a human readable text - string description = 2; - // Contract is the address of the smart contract - string contract = 3; -} - -// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -// an explicit PinCodesProposal. To pin a set of code ids in the wasmvm -// cache, a simple MsgPinCodes can be invoked from the x/gov module via -// a v1 governance proposal. -message PinCodesProposal { - option deprecated = true; - option (amino.name) = "wasm/PinCodesProposal"; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - - // Title is a short summary - string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; - // Description is a human readable text - string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; - // CodeIDs references the new WASM codes - repeated uint64 code_ids = 3 [ - (gogoproto.customname) = "CodeIDs", - (gogoproto.moretags) = "yaml:\"code_ids\"" - ]; -} - -// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -// an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm -// cache, a simple MsgUnpinCodes can be invoked from the x/gov module via -// a v1 governance proposal. -message UnpinCodesProposal { - option deprecated = true; - option (amino.name) = "wasm/UnpinCodesProposal"; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - - // Title is a short summary - string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; - // Description is a human readable text - string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; - // CodeIDs references the WASM codes - repeated uint64 code_ids = 3 [ - (gogoproto.customname) = "CodeIDs", - (gogoproto.moretags) = "yaml:\"code_ids\"" - ]; -} - -// AccessConfigUpdate contains the code id and the access config to be -// applied. -message AccessConfigUpdate { - // CodeID is the reference to the stored WASM code to be updated - uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; - // InstantiatePermission to apply to the set of code ids - AccessConfig instantiate_permission = 2 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; -} - -// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -// an explicit UpdateInstantiateConfigProposal. To update instantiate config -// to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from -// the x/gov module via a v1 governance proposal. -message UpdateInstantiateConfigProposal { - option deprecated = true; - option (amino.name) = "wasm/UpdateInstantiateConfigProposal"; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - - // Title is a short summary - string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; - // Description is a human readable text - string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; - // AccessConfigUpdate contains the list of code ids and the access config - // to be applied. - repeated AccessConfigUpdate access_config_updates = 3 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; -} - -// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for -// an explicit StoreAndInstantiateContractProposal. To store and instantiate -// the contract, a simple MsgStoreAndInstantiateContract can be invoked from -// the x/gov module via a v1 governance proposal. -message StoreAndInstantiateContractProposal { - option deprecated = true; - option (amino.name) = "wasm/StoreAndInstantiateContractProposal"; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - - // Title is a short summary - string title = 1; - // Description is a human readable text - string description = 2; - // RunAs is the address that is passed to the contract's environment as sender - string run_as = 3; - // WASMByteCode can be raw or gzip compressed - bytes wasm_byte_code = 4 [ (gogoproto.customname) = "WASMByteCode" ]; - // InstantiatePermission to apply on contract creation, optional - AccessConfig instantiate_permission = 5; - // UnpinCode code on upload, optional - bool unpin_code = 6; - // Admin is an optional address that can execute migrations - string admin = 7; - // Label is optional metadata to be stored with a constract instance. - string label = 8; - // Msg json encoded message to be passed to the contract on instantiation - bytes msg = 9 [ (gogoproto.casttype) = "RawContractMessage" ]; - // Funds coins that are transferred to the contract on instantiation - repeated cosmos.base.v1beta1.Coin funds = 10 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - // Source is the URL where the code is hosted - string source = 11; - // Builder is the docker image used to build the code deterministically, used - // for smart contract verification - string builder = 12; - // CodeHash is the SHA256 sum of the code outputted by builder, used for smart - // contract verification - bytes code_hash = 13; -} diff --git a/proto/cosmwasm/wasm/v1/query.proto b/proto/cosmwasm/wasm/v1/query.proto deleted file mode 100644 index d14f315..0000000 --- a/proto/cosmwasm/wasm/v1/query.proto +++ /dev/null @@ -1,268 +0,0 @@ -syntax = "proto3"; -package cosmwasm.wasm.v1; - -import "gogoproto/gogo.proto"; -import "cosmwasm/wasm/v1/types.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; -option (gogoproto.goproto_getters_all) = false; -option (gogoproto.equal_all) = false; - -// Query provides defines the gRPC querier service -service Query { - // ContractInfo gets the contract meta data - rpc ContractInfo(QueryContractInfoRequest) - returns (QueryContractInfoResponse) { - option (google.api.http).get = "/cosmwasm/wasm/v1/contract/{address}"; - } - // ContractHistory gets the contract code history - rpc ContractHistory(QueryContractHistoryRequest) - returns (QueryContractHistoryResponse) { - option (google.api.http).get = - "/cosmwasm/wasm/v1/contract/{address}/history"; - } - // ContractsByCode lists all smart contracts for a code id - rpc ContractsByCode(QueryContractsByCodeRequest) - returns (QueryContractsByCodeResponse) { - option (google.api.http).get = "/cosmwasm/wasm/v1/code/{code_id}/contracts"; - } - // AllContractState gets all raw store data for a single contract - rpc AllContractState(QueryAllContractStateRequest) - returns (QueryAllContractStateResponse) { - option (google.api.http).get = "/cosmwasm/wasm/v1/contract/{address}/state"; - } - // RawContractState gets single key from the raw store data of a contract - rpc RawContractState(QueryRawContractStateRequest) - returns (QueryRawContractStateResponse) { - option (google.api.http).get = - "/cosmwasm/wasm/v1/contract/{address}/raw/{query_data}"; - } - // SmartContractState get smart query result from the contract - rpc SmartContractState(QuerySmartContractStateRequest) - returns (QuerySmartContractStateResponse) { - option (google.api.http).get = - "/cosmwasm/wasm/v1/contract/{address}/smart/{query_data}"; - } - // Code gets the binary code and metadata for a singe wasm code - rpc Code(QueryCodeRequest) returns (QueryCodeResponse) { - option (google.api.http).get = "/cosmwasm/wasm/v1/code/{code_id}"; - } - // Codes gets the metadata for all stored wasm codes - rpc Codes(QueryCodesRequest) returns (QueryCodesResponse) { - option (google.api.http).get = "/cosmwasm/wasm/v1/code"; - } - - // PinnedCodes gets the pinned code ids - rpc PinnedCodes(QueryPinnedCodesRequest) returns (QueryPinnedCodesResponse) { - option (google.api.http).get = "/cosmwasm/wasm/v1/codes/pinned"; - } - - // Params gets the module params - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmwasm/wasm/v1/codes/params"; - } - - // ContractsByCreator gets the contracts by creator - rpc ContractsByCreator(QueryContractsByCreatorRequest) - returns (QueryContractsByCreatorResponse) { - option (google.api.http).get = - "/cosmwasm/wasm/v1/contracts/creator/{creator_address}"; - } -} - -// QueryContractInfoRequest is the request type for the Query/ContractInfo RPC -// method -message QueryContractInfoRequest { - // address is the address of the contract to query - string address = 1; -} -// QueryContractInfoResponse is the response type for the Query/ContractInfo RPC -// method -message QueryContractInfoResponse { - option (gogoproto.equal) = true; - - // address is the address of the contract - string address = 1; - ContractInfo contract_info = 2 [ - (gogoproto.embed) = true, - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.jsontag) = "" - ]; -} - -// QueryContractHistoryRequest is the request type for the Query/ContractHistory -// RPC method -message QueryContractHistoryRequest { - // address is the address of the contract to query - string address = 1; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryContractHistoryResponse is the response type for the -// Query/ContractHistory RPC method -message QueryContractHistoryResponse { - repeated ContractCodeHistoryEntry entries = 1 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryContractsByCodeRequest is the request type for the Query/ContractsByCode -// RPC method -message QueryContractsByCodeRequest { - uint64 code_id = 1; // grpc-gateway_out does not support Go style CodID - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryContractsByCodeResponse is the response type for the -// Query/ContractsByCode RPC method -message QueryContractsByCodeResponse { - // contracts are a set of contract addresses - repeated string contracts = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryAllContractStateRequest is the request type for the -// Query/AllContractState RPC method -message QueryAllContractStateRequest { - // address is the address of the contract - string address = 1; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryAllContractStateResponse is the response type for the -// Query/AllContractState RPC method -message QueryAllContractStateResponse { - repeated Model models = 1 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryRawContractStateRequest is the request type for the -// Query/RawContractState RPC method -message QueryRawContractStateRequest { - // address is the address of the contract - string address = 1; - bytes query_data = 2; -} - -// QueryRawContractStateResponse is the response type for the -// Query/RawContractState RPC method -message QueryRawContractStateResponse { - // Data contains the raw store data - bytes data = 1; -} - -// QuerySmartContractStateRequest is the request type for the -// Query/SmartContractState RPC method -message QuerySmartContractStateRequest { - // address is the address of the contract - string address = 1; - // QueryData contains the query data passed to the contract - bytes query_data = 2 [ (gogoproto.casttype) = "RawContractMessage" ]; -} - -// QuerySmartContractStateResponse is the response type for the -// Query/SmartContractState RPC method -message QuerySmartContractStateResponse { - // Data contains the json data returned from the smart contract - bytes data = 1 [ (gogoproto.casttype) = "RawContractMessage" ]; -} - -// QueryCodeRequest is the request type for the Query/Code RPC method -message QueryCodeRequest { - uint64 code_id = 1; // grpc-gateway_out does not support Go style CodID -} - -// CodeInfoResponse contains code meta data from CodeInfo -message CodeInfoResponse { - option (gogoproto.equal) = true; - - uint64 code_id = 1 [ - (gogoproto.customname) = "CodeID", - (gogoproto.jsontag) = "id" - ]; // id for legacy support - string creator = 2; - bytes data_hash = 3 - [ (gogoproto.casttype) = - "github.com/cometbft/cometbft/libs/bytes.HexBytes" ]; - // Used in v1beta1 - reserved 4, 5; - AccessConfig instantiate_permission = 6 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; -} - -// QueryCodeResponse is the response type for the Query/Code RPC method -message QueryCodeResponse { - option (gogoproto.equal) = true; - CodeInfoResponse code_info = 1 - [ (gogoproto.embed) = true, (gogoproto.jsontag) = "" ]; - bytes data = 2 [ (gogoproto.jsontag) = "data" ]; -} - -// QueryCodesRequest is the request type for the Query/Codes RPC method -message QueryCodesRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryCodesResponse is the response type for the Query/Codes RPC method -message QueryCodesResponse { - repeated CodeInfoResponse code_infos = 1 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryPinnedCodesRequest is the request type for the Query/PinnedCodes -// RPC method -message QueryPinnedCodesRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryPinnedCodesResponse is the response type for the -// Query/PinnedCodes RPC method -message QueryPinnedCodesResponse { - repeated uint64 code_ids = 1 [ (gogoproto.customname) = "CodeIDs" ]; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// 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, (amino.dont_omitempty) = true ]; -} - -// QueryContractsByCreatorRequest is the request type for the -// Query/ContractsByCreator RPC method. -message QueryContractsByCreatorRequest { - // CreatorAddress is the address of contract creator - string creator_address = 1; - // Pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryContractsByCreatorResponse is the response type for the -// Query/ContractsByCreator RPC method. -message QueryContractsByCreatorResponse { - // ContractAddresses result set - repeated string contract_addresses = 1; - // Pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} \ No newline at end of file diff --git a/proto/cosmwasm/wasm/v1/tx.proto b/proto/cosmwasm/wasm/v1/tx.proto deleted file mode 100644 index 90905f5..0000000 --- a/proto/cosmwasm/wasm/v1/tx.proto +++ /dev/null @@ -1,391 +0,0 @@ -syntax = "proto3"; -package cosmwasm.wasm.v1; - -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/msg/v1/msg.proto"; -import "gogoproto/gogo.proto"; -import "cosmwasm/wasm/v1/types.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; -option (gogoproto.goproto_getters_all) = false; - -// Msg defines the wasm Msg service. -service Msg { - // StoreCode to submit Wasm code to the system - rpc StoreCode(MsgStoreCode) returns (MsgStoreCodeResponse); - // InstantiateContract creates a new smart contract instance for the given - // code id. - rpc InstantiateContract(MsgInstantiateContract) - returns (MsgInstantiateContractResponse); - // InstantiateContract2 creates a new smart contract instance for the given - // code id with a predictable address - rpc InstantiateContract2(MsgInstantiateContract2) - returns (MsgInstantiateContract2Response); - // Execute submits the given message data to a smart contract - rpc ExecuteContract(MsgExecuteContract) returns (MsgExecuteContractResponse); - // Migrate runs a code upgrade/ downgrade for a smart contract - rpc MigrateContract(MsgMigrateContract) returns (MsgMigrateContractResponse); - // UpdateAdmin sets a new admin for a smart contract - rpc UpdateAdmin(MsgUpdateAdmin) returns (MsgUpdateAdminResponse); - // ClearAdmin removes any admin stored for a smart contract - rpc ClearAdmin(MsgClearAdmin) returns (MsgClearAdminResponse); - // UpdateInstantiateConfig updates instantiate config for a smart contract - rpc UpdateInstantiateConfig(MsgUpdateInstantiateConfig) - returns (MsgUpdateInstantiateConfigResponse); - // UpdateParams defines a governance operation for updating the x/wasm - // module parameters. The authority is defined in the keeper. - // - // Since: 0.40 - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - // SudoContract defines a governance operation for calling sudo - // on a contract. The authority is defined in the keeper. - // - // Since: 0.40 - rpc SudoContract(MsgSudoContract) returns (MsgSudoContractResponse); - // PinCodes defines a governance operation for pinning a set of - // code ids in the wasmvm cache. The authority is defined in the keeper. - // - // Since: 0.40 - rpc PinCodes(MsgPinCodes) returns (MsgPinCodesResponse); - // UnpinCodes defines a governance operation for unpinning a set of - // code ids in the wasmvm cache. The authority is defined in the keeper. - // - // Since: 0.40 - rpc UnpinCodes(MsgUnpinCodes) returns (MsgUnpinCodesResponse); - // StoreAndInstantiateContract defines a governance operation for storing - // and instantiating the contract. The authority is defined in the keeper. - // - // Since: 0.40 - rpc StoreAndInstantiateContract(MsgStoreAndInstantiateContract) - returns (MsgStoreAndInstantiateContractResponse); -} - -// MsgStoreCode submit Wasm code to the system -message MsgStoreCode { - option (amino.name) = "wasm/MsgStoreCode"; - option (cosmos.msg.v1.signer) = "sender"; - - // Sender is the actor that signed the messages - string sender = 1; - // WASMByteCode can be raw or gzip compressed - bytes wasm_byte_code = 2 [ (gogoproto.customname) = "WASMByteCode" ]; - // Used in v1beta1 - reserved 3, 4; - // InstantiatePermission access control to apply on contract creation, - // optional - AccessConfig instantiate_permission = 5; -} -// MsgStoreCodeResponse returns store result data. -message MsgStoreCodeResponse { - // CodeID is the reference to the stored WASM code - uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; - // Checksum is the sha256 hash of the stored code - bytes checksum = 2; -} - -// MsgInstantiateContract create a new smart contract instance for the given -// code id. -message MsgInstantiateContract { - option (amino.name) = "wasm/MsgInstantiateContract"; - option (cosmos.msg.v1.signer) = "sender"; - - // Sender is the that actor that signed the messages - string sender = 1; - // Admin is an optional address that can execute migrations - string admin = 2; - // CodeID is the reference to the stored WASM code - uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ]; - // Label is optional metadata to be stored with a contract instance. - string label = 4; - // Msg json encoded message to be passed to the contract on instantiation - bytes msg = 5 [ (gogoproto.casttype) = "RawContractMessage" ]; - // Funds coins that are transferred to the contract on instantiation - repeated cosmos.base.v1beta1.Coin funds = 6 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// MsgInstantiateContractResponse return instantiation result data -message MsgInstantiateContractResponse { - // Address is the bech32 address of the new contract instance. - string address = 1; - // Data contains bytes to returned from the contract - bytes data = 2; -} - -// MsgInstantiateContract2 create a new smart contract instance for the given -// code id with a predicable address. -message MsgInstantiateContract2 { - option (amino.name) = "wasm/MsgInstantiateContract2"; - option (cosmos.msg.v1.signer) = "sender"; - - // Sender is the that actor that signed the messages - string sender = 1; - // Admin is an optional address that can execute migrations - string admin = 2; - // CodeID is the reference to the stored WASM code - uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ]; - // Label is optional metadata to be stored with a contract instance. - string label = 4; - // Msg json encoded message to be passed to the contract on instantiation - bytes msg = 5 [ (gogoproto.casttype) = "RawContractMessage" ]; - // Funds coins that are transferred to the contract on instantiation - repeated cosmos.base.v1beta1.Coin funds = 6 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - // Salt is an arbitrary value provided by the sender. Size can be 1 to 64. - bytes salt = 7; - // FixMsg include the msg value into the hash for the predictable address. - // Default is false - bool fix_msg = 8; -} - -// MsgInstantiateContract2Response return instantiation result data -message MsgInstantiateContract2Response { - // Address is the bech32 address of the new contract instance. - string address = 1; - // Data contains bytes to returned from the contract - bytes data = 2; -} - -// MsgExecuteContract submits the given message data to a smart contract -message MsgExecuteContract { - option (amino.name) = "wasm/MsgExecuteContract"; - option (cosmos.msg.v1.signer) = "sender"; - - // Sender is the that actor that signed the messages - string sender = 1; - // Contract is the address of the smart contract - string contract = 2; - // Msg json encoded message to be passed to the contract - bytes msg = 3 [ (gogoproto.casttype) = "RawContractMessage" ]; - // Funds coins that are transferred to the contract on execution - repeated cosmos.base.v1beta1.Coin funds = 5 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// MsgExecuteContractResponse returns execution result data. -message MsgExecuteContractResponse { - // Data contains bytes to returned from the contract - bytes data = 1; -} - -// MsgMigrateContract runs a code upgrade/ downgrade for a smart contract -message MsgMigrateContract { - option (amino.name) = "wasm/MsgMigrateContract"; - option (cosmos.msg.v1.signer) = "sender"; - - // Sender is the that actor that signed the messages - string sender = 1; - // Contract is the address of the smart contract - string contract = 2; - // CodeID references the new WASM code - uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ]; - // Msg json encoded message to be passed to the contract on migration - bytes msg = 4 [ (gogoproto.casttype) = "RawContractMessage" ]; -} - -// MsgMigrateContractResponse returns contract migration result data. -message MsgMigrateContractResponse { - // Data contains same raw bytes returned as data from the wasm contract. - // (May be empty) - bytes data = 1; -} - -// MsgUpdateAdmin sets a new admin for a smart contract -message MsgUpdateAdmin { - option (amino.name) = "wasm/MsgUpdateAdmin"; - option (cosmos.msg.v1.signer) = "sender"; - - // Sender is the that actor that signed the messages - string sender = 1; - // NewAdmin address to be set - string new_admin = 2; - // Contract is the address of the smart contract - string contract = 3; -} - -// MsgUpdateAdminResponse returns empty data -message MsgUpdateAdminResponse {} - -// MsgClearAdmin removes any admin stored for a smart contract -message MsgClearAdmin { - option (amino.name) = "wasm/MsgClearAdmin"; - option (cosmos.msg.v1.signer) = "sender"; - - // Sender is the actor that signed the messages - string sender = 1; - // Contract is the address of the smart contract - string contract = 3; -} - -// MsgClearAdminResponse returns empty data -message MsgClearAdminResponse {} - -// MsgUpdateInstantiateConfig updates instantiate config for a smart contract -message MsgUpdateInstantiateConfig { - option (amino.name) = "wasm/MsgUpdateInstantiateConfig"; - option (cosmos.msg.v1.signer) = "sender"; - - // Sender is the that actor that signed the messages - string sender = 1; - // CodeID references the stored WASM code - uint64 code_id = 2 [ (gogoproto.customname) = "CodeID" ]; - // NewInstantiatePermission is the new access control - AccessConfig new_instantiate_permission = 3; -} - -// MsgUpdateInstantiateConfigResponse returns empty data -message MsgUpdateInstantiateConfigResponse {} - -// MsgUpdateParams is the MsgUpdateParams request type. -// -// Since: 0.40 -message MsgUpdateParams { - option (amino.name) = "wasm/MsgUpdateParams"; - option (cosmos.msg.v1.signer) = "authority"; - - // Authority is the address of the governance account. - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - - // params defines the x/wasm parameters to update. - // - // NOTE: All parameters must be supplied. - Params params = 2 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -// -// Since: 0.40 -message MsgUpdateParamsResponse {} - -// MsgSudoContract is the MsgSudoContract request type. -// -// Since: 0.40 -message MsgSudoContract { - option (amino.name) = "wasm/MsgSudoContract"; - option (cosmos.msg.v1.signer) = "authority"; - - // Authority is the address of the governance account. - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - - // Contract is the address of the smart contract - string contract = 2; - // Msg json encoded message to be passed to the contract as sudo - bytes msg = 3 [ (gogoproto.casttype) = "RawContractMessage" ]; -} - -// MsgSudoContractResponse defines the response structure for executing a -// MsgSudoContract message. -// -// Since: 0.40 -message MsgSudoContractResponse { - // Data contains bytes to returned from the contract - bytes data = 1; -} - -// MsgPinCodes is the MsgPinCodes request type. -// -// Since: 0.40 -message MsgPinCodes { - option (amino.name) = "wasm/MsgPinCodes"; - option (cosmos.msg.v1.signer) = "authority"; - - // Authority is the address of the governance account. - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - // CodeIDs references the new WASM codes - repeated uint64 code_ids = 2 [ - (gogoproto.customname) = "CodeIDs", - (gogoproto.moretags) = "yaml:\"code_ids\"" - ]; -} - -// MsgPinCodesResponse defines the response structure for executing a -// MsgPinCodes message. -// -// Since: 0.40 -message MsgPinCodesResponse {} - -// MsgUnpinCodes is the MsgUnpinCodes request type. -// -// Since: 0.40 -message MsgUnpinCodes { - option (amino.name) = "wasm/MsgUnpinCodes"; - option (cosmos.msg.v1.signer) = "authority"; - - // Authority is the address of the governance account. - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - // CodeIDs references the WASM codes - repeated uint64 code_ids = 2 [ - (gogoproto.customname) = "CodeIDs", - (gogoproto.moretags) = "yaml:\"code_ids\"" - ]; -} - -// MsgUnpinCodesResponse defines the response structure for executing a -// MsgUnpinCodes message. -// -// Since: 0.40 -message MsgUnpinCodesResponse {} - -// MsgStoreAndInstantiateContract is the MsgStoreAndInstantiateContract -// request type. -// -// Since: 0.40 -message MsgStoreAndInstantiateContract { - option (amino.name) = "wasm/MsgStoreAndInstantiateContract"; - option (cosmos.msg.v1.signer) = "authority"; - - // Authority is the address of the governance account. - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - // WASMByteCode can be raw or gzip compressed - bytes wasm_byte_code = 3 [ (gogoproto.customname) = "WASMByteCode" ]; - // InstantiatePermission to apply on contract creation, optional - AccessConfig instantiate_permission = 4; - // UnpinCode code on upload, optional. As default the uploaded contract is - // pinned to cache. - bool unpin_code = 5; - // Admin is an optional address that can execute migrations - string admin = 6; - // Label is optional metadata to be stored with a constract instance. - string label = 7; - // Msg json encoded message to be passed to the contract on instantiation - bytes msg = 8 [ (gogoproto.casttype) = "RawContractMessage" ]; - // Funds coins that are transferred from the authority account to the contract - // on instantiation - repeated cosmos.base.v1beta1.Coin funds = 9 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - // Source is the URL where the code is hosted - string source = 10; - // Builder is the docker image used to build the code deterministically, used - // for smart contract verification - string builder = 11; - // CodeHash is the SHA256 sum of the code outputted by builder, used for smart - // contract verification - bytes code_hash = 12; -} - -// MsgStoreAndInstantiateContractResponse defines the response structure -// for executing a MsgStoreAndInstantiateContract message. -// -// Since: 0.40 -message MsgStoreAndInstantiateContractResponse { - // Address is the bech32 address of the new contract instance. - string address = 1; - // Data contains bytes to returned from the contract - bytes data = 2; -} \ No newline at end of file diff --git a/proto/cosmwasm/wasm/v1/types.proto b/proto/cosmwasm/wasm/v1/types.proto deleted file mode 100644 index aea10cf..0000000 --- a/proto/cosmwasm/wasm/v1/types.proto +++ /dev/null @@ -1,148 +0,0 @@ -syntax = "proto3"; -package cosmwasm.wasm.v1; - -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; -option (gogoproto.goproto_getters_all) = false; -option (gogoproto.equal_all) = true; - -// AccessType permission types -enum AccessType { - option (gogoproto.goproto_enum_prefix) = false; - option (gogoproto.goproto_enum_stringer) = false; - // AccessTypeUnspecified placeholder for empty value - ACCESS_TYPE_UNSPECIFIED = 0 - [ (gogoproto.enumvalue_customname) = "AccessTypeUnspecified" ]; - // AccessTypeNobody forbidden - ACCESS_TYPE_NOBODY = 1 - [ (gogoproto.enumvalue_customname) = "AccessTypeNobody" ]; - // AccessTypeOnlyAddress restricted to a single address - // Deprecated: use AccessTypeAnyOfAddresses instead - ACCESS_TYPE_ONLY_ADDRESS = 2 - [ (gogoproto.enumvalue_customname) = "AccessTypeOnlyAddress" ]; - // AccessTypeEverybody unrestricted - ACCESS_TYPE_EVERYBODY = 3 - [ (gogoproto.enumvalue_customname) = "AccessTypeEverybody" ]; - // AccessTypeAnyOfAddresses allow any of the addresses - ACCESS_TYPE_ANY_OF_ADDRESSES = 4 - [ (gogoproto.enumvalue_customname) = "AccessTypeAnyOfAddresses" ]; -} - -// AccessTypeParam -message AccessTypeParam { - option (gogoproto.goproto_stringer) = true; - AccessType value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ]; -} - -// AccessConfig access control type. -message AccessConfig { - option (gogoproto.goproto_stringer) = true; - AccessType permission = 1 [ (gogoproto.moretags) = "yaml:\"permission\"" ]; - - // Address - // Deprecated: replaced by addresses - string address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; - repeated string addresses = 3 [ (gogoproto.moretags) = "yaml:\"addresses\"" ]; -} - -// Params defines the set of wasm parameters. -message Params { - option (gogoproto.goproto_stringer) = false; - AccessConfig code_upload_access = 1 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.moretags) = "yaml:\"code_upload_access\"" - ]; - AccessType instantiate_default_permission = 2 - [ (gogoproto.moretags) = "yaml:\"instantiate_default_permission\"" ]; -} - -// CodeInfo is data for the uploaded contract WASM code -message CodeInfo { - // CodeHash is the unique identifier created by wasmvm - bytes code_hash = 1; - // Creator address who initially stored the code - string creator = 2; - // Used in v1beta1 - reserved 3, 4; - // InstantiateConfig access control to apply on contract creation, optional - AccessConfig instantiate_config = 5 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; -} - -// ContractInfo stores a WASM contract instance -message ContractInfo { - option (gogoproto.equal) = true; - - // CodeID is the reference to the stored Wasm code - uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; - // Creator address who initially instantiated the contract - string creator = 2; - // Admin is an optional address that can execute migrations - string admin = 3; - // Label is optional metadata to be stored with a contract instance. - string label = 4; - // Created Tx position when the contract was instantiated. - AbsoluteTxPosition created = 5; - string ibc_port_id = 6 [ (gogoproto.customname) = "IBCPortID" ]; - - // Extension is an extension point to store custom metadata within the - // persistence model. - google.protobuf.Any extension = 7 - [ (cosmos_proto.accepts_interface) = - "cosmwasm.wasm.v1.ContractInfoExtension" ]; -} - -// ContractCodeHistoryOperationType actions that caused a code change -enum ContractCodeHistoryOperationType { - option (gogoproto.goproto_enum_prefix) = false; - // ContractCodeHistoryOperationTypeUnspecified placeholder for empty value - CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0 - [ (gogoproto.enumvalue_customname) = - "ContractCodeHistoryOperationTypeUnspecified" ]; - // ContractCodeHistoryOperationTypeInit on chain contract instantiation - CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1 - [ (gogoproto.enumvalue_customname) = - "ContractCodeHistoryOperationTypeInit" ]; - // ContractCodeHistoryOperationTypeMigrate code migration - CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2 - [ (gogoproto.enumvalue_customname) = - "ContractCodeHistoryOperationTypeMigrate" ]; - // ContractCodeHistoryOperationTypeGenesis based on genesis data - CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3 - [ (gogoproto.enumvalue_customname) = - "ContractCodeHistoryOperationTypeGenesis" ]; -} - -// ContractCodeHistoryEntry metadata to a contract. -message ContractCodeHistoryEntry { - ContractCodeHistoryOperationType operation = 1; - // CodeID is the reference to the stored WASM code - uint64 code_id = 2 [ (gogoproto.customname) = "CodeID" ]; - // Updated Tx position when the operation was executed. - AbsoluteTxPosition updated = 3; - bytes msg = 4 [ (gogoproto.casttype) = "RawContractMessage" ]; -} - -// AbsoluteTxPosition is a unique transaction position that allows for global -// ordering of transactions. -message AbsoluteTxPosition { - // BlockHeight is the block the contract was created at - uint64 block_height = 1; - // TxIndex is a monotonic counter within the block (actual transaction index, - // or gas consumed) - uint64 tx_index = 2; -} - -// Model is a struct that holds a KV pair -message Model { - // hex-encode key to read it better (this is often ascii) - bytes key = 1 [ (gogoproto.casttype) = - "github.com/cometbft/cometbft/libs/bytes.HexBytes" ]; - // base64-encode raw value - bytes value = 2; -} \ No newline at end of file diff --git a/proto/gaia/globalfee/v1beta1/genesis.proto b/proto/gaia/globalfee/v1beta1/genesis.proto new file mode 100644 index 0000000..39493b0 --- /dev/null +++ b/proto/gaia/globalfee/v1beta1/genesis.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package gaia.globalfee.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/cosmos/gaia/x/globalfee/types"; + +// GenesisState - initial state of module +message GenesisState { + // Params of this module + Params params = 1 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "params,omitempty" + ]; +} + +// Params defines the set of module parameters. +message Params { + // Minimum stores the minimum gas price(s) for all TX on the chain. + // When multiple coins are defined then they are accepted alternatively. + // The list must be sorted by denoms asc. No duplicate denoms or zero amount + // values allowed. For more information see + // https://docs.cosmos.network/main/modules/auth#concepts + repeated cosmos.base.v1beta1.DecCoin minimum_gas_prices = 1 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "minimum_gas_prices,omitempty", + (gogoproto.moretags) = "yaml:\"minimum_gas_prices\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; +} diff --git a/proto/gaia/globalfee/v1beta1/query.proto b/proto/gaia/globalfee/v1beta1/query.proto new file mode 100644 index 0000000..81f587c --- /dev/null +++ b/proto/gaia/globalfee/v1beta1/query.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; +package gaia.globalfee.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/cosmos/gaia/x/globalfee/types"; + +// Query defines the gRPC querier service. +service Query { + rpc MinimumGasPrices(QueryMinimumGasPricesRequest) + returns (QueryMinimumGasPricesResponse) { + option (google.api.http).get = + "/gaia/globalfee/v1beta1/minimum_gas_prices"; + } +} + +// QueryMinimumGasPricesRequest is the request type for the +// Query/MinimumGasPrices RPC method. +message QueryMinimumGasPricesRequest {} + +// QueryMinimumGasPricesResponse is the response type for the +// Query/MinimumGasPrices RPC method. +message QueryMinimumGasPricesResponse { + repeated cosmos.base.v1beta1.DecCoin minimum_gas_prices = 1 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "minimum_gas_prices,omitempty", + (gogoproto.moretags) = "yaml:\"minimum_gas_prices\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; +} diff --git a/proto/gaia/globalfee/v1beta1/tx.proto b/proto/gaia/globalfee/v1beta1/tx.proto new file mode 100644 index 0000000..3db2354 --- /dev/null +++ b/proto/gaia/globalfee/v1beta1/tx.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package gaia.globalfee.v1beta1; + +option go_package = "github.com/cosmos/gaia/x/globalfee/types"; + +import "cosmos/msg/v1/msg.proto"; +import "gaia/globalfee/v1beta1/genesis.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; + +// Msg defines the x/globalfee Msg service. +service Msg { + // UpdateParams defines a governance operation for updating the x/mint module + // parameters. The authority is hard-coded to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/mint parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} + \ No newline at end of file diff --git a/proto/cosmwasm/tokenfactory/v1beta1/authority_metadata.proto b/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto similarity index 90% rename from proto/cosmwasm/tokenfactory/v1beta1/authority_metadata.proto rename to proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto index 3d27b3d..019152a 100644 --- a/proto/cosmwasm/tokenfactory/v1beta1/authority_metadata.proto +++ b/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto @@ -1,8 +1,8 @@ syntax = "proto3"; package osmosis.tokenfactory.v1beta1; -import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/terpnetwork/terp-core/x/tokenfactory/types"; @@ -12,6 +12,6 @@ option go_package = "github.com/terpnetwork/terp-core/x/tokenfactory/types"; message DenomAuthorityMetadata { option (gogoproto.equal) = true; - // Can be empty for no admin, or a valid terp address + // Can be empty for no admin, or a valid osmosis address string admin = 1 [ (gogoproto.moretags) = "yaml:\"admin\"" ]; } \ No newline at end of file diff --git a/proto/cosmwasm/tokenfactory/v1beta1/genesis.proto b/proto/osmosis/tokenfactory/v1beta1/genesis.proto similarity index 88% rename from proto/cosmwasm/tokenfactory/v1beta1/genesis.proto rename to proto/osmosis/tokenfactory/v1beta1/genesis.proto index 8b123c5..0917870 100644 --- a/proto/cosmwasm/tokenfactory/v1beta1/genesis.proto +++ b/proto/osmosis/tokenfactory/v1beta1/genesis.proto @@ -2,8 +2,8 @@ syntax = "proto3"; package osmosis.tokenfactory.v1beta1; import "gogoproto/gogo.proto"; -import "cosmwasm/tokenfactory/v1beta1/authority_metadata.proto"; -import "cosmwasm/tokenfactory/v1beta1/params.proto"; +import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; +import "osmosis/tokenfactory/v1beta1/params.proto"; option go_package = "github.com/terpnetwork/terp-core/x/tokenfactory/types"; diff --git a/proto/cosmwasm/tokenfactory/v1beta1/params.proto b/proto/osmosis/tokenfactory/v1beta1/params.proto similarity index 58% rename from proto/cosmwasm/tokenfactory/v1beta1/params.proto rename to proto/osmosis/tokenfactory/v1beta1/params.proto index 2871b8b..09fe921 100644 --- a/proto/cosmwasm/tokenfactory/v1beta1/params.proto +++ b/proto/osmosis/tokenfactory/v1beta1/params.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package osmosis.tokenfactory.v1beta1; import "gogoproto/gogo.proto"; -import "cosmwasm/tokenfactory/v1beta1/authority_metadata.proto"; +import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; @@ -15,4 +15,12 @@ message Params { (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 + ]; } \ No newline at end of file diff --git a/proto/cosmwasm/tokenfactory/v1beta1/query.proto b/proto/osmosis/tokenfactory/v1beta1/query.proto similarity index 95% rename from proto/cosmwasm/tokenfactory/v1beta1/query.proto rename to proto/osmosis/tokenfactory/v1beta1/query.proto index d7e4c42..1e87876 100644 --- a/proto/cosmwasm/tokenfactory/v1beta1/query.proto +++ b/proto/osmosis/tokenfactory/v1beta1/query.proto @@ -4,8 +4,8 @@ package osmosis.tokenfactory.v1beta1; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; -import "cosmwasm/tokenfactory/v1beta1/authority_metadata.proto"; -import "cosmwasm/tokenfactory/v1beta1/params.proto"; +import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; +import "osmosis/tokenfactory/v1beta1/params.proto"; option go_package = "github.com/terpnetwork/terp-core/x/tokenfactory/types"; @@ -68,4 +68,4 @@ message QueryDenomsFromCreatorRequest { // DenomsFromCreator gRPC query. message QueryDenomsFromCreatorResponse { repeated string denoms = 1 [ (gogoproto.moretags) = "yaml:\"denoms\"" ]; -} \ No newline at end of file +} diff --git a/proto/cosmwasm/tokenfactory/v1beta1/tx.proto b/proto/osmosis/tokenfactory/v1beta1/tx.proto similarity index 64% rename from proto/cosmwasm/tokenfactory/v1beta1/tx.proto rename to proto/osmosis/tokenfactory/v1beta1/tx.proto index 365bf5f..8c01724 100644 --- a/proto/cosmwasm/tokenfactory/v1beta1/tx.proto +++ b/proto/osmosis/tokenfactory/v1beta1/tx.proto @@ -4,31 +4,27 @@ package osmosis.tokenfactory.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/bank/v1beta1/bank.proto"; +import "osmosis/tokenfactory/v1beta1/params.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "github.com/terpnetwork/terp-core/x/tokenfactory/types"; // Msg defines the tokefactory module's gRPC message service. service Msg { - // CreateDenom Creates a denom of factory/{creator address}/{subdenom} given - // the denom creator address and the subdenom. Subdenoms can contain - // [a-zA-Z0-9./]. rpc CreateDenom(MsgCreateDenom) returns (MsgCreateDenomResponse); - // Mint is message type that represents a request to mint a new denom. rpc Mint(MsgMint) returns (MsgMintResponse); - // Burn message type that represents a request to burn (i.e., destroy) a - // denom. rpc Burn(MsgBurn) returns (MsgBurnResponse); - // A message type that represents a request to change the administrator of the - // denom. rpc ChangeAdmin(MsgChangeAdmin) returns (MsgChangeAdminResponse); - // A message type that represents a request to set metadata for a - // denomination. rpc SetDenomMetadata(MsgSetDenomMetadata) returns (MsgSetDenomMetadataResponse); + rpc ForceTransfer(MsgForceTransfer) returns (MsgForceTransferResponse); - // ForceTransfer is deactivated for now because we need to think through edge - // cases rpc ForceTransfer(MsgForceTransfer) returns - // (MsgForceTransferResponse); + // UpdateParams defines a governance operation for updating the x/mint module + // parameters. The authority is hard-coded to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgCreateDenom defines the message structure for the CreateDenom gRPC service @@ -47,7 +43,7 @@ message MsgCreateDenom { } // MsgCreateDenomResponse is the return value of MsgCreateDenom -// It returns the full string of the newly created denom. +// It returns the full string of the newly created denom message MsgCreateDenomResponse { string new_token_denom = 1 [ (gogoproto.moretags) = "yaml:\"new_token_denom\"" ]; @@ -61,9 +57,10 @@ message MsgMint { (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false ]; + string mintToAddress = 3 + [ (gogoproto.moretags) = "yaml:\"mint_to_address\"" ]; } -// MsgMintResponse defines the response structure for an executed -// MsgMint message. + message MsgMintResponse {} // MsgBurn is the sdk.Msg type for allowing an admin account to burn @@ -74,9 +71,10 @@ message MsgBurn { (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false ]; + string burnFromAddress = 3 + [ (gogoproto.moretags) = "yaml:\"burn_from_address\"" ]; } -// MsgBurnResponse defines the response structure for an executed -// MsgBurn message. + message MsgBurnResponse {} // MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign @@ -91,22 +89,8 @@ message MsgChangeAdmin { // MsgChangeAdmin message. message MsgChangeAdminResponse {} -// message MsgForceTransfer { -// string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; -// cosmos.base.v1beta1.Coin amount = 2 [ -// (gogoproto.moretags) = "yaml:\"amount\"", -// (gogoproto.nullable) = false -// ]; -// string transferFromAddress = 3 -// [ (gogoproto.moretags) = "yaml:\"transfer_from_address\"" ]; -// string transferToAddress = 4 -// [ (gogoproto.moretags) = "yaml:\"transfer_to_address\"" ]; -// } - -// message MsgForceTransferResponse {} - // MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set -// the denom's bank metadata. +// the denom's bank metadata message MsgSetDenomMetadata { string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; cosmos.bank.v1beta1.Metadata metadata = 2 [ @@ -117,4 +101,39 @@ message MsgSetDenomMetadata { // MsgSetDenomMetadataResponse defines the response structure for an executed // MsgSetDenomMetadata message. -message MsgSetDenomMetadataResponse {} \ No newline at end of file +message MsgSetDenomMetadataResponse {} + +message MsgForceTransfer { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + cosmos.base.v1beta1.Coin amount = 2 [ + (gogoproto.moretags) = "yaml:\"amount\"", + (gogoproto.nullable) = false + ]; + string transferFromAddress = 3 + [ (gogoproto.moretags) = "yaml:\"transfer_from_address\"" ]; + string transferToAddress = 4 + [ (gogoproto.moretags) = "yaml:\"transfer_to_address\"" ]; +} + +message MsgForceTransferResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/mint parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/proto/terp/feeshare/v1/feeshare.proto b/proto/terp/feeshare/v1/feeshare.proto new file mode 100644 index 0000000..2bf1245 --- /dev/null +++ b/proto/terp/feeshare/v1/feeshare.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package terp.feeshare.v1; + +option go_package = "github.com/terpnetwork/terp-core/x/feeshare/types"; + +// FeeShare defines an instance that organizes fee distribution conditions for +// the owner of a given smart contract +message FeeShare { + // contract_address is the bech32 address of a registered contract in string + // form + string contract_address = 1; + // deployer_address is the bech32 address of message sender. It must be the + // same as the contracts admin address. + string deployer_address = 2; + // withdrawer_address is the bech32 address of account receiving the + // transaction fees. + string withdrawer_address = 3; +} diff --git a/proto/terp/feeshare/v1/genesis.proto b/proto/terp/feeshare/v1/genesis.proto new file mode 100644 index 0000000..8a148b8 --- /dev/null +++ b/proto/terp/feeshare/v1/genesis.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package terp.feeshare.v1; + +import "terp/feeshare/v1/feeshare.proto"; +import "gogoproto/gogo.proto"; +option go_package = "github.com/terpnetwork/terp-core/x/feeshare/types"; + +// GenesisState defines the module's genesis state. +message GenesisState { + // params are the feeshare module parameters + Params params = 1 [ (gogoproto.nullable) = false ]; + // FeeShare is a slice of active registered contracts for fee distribution + repeated FeeShare fee_share = 2 [ (gogoproto.nullable) = false ]; +} + +// Params defines the feeshare module params +message Params { + // enable_feeshare defines a parameter to enable the feeshare module + bool enable_fee_share = 1; + // developer_shares defines the proportion of the transaction fees to be + // distributed to the registered contract owner + string developer_shares = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // allowed_denoms defines the list of denoms that are allowed to be paid to + // the contract withdraw addresses. If said denom is not in the list, the fees + // will ONLY be sent to the community pool. + // If this list is empty, all denoms are allowed. + repeated string allowed_denoms = 3; +} diff --git a/proto/terp/feeshare/v1/query.proto b/proto/terp/feeshare/v1/query.proto new file mode 100644 index 0000000..f088611 --- /dev/null +++ b/proto/terp/feeshare/v1/query.proto @@ -0,0 +1,119 @@ +syntax = "proto3"; +package terp.feeshare.v1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "terp/feeshare/v1/genesis.proto"; +import "terp/feeshare/v1/feeshare.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; + +option go_package = "github.com/terpnetwork/terp-core/x/feeshare/types"; + +// Query defines the gRPC querier service. +service Query { + // FeeShares retrieves all registered FeeShares + rpc FeeShares(QueryFeeSharesRequest) returns (QueryFeeSharesResponse) { + option (google.api.http).get = "/terp/feeshare/v1/fee_shares"; + } + + // FeeShare retrieves a registered FeeShare for a given contract address + rpc FeeShare(QueryFeeShareRequest) returns (QueryFeeShareResponse) { + option (google.api.http).get = + "/terp/feeshare/v1/fee_shares/{contract_address}"; + } + + // Params retrieves the FeeShare module params + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/terp/feeshare/v1/params"; + } + + // DeployerFeeShares retrieves all FeeShares that a given deployer has + // registered + rpc DeployerFeeShares(QueryDeployerFeeSharesRequest) + returns (QueryDeployerFeeSharesResponse) { + option (google.api.http).get = + "/terp/feeshare/v1/fee_shares/{deployer_address}"; + } + + // WithdrawerFeeShares retrieves all FeeShares with a given withdrawer + // address + rpc WithdrawerFeeShares(QueryWithdrawerFeeSharesRequest) + returns (QueryWithdrawerFeeSharesResponse) { + option (google.api.http).get = + "/terp/feeshare/v1/fee_shares/{withdrawer_address}"; + } +} + +// QueryFeeSharesRequest is the request type for the Query/FeeShares RPC method. +message QueryFeeSharesRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryFeeSharesResponse is the response type for the Query/FeeShares RPC +// method. +message QueryFeeSharesResponse { + // FeeShare is a slice of all stored Reveneue + repeated FeeShare feeshare = 1 [ (gogoproto.nullable) = false ]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryFeeShareRequest is the request type for the Query/FeeShare RPC method. +message QueryFeeShareRequest { + // contract_address of a registered contract in bech32 format + string contract_address = 1; +} + +// QueryFeeShareResponse is the response type for the Query/FeeShare RPC method. +message QueryFeeShareResponse { + // FeeShare is a stored Reveneue for the queried contract + FeeShare feeshare = 1 [ (gogoproto.nullable) = false ]; +} + +// 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 is the returned FeeShare parameter + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryDeployerFeeSharesRequest is the request type for the +// Query/DeployerFeeShares RPC method. +message QueryDeployerFeeSharesRequest { + // deployer_address in bech32 format + string deployer_address = 1; + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDeployerFeeSharesResponse is the response type for the +// Query/DeployerFeeShares RPC method. +message QueryDeployerFeeSharesResponse { + // contract_addresses is the slice of registered contract addresses for a + // deployer + repeated string contract_addresses = 1; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryWithdrawerFeeSharesRequest is the request type for the +// Query/WithdrawerFeeShares RPC method. +message QueryWithdrawerFeeSharesRequest { + // withdrawer_address in bech32 format + string withdrawer_address = 1; + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryWithdrawerFeeSharesResponse is the response type for the +// Query/WithdrawerFeeShares RPC method. +message QueryWithdrawerFeeSharesResponse { + // contract_addresses is the slice of registered contract addresses for a + // withdrawer + repeated string contract_addresses = 1; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/proto/terp/feeshare/v1/tx.proto b/proto/terp/feeshare/v1/tx.proto new file mode 100644 index 0000000..b9ec716 --- /dev/null +++ b/proto/terp/feeshare/v1/tx.proto @@ -0,0 +1,97 @@ +syntax = "proto3"; +package terp.feeshare.v1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "terp/feeshare/v1/genesis.proto"; + +option go_package = "github.com/terpnetwork/terp-core/x/feeshare/types"; + +// Msg defines the fees Msg service. +service Msg { + // RegisterFeeShare registers a new contract for receiving transaction fees + rpc RegisterFeeShare(MsgRegisterFeeShare) + returns (MsgRegisterFeeShareResponse) { + option (google.api.http).post = "/terp/feeshare/v1/tx/register_FeeShare"; + }; + // UpdateFeeShare updates the withdrawer address of a FeeShare + rpc UpdateFeeShare(MsgUpdateFeeShare) returns (MsgUpdateFeeShareResponse) { + option (google.api.http).post = "/terp/feeshare/v1/tx/update_FeeShare"; + }; + // CancelFeeShare cancels a contract's fee registration and further receival + // of transaction fees + rpc CancelFeeShare(MsgCancelFeeShare) returns (MsgCancelFeeShareResponse) { + option (google.api.http).post = "/terp/feeshare/v1/tx/cancel_FeeShare"; + }; + // Update the params of the module through gov v1 type. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgRegisterFeeShare defines a message that registers a FeeShare +message MsgRegisterFeeShare { + option (gogoproto.equal) = false; + // contract_address in bech32 format + string contract_address = 1; + // deployer_address is the bech32 address of message sender. It must be the + // same the contract's admin address + string deployer_address = 2; + // withdrawer_address is the bech32 address of account receiving the + // transaction fees + string withdrawer_address = 3; +} + +// MsgRegisterFeeShareResponse defines the MsgRegisterFeeShare response type +message MsgRegisterFeeShareResponse {} + +// MsgUpdateFeeShare defines a message that updates the withdrawer address for a +// registered FeeShare +message MsgUpdateFeeShare { + option (gogoproto.equal) = false; + // contract_address in bech32 format + string contract_address = 1; + // deployer_address is the bech32 address of message sender. It must be the + // same the contract's admin address + string deployer_address = 2; + // withdrawer_address is the bech32 address of account receiving the + // transaction fees + string withdrawer_address = 3; +} + +// MsgUpdateFeeShareResponse defines the MsgUpdateFeeShare response type +message MsgUpdateFeeShareResponse {} + +// MsgCancelFeeShare defines a message that cancels a registered FeeShare +message MsgCancelFeeShare { + option (gogoproto.equal) = false; + // contract_address in bech32 format + string contract_address = 1; + // deployer_address is the bech32 address of message sender. It must be the + // same the contract's admin address + string deployer_address = 2; +} + +// MsgCancelFeeShareResponse defines the MsgCancelFeeShare response type +message MsgCancelFeeShareResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/feeshare parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} \ No newline at end of file