Skip to content
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: mint large amount of coins(gov mint) #709

Merged
merged 16 commits into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/wasm) [\#649](https://github.com/line/lbm-sdk/pull/649) fix: wasm module's FIXME in the snapshotter.go file
* (x/ibc) [\#651](https://github.com/line/lbm-sdk/pull/651) feat: update x/ibc to support github.com/cosmos/ibc-go@v3.0.0
* (config) [\#665](https://github.com/line/lbm-sdk/pull/665) remove bech32-cache-size
* (x/foundation) [\#709](https://github.com/line/lbm-sdk/pull/709) add `one time mint` for x/foundation proposal

### Improvements

Expand Down
46 changes: 46 additions & 0 deletions docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,7 @@
- [EventFundTreasury](#lbm.foundation.v1.EventFundTreasury)
- [EventGrant](#lbm.foundation.v1.EventGrant)
- [EventLeaveFoundation](#lbm.foundation.v1.EventLeaveFoundation)
- [EventOneTimeMint](#lbm.foundation.v1.EventOneTimeMint)
- [EventRevoke](#lbm.foundation.v1.EventRevoke)
- [EventSubmitProposal](#lbm.foundation.v1.EventSubmitProposal)
- [EventUpdateDecisionPolicy](#lbm.foundation.v1.EventUpdateDecisionPolicy)
Expand Down Expand Up @@ -1173,6 +1174,8 @@
- [MsgGrantResponse](#lbm.foundation.v1.MsgGrantResponse)
- [MsgLeaveFoundation](#lbm.foundation.v1.MsgLeaveFoundation)
- [MsgLeaveFoundationResponse](#lbm.foundation.v1.MsgLeaveFoundationResponse)
- [MsgOneTimeMint](#lbm.foundation.v1.MsgOneTimeMint)
- [MsgOneTimeMintResponse](#lbm.foundation.v1.MsgOneTimeMintResponse)
- [MsgRevoke](#lbm.foundation.v1.MsgRevoke)
- [MsgRevokeResponse](#lbm.foundation.v1.MsgRevokeResponse)
- [MsgSubmitProposal](#lbm.foundation.v1.MsgSubmitProposal)
Expand Down Expand Up @@ -17126,6 +17129,21 @@ EventLeaveFoundation is an event emitted when a foundation member leaves the fou



<a name="lbm.foundation.v1.EventOneTimeMint"></a>

### EventOneTimeMint
EventOneTimeMint is an event emitted when the minter mint coins to the treasury.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | |






<a name="lbm.foundation.v1.EventRevoke"></a>

### EventRevoke
Expand Down Expand Up @@ -17281,6 +17299,7 @@ GenesisState defines the foundation module's genesis state.
| `votes` | [Vote](#lbm.foundation.v1.Vote) | repeated | votes is the list of votes. |
| `authorizations` | [GrantAuthorization](#lbm.foundation.v1.GrantAuthorization) | repeated | grants |
| `pool` | [Pool](#lbm.foundation.v1.Pool) | | pool |
| `oneTimeMintLeftCount` | [uint32](#uint32) | | oneTimeMintLeftCount is one time mint max count |



Expand Down Expand Up @@ -17785,6 +17804,32 @@ MsgLeaveFoundationResponse is the Msg/LeaveFoundation response type.



<a name="lbm.foundation.v1.MsgOneTimeMint"></a>

### MsgOneTimeMint
MsgOneTimeMint represents a message to mint coins to the treasury only one-time.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `operator` | [string](#string) | | |
| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | |






<a name="lbm.foundation.v1.MsgOneTimeMintResponse"></a>

### MsgOneTimeMintResponse
MsgOneTimeMintResponse defines the Msg/OneTimeMint response type.






<a name="lbm.foundation.v1.MsgRevoke"></a>

### MsgRevoke
Expand Down Expand Up @@ -18016,6 +18061,7 @@ Msg defines the foundation Msg service.
| `LeaveFoundation` | [MsgLeaveFoundation](#lbm.foundation.v1.MsgLeaveFoundation) | [MsgLeaveFoundationResponse](#lbm.foundation.v1.MsgLeaveFoundationResponse) | LeaveFoundation allows a member to leave the foundation. | |
| `Grant` | [MsgGrant](#lbm.foundation.v1.MsgGrant) | [MsgGrantResponse](#lbm.foundation.v1.MsgGrantResponse) | Grant grants the provided authorization to the grantee with authority of the foundation. If there is already a grant for the given (granter, grantee, Authorization) tuple, then the grant will be overwritten. | |
| `Revoke` | [MsgRevoke](#lbm.foundation.v1.MsgRevoke) | [MsgRevokeResponse](#lbm.foundation.v1.MsgRevokeResponse) | Revoke revokes any authorization corresponding to the provided method name on the granter that has been granted to the grantee. | |
| `OneTimeMint` | [MsgOneTimeMint](#lbm.foundation.v1.MsgOneTimeMint) | [MsgOneTimeMintResponse](#lbm.foundation.v1.MsgOneTimeMintResponse) | OneTimeMint defines a one-time mint coins to the treasury. | |

<!-- end services -->

Expand Down
6 changes: 6 additions & 0 deletions proto/lbm/foundation/v1/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,9 @@ message EventRevoke {
// message type url for which an autorization is revoked.
string msg_type_url = 3;
}

// EventOneTimeMint is an event emitted when the minter mint coins to the treasury.
message EventOneTimeMint {
repeated cosmos.base.v1beta1.Coin amount = 1
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/line/lbm-sdk/types.Coins"];
}
3 changes: 3 additions & 0 deletions proto/lbm/foundation/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ message GenesisState {

// pool
Pool pool = 8 [(gogoproto.nullable) = false];

// oneTimeMintLeftCount is one time mint max count
uint32 oneTimeMintLeftCount = 9;
}

// GrantAuthorization defines authorization grant to grantee via route.
Expand Down
13 changes: 13 additions & 0 deletions proto/lbm/foundation/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ service Msg {
// Revoke revokes any authorization corresponding to the provided method name on the
// granter that has been granted to the grantee.
rpc Revoke(MsgRevoke) returns (MsgRevokeResponse);

// OneTimeMint defines a one-time mint coins to the treasury.
rpc OneTimeMint(MsgOneTimeMint) returns (MsgOneTimeMintResponse);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add cli and cli unittest.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case of one-time mint, it is not appropriate to expose it to the cli because it should be performed only through proposals.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other proposal tx also has cli and cli test. For example, WithdrawFromTreasury and Grant. Check it please.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added cli and cli test. Thank you.

}

// MsgFundTreasury represents a message to fund the treasury.
Expand Down Expand Up @@ -213,3 +216,13 @@ message MsgRevoke {

// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type.
message MsgRevokeResponse {}

// MsgOneTimeMint represents a message to mint coins to the treasury only one-time.
message MsgOneTimeMint {
string operator = 1;
repeated cosmos.base.v1beta1.Coin amount = 2
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/line/lbm-sdk/types.Coins"];
}

// MsgOneTimeMintResponse defines the Msg/OneTimeMint response type.
message MsgOneTimeMintResponse {}
1 change: 1 addition & 0 deletions simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ var (
distrtypes.ModuleName: nil,
foundation.TreasuryName: nil,
foundation.AdministratorName: nil,
foundation.OneTimeMinterName: {authtypes.Minter},
minttypes.ModuleName: {authtypes.Minter},
stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking},
stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking},
Expand Down
1 change: 1 addition & 0 deletions x/foundation/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
&MsgLeaveFoundation{},
&MsgGrant{},
&MsgRevoke{},
&MsgOneTimeMint{},
)

msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
Expand Down
Loading