-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(x/ecocredit): update batch proto to support dynamic minting #937
Changes from 10 commits
19e9506
f59cc0c
2afd92f
6a401ca
19d90da
ff27970
fdbaf9a
286bfcc
d005b03
86873b2
e7b570c
18ccb52
7269996
67393d5
d141133
b5c8ad4
41eca96
1cef6d1
ee04a29
9035092
a7d6323
5977f4b
694a82a
087c0c3
0161a5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,16 @@ service Msg { | |
// be distributed to recipients in either tradable or retired form. | ||
rpc CreateBatch(MsgCreateBatch) returns (MsgCreateBatchResponse); | ||
|
||
// MintBatch issues new token in a given batch. | ||
// The issuer must be the account who created (or delegated using x/authz), | ||
// the batch. | ||
// The request will fail if the batch is locked. | ||
// NOTE: this method is only for bridge purpose. It must not be used | ||
robert-zaremba marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// for issuing native credits on Regen. More specifically, we | ||
// enable minting more credits in an existing batch, when the batch | ||
robert-zaremba marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// represents a vintage originally registered in another chain. | ||
rpc MintBatch(MsgMintBatch) returns (MsgMintBatchResponse); | ||
|
||
// Send sends tradable credits from one account to another account. Sent | ||
// credits can either be tradable or retired on receipt. | ||
rpc Send(MsgSend) returns (MsgSendResponse); | ||
|
@@ -133,30 +143,34 @@ message MsgCreateBatch { | |
// quantified and verified. | ||
google.protobuf.Timestamp end_date = 6 [ (gogoproto.stdtime) = true ]; | ||
|
||
// BatchIssuance represents the issuance of some credits in a batch to a | ||
// single recipient. | ||
message BatchIssuance { | ||
// If unlocked is set to true, we will seal the batch and disable the | ||
robert-zaremba marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// future minting. | ||
bool unlocked = 7; | ||
} | ||
|
||
// recipient is the account of the recipient. | ||
string recipient = 1; | ||
// BatchIssuance represents the issuance of some credits in a batch to a | ||
// single recipient. | ||
message BatchIssuance { | ||
ryanchristo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// tradable_amount is the number of credits in this issuance that can be | ||
// traded by this recipient. Decimal values are acceptable. | ||
string tradable_amount = 2; | ||
// recipient is the account of the recipient. | ||
string recipient = 1; | ||
|
||
// retired_amount is the number of credits in this issuance that are | ||
// effectively retired by the issuer on receipt. Decimal values are | ||
// acceptable. | ||
string retired_amount = 3; | ||
// tradable_amount is the number of credits in this issuance that can be | ||
// traded by this recipient. Decimal values are acceptable. | ||
string tradable_amount = 2; | ||
|
||
// retirement_location is the location of the beneficiary or buyer of the | ||
// retired credits. This must be provided if retired_amount is positive. It | ||
// is a string of the form | ||
// <country-code>[-<sub-national-code>[ <postal-code>]], with the first two | ||
// fields conforming to ISO 3166-2, and postal-code being up to 64 | ||
// alphanumeric characters. | ||
string retirement_location = 4; | ||
} | ||
// retired_amount is the number of credits in this issuance that are | ||
// effectively retired by the issuer on receipt. Decimal values are | ||
// acceptable. | ||
string retired_amount = 3; | ||
|
||
// retirement_location is the location of the beneficiary or buyer of the | ||
// retired credits. This must be provided if retired_amount is positive. It | ||
// is a string of the form | ||
// <country-code>[-<sub-national-code>[ <postal-code>]], with the first two | ||
// fields conforming to ISO 3166-2, and postal-code being up to 64 | ||
// alphanumeric characters. | ||
string retirement_location = 4; | ||
} | ||
|
||
// MsgCreateBatchResponse is the Msg/CreateBatch response type. | ||
|
@@ -165,6 +179,39 @@ message MsgCreateBatchResponse { | |
string batch_denom = 1; | ||
} | ||
|
||
// MsgMintBatch is a request type for MintBatch Msg RPC. | ||
message MsgMintBatch { | ||
// Issuer must equal to the batch.issuer address. | ||
// Signer of the msg. | ||
string issuer = 1; | ||
|
||
// issuance are the credits issued in the batch. | ||
repeated BatchIssuance issuance = 2; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If there are multiple We could alternatively evaluate nesting Also- do we need to support I see a few options: All issuances from bridges must happen through
|
||
|
||
// A reference to a transaction or an event referencing the transaction | ||
// which caused the transfer from other chain or registry. | ||
OriginTx origin_tx = 3; | ||
|
||
// reference note for accounting, will be passed to an event | ||
string note = 4; | ||
|
||
// If unlocked=true keeps the batch unlocked for future minting. | ||
// Othrwise it will lock the batch after the mint. | ||
// Will throw an error if the batch is already locked. | ||
bool unlocked = 5; | ||
|
||
message OriginTx { | ||
// type of the transaction originating the mint process. Eg: Polygon, | ||
// Ethereum, Verra, | ||
string typ = 1; | ||
// the id of a transaction based on a type (tx id, serial number) | ||
string id = 2; | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both, the |
||
|
||
// MsgMintBatchResponse is the Msg/MintBatch response type. | ||
message MsgMintBatchResponse {} | ||
|
||
// MsgSend is the Msg/Send request type. | ||
message MsgSend { | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we have
enable_future_minting
,max_supply
is not needed any more. so I removedmax_supply
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think the default should be sealed. So if we want a different name let's use
open
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's in the state, so we control the defaults. Good naming is a challenge.
If we want to rename this, then let's use
open
everywhere.