Skip to content

Commit

Permalink
feat: reards auction proto
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba committed Mar 22, 2024
1 parent 6dccda9 commit cd38047
Show file tree
Hide file tree
Showing 10 changed files with 3,167 additions and 1 deletion.
15 changes: 15 additions & 0 deletions proto/umee/auction/v1/auction.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
syntax = "proto3";
package umee.auction.v1;

import "gogoproto/gogo.proto";

option go_package = "github.com/umee-network/umee/v6/x/auction";
option (gogoproto.goproto_getters_all) = false;

// RewardsParams defines parameters for the rewards auction.
message RewardsParams {
// auction_duration is duration in seconds.
int64 auction_duration = 1;
// min_bid_increment (nominal) in the base denom for each consequitive bid.
int64 min_bid_increment = 2;
}
19 changes: 19 additions & 0 deletions proto/umee/auction/v1/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto3";
package umee.auction.v1;

import "cosmos/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";
import "umee/auction/v1/auction.proto";

option go_package = "github.com/umee-network/umee/v6/x/auction";

option (gogoproto.goproto_getters_all) = false;
// option (gogoproto.equal_all) = false;

// GenesisState defines the x/auction module's genesis state.
message GenesisState {
RewardsParams rewards_params = 1 [(gogoproto.nullable) = false];
uint64 reward_round = 2;
string highest_bidder = 3;
repeated cosmos.base.v1beta1.Coin reward_tokens = 4 [(gogoproto.nullable) = false];
}
40 changes: 40 additions & 0 deletions proto/umee/auction/v1/query.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
syntax = "proto3";
package umee.auction.v1;

import "google/api/annotations.proto";
import "gogoproto/gogo.proto";
import "umee/auction/v1/auction.proto";
import "cosmos/base/v1beta1/coin.proto";

option go_package = "github.com/umee-network/umee/v6/x/auction";

// Query defines the gRPC querier service.
service Query {
// RewardParams queries parameters for the reward auciton.
rpc RewardParams(QueryRewardParams) returns (QueryRewardParamsResp) {

Check failure on line 14 in proto/umee/auction/v1/query.proto

View workflow job for this annotation

GitHub Actions / buf-lint

RPC response type "QueryRewardParamsResp" should be named "RewardParamsResponse" or "QueryRewardParamsResponse".
option (google.api.http).get = "/umee/auction/v1/rewards/params";
}
// RewardAuction queries the information of the auction by ID. If ID is ommitted, returns
// current reward auction params.
rpc RewardAuction(QueryRewardAuction) returns (QueryRewardAuctionResp) {

Check failure on line 19 in proto/umee/auction/v1/query.proto

View workflow job for this annotation

GitHub Actions / buf-lint

RPC response type "QueryRewardAuctionResp" should be named "RewardAuctionResponse" or "QueryRewardAuctionResponse".
option (google.api.http).get = "/umee/auction/v1/rewards/{id}";
}
}

message QueryRewardParams {}

Check failure on line 24 in proto/umee/auction/v1/query.proto

View workflow job for this annotation

GitHub Actions / buf-lint

Message "QueryRewardParams" should have a non-empty comment for documentation.

message QueryRewardParamsResp {

Check failure on line 26 in proto/umee/auction/v1/query.proto

View workflow job for this annotation

GitHub Actions / buf-lint

Message "QueryRewardParamsResp" should have a non-empty comment for documentation.
RewardsParams params = 1 [(gogoproto.nullable) = false];
}

message QueryRewardAuction {

Check failure on line 30 in proto/umee/auction/v1/query.proto

View workflow job for this annotation

GitHub Actions / buf-lint

Message "QueryRewardAuction" should have a non-empty comment for documentation.
// If zero or not present, the current auction is returned
uint32 id = 1;
}

message QueryRewardAuctionResp {

Check failure on line 35 in proto/umee/auction/v1/query.proto

View workflow job for this annotation

GitHub Actions / buf-lint

Message "QueryRewardAuctionResp" should have a non-empty comment for documentation.
uint32 id = 1;
// highest bidder
string bidder = 2;
repeated cosmos.base.v1beta1.Coin rewards = 3 [(gogoproto.nullable) = false];
}
49 changes: 49 additions & 0 deletions proto/umee/auction/v1/tx.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
syntax = "proto3";
package umee.auction.v1;

import "cosmos/base/v1beta1/coin.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/msg/v1/msg.proto";
import "gogoproto/gogo.proto";
import "umee/auction/v1/auction.proto";

option go_package = "github.com/umee-network/umee/v6/x/auction";
option (gogoproto.goproto_getters_all) = false;

// Msg defines the x/auction module's Msg service.
service Msg {
//
// Rewards auction: bid umee for protocol rewards
//

rpc GovSetRewardsParams(MsgGovSetRewardsParams) returns (MsgGovSetRewardsParamsResp);

Check failure on line 19 in proto/umee/auction/v1/tx.proto

View workflow job for this annotation

GitHub Actions / buf-lint

RPC "GovSetRewardsParams" should have a non-empty comment for documentation.

Check failure on line 19 in proto/umee/auction/v1/tx.proto

View workflow job for this annotation

GitHub Actions / buf-lint

RPC response type "MsgGovSetRewardsParamsResp" should be named "GovSetRewardsParamsResponse" or "MsgGovSetRewardsParamsResponse".
rpc RewardsBid(MsgRewardsBid) returns (MsgRewardsBidResp);

Check failure on line 20 in proto/umee/auction/v1/tx.proto

View workflow job for this annotation

GitHub Actions / buf-lint

RPC "RewardsBid" should have a non-empty comment for documentation.

Check failure on line 20 in proto/umee/auction/v1/tx.proto

View workflow job for this annotation

GitHub Actions / buf-lint

RPC response type "MsgRewardsBidResp" should be named "RewardsBidResponse" or "MsgRewardsBidResponse".
}

// MsgGovSetRewardsParams updates rewards parameters.
message MsgGovSetRewardsParams {
option (gogoproto.equal) = true;
option (gogoproto.goproto_getters) = false;
option (cosmos.msg.v1.signer) = "authority";

// authority must be the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
RewardsParams params = 2 [(gogoproto.nullable) = false];
}

// MsgGovSetRewardsParamsResp defines the Msg/GovSetRewardsParams response type.
message MsgGovSetRewardsParamsResp {}

// MsgRewardsBid places a bid for a reword auction.
message MsgRewardsBid {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
string sender = 1;
// amount of the bid in the base tokens
cosmos.base.v1beta1.Coin bid_amount = 2 [(gogoproto.nullable) = false];
// the current auction ID being bid on. Fails if the ID is not an ID of the current auction.
uint32 id = 3;
}

// MsgRewardsBidResp response type for Msg/RewardsBid
message MsgRewardsBidResp {}
2 changes: 1 addition & 1 deletion proto/umee/ugov/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ message MsgGovUpdateInflationParams {
}

// GovUpdateInflationParamsResponse response type.
message GovUpdateInflationParamsResponse {}
message GovUpdateInflationParamsResponse {}
Loading

0 comments on commit cd38047

Please sign in to comment.