2024-02-09 08:44:45 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package cerc.auction.v1;
|
|
|
|
|
|
|
|
import "gogoproto/gogo.proto";
|
|
|
|
import "google/protobuf/duration.proto";
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
import "cosmos/base/v1beta1/coin.proto";
|
|
|
|
|
2024-04-01 09:57:26 +00:00
|
|
|
option go_package = "git.vdb.to/cerc-io/laconicd/x/auction";
|
2024-02-15 07:08:32 +00:00
|
|
|
|
2024-02-09 08:44:45 +00:00
|
|
|
// Params defines the auction module parameters
|
|
|
|
message Params {
|
|
|
|
// Write custom stringer method
|
|
|
|
option (gogoproto.goproto_stringer) = false;
|
|
|
|
|
|
|
|
// Duration of the commits phase in seconds
|
|
|
|
google.protobuf.Duration commits_duration = 1 [
|
2024-03-07 11:25:15 +00:00
|
|
|
(gogoproto.nullable) = false,
|
2024-02-09 08:44:45 +00:00
|
|
|
(gogoproto.stdduration) = true,
|
2024-03-07 11:25:15 +00:00
|
|
|
(gogoproto.moretags) = "json:\"commits_duration\" yaml:\"commits_duration\""
|
2024-02-09 08:44:45 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
// Duration of the reveals phase in seconds
|
|
|
|
google.protobuf.Duration reveals_duration = 2 [
|
2024-03-07 11:25:15 +00:00
|
|
|
(gogoproto.nullable) = false,
|
2024-02-09 08:44:45 +00:00
|
|
|
(gogoproto.stdduration) = true,
|
2024-03-07 11:25:15 +00:00
|
|
|
(gogoproto.moretags) = "json:\"reveals_duration\" yaml:\"reveals_duration\""
|
2024-02-09 08:44:45 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
// Commit fees
|
|
|
|
cosmos.base.v1beta1.Coin commit_fee = 3 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\""
|
|
|
|
];
|
|
|
|
|
|
|
|
// Reveal fees
|
|
|
|
cosmos.base.v1beta1.Coin reveal_fee = 4 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\""
|
|
|
|
];
|
|
|
|
|
|
|
|
// Minimum acceptable bid amount
|
|
|
|
cosmos.base.v1beta1.Coin minimum_bid = 5 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\""
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
// Auction represents a sealed-bid on-chain auction
|
|
|
|
message Auction {
|
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
|
2024-03-07 11:25:15 +00:00
|
|
|
string id = 1;
|
2024-02-09 08:44:45 +00:00
|
|
|
string status = 2;
|
|
|
|
|
|
|
|
// Address of the creator of the auction
|
|
|
|
string owner_address = 3;
|
|
|
|
|
|
|
|
// Timestamp at which the auction was created
|
|
|
|
google.protobuf.Timestamp create_time = 4 [
|
2024-03-07 11:25:15 +00:00
|
|
|
(gogoproto.stdtime) = true,
|
2024-02-09 08:44:45 +00:00
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"create_time\" yaml:\"create_time\""
|
|
|
|
];
|
|
|
|
|
|
|
|
// Timestamp at which the commits phase concluded
|
|
|
|
google.protobuf.Timestamp commits_end_time = 5 [
|
2024-03-07 11:25:15 +00:00
|
|
|
(gogoproto.stdtime) = true,
|
2024-02-09 08:44:45 +00:00
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"commits_end_time\" yaml:\"commits_end_time\""
|
|
|
|
];
|
|
|
|
|
|
|
|
// Timestamp at which the reveals phase concluded
|
|
|
|
google.protobuf.Timestamp reveals_end_time = 6 [
|
2024-03-07 11:25:15 +00:00
|
|
|
(gogoproto.stdtime) = true,
|
2024-02-09 08:44:45 +00:00
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"reveals_end_time\" yaml:\"reveals_end_time\""
|
|
|
|
];
|
|
|
|
|
|
|
|
// Commit and reveal fees must both be paid when committing a bid
|
|
|
|
// Reveal fee is returned only if the bid is revealed
|
|
|
|
cosmos.base.v1beta1.Coin commit_fee = 7 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\""
|
|
|
|
];
|
|
|
|
cosmos.base.v1beta1.Coin reveal_fee = 8 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\""
|
|
|
|
];
|
|
|
|
|
|
|
|
// Minimum acceptable bid amount for a valid commit
|
|
|
|
cosmos.base.v1beta1.Coin minimum_bid = 9 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\""
|
|
|
|
];
|
|
|
|
|
|
|
|
// Address of the winner
|
|
|
|
string winner_address = 10;
|
|
|
|
|
|
|
|
// Winning bid, i.e., the highest bid
|
|
|
|
cosmos.base.v1beta1.Coin winning_bid = 11 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"winning_bid\" yaml:\"winning_bid\""
|
|
|
|
];
|
|
|
|
|
|
|
|
// Amount the winner pays, i.e. the second highest auction
|
|
|
|
cosmos.base.v1beta1.Coin winning_price = 12 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"winning_price\" yaml:\"winning_price\""
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2024-03-07 11:25:15 +00:00
|
|
|
// Auctions represent all the auctions in the module
|
2024-02-09 08:44:45 +00:00
|
|
|
message Auctions {
|
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
|
2024-03-07 11:25:15 +00:00
|
|
|
repeated Auction auctions = 1 [ (gogoproto.nullable) = false ];
|
2024-02-09 08:44:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Bid represents a sealed bid (commit) made during the auction
|
|
|
|
message Bid {
|
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
|
2024-03-07 11:25:15 +00:00
|
|
|
string auction_id = 1;
|
|
|
|
string bidder_address = 2;
|
|
|
|
string status = 3;
|
|
|
|
string commit_hash = 4;
|
2024-02-09 08:44:45 +00:00
|
|
|
|
2024-03-07 11:25:15 +00:00
|
|
|
google.protobuf.Timestamp commit_time = 5 [
|
|
|
|
(gogoproto.stdtime) = true,
|
2024-02-09 08:44:45 +00:00
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"commit_time\" yaml:\"commit_time\""
|
|
|
|
];
|
|
|
|
|
|
|
|
cosmos.base.v1beta1.Coin commit_fee = 6 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\""
|
|
|
|
];
|
|
|
|
|
|
|
|
google.protobuf.Timestamp reveal_time = 7 [
|
2024-03-07 11:25:15 +00:00
|
|
|
(gogoproto.stdtime) = true,
|
2024-02-09 08:44:45 +00:00
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"reveal_time\" yaml:\"reveal_time\""
|
|
|
|
];
|
|
|
|
|
|
|
|
cosmos.base.v1beta1.Coin reveal_fee = 8 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\""
|
|
|
|
];
|
|
|
|
|
|
|
|
cosmos.base.v1beta1.Coin bid_amount = 9 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"bid_amount\" yaml:\"bid_amount\""
|
|
|
|
];
|
|
|
|
}
|