diff --git a/proto/comdex/vault/v1beta1/tx.proto b/proto/comdex/vault/v1beta1/tx.proto index c9cdca40f..84298e202 100644 --- a/proto/comdex/vault/v1beta1/tx.proto +++ b/proto/comdex/vault/v1beta1/tx.proto @@ -190,6 +190,13 @@ message MsgVaultInterestCalcRequest { message MsgVaultInterestCalcResponse{} +message MsgWithdrawStableMintControlRequest { + string from = 1 [ (gogoproto.moretags) = "yaml:\"from\"" ]; + uint64 app_id = 2 [(gogoproto.moretags) = "yaml:\"app_id\""]; +} + +message MsgWithdrawStableMintControlResponse{} + service Msg { rpc MsgCreate(MsgCreateRequest) returns (MsgCreateResponse); rpc MsgDeposit(MsgDepositRequest) returns (MsgDepositResponse); @@ -202,4 +209,5 @@ service Msg { rpc MsgDepositStableMint(MsgDepositStableMintRequest) returns (MsgDepositStableMintResponse); rpc MsgWithdrawStableMint(MsgWithdrawStableMintRequest) returns (MsgWithdrawStableMintResponse); rpc MsgVaultInterestCalc(MsgVaultInterestCalcRequest) returns (MsgVaultInterestCalcResponse); + rpc MsgWithdrawStableMintControl(MsgWithdrawStableMintControlRequest) returns (MsgWithdrawStableMintControlResponse); } diff --git a/x/vault/client/cli/tx.go b/x/vault/client/cli/tx.go index f71f0c89a..414d131a2 100644 --- a/x/vault/client/cli/tx.go +++ b/x/vault/client/cli/tx.go @@ -36,6 +36,7 @@ func GetTxCmd() *cobra.Command { DepositStableMint(), WithdrawStableMint(), CalculateInterest(), + StableMintWithdrawControl(), ) return cmd @@ -500,3 +501,34 @@ func CalculateInterest() *cobra.Command { flags.AddTxFlagsToCmd(cmd) return cmd } + +func StableMintWithdrawControl() *cobra.Command { + cmd := &cobra.Command{ + Use: "stablemint-control [appID]", + Short: "control stable mint vault withdrawal", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + + ctx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + appID, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + + msg := types.NewMsgWithdrawStableMintControlRequest(ctx.FromAddress, appID) + + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(ctx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} \ No newline at end of file diff --git a/x/vault/expected/keeper.go b/x/vault/expected/keeper.go index b0ba1b0d8..fcc1266a3 100644 --- a/x/vault/expected/keeper.go +++ b/x/vault/expected/keeper.go @@ -41,6 +41,7 @@ type EsmKeeper interface { GetESMStatus(ctx sdk.Context, id uint64) (esmStatus esmtypes.ESMStatus, found bool) GetSnapshotOfPrices(ctx sdk.Context, appID, assetID uint64) (price uint64, found bool) GetESMTriggerParams(ctx sdk.Context, id uint64) (esmTriggerParams esmtypes.ESMTriggerParams, found bool) + GetParams(ctx sdk.Context) esmtypes.Params } type TokenMintKeeper interface { diff --git a/x/vault/handler.go b/x/vault/handler.go index 9838f7164..78744e5de 100644 --- a/x/vault/handler.go +++ b/x/vault/handler.go @@ -48,6 +48,9 @@ func NewHandler(k keeper.Keeper) sdk.Handler { case *types.MsgVaultInterestCalcRequest: res, err := server.MsgVaultInterestCalc(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgWithdrawStableMintControlRequest: + res, err := server.MsgWithdrawStableMintControl(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, errors.Wrapf(types.ErrorUnknownMsgType, "%T", msg) } diff --git a/x/vault/keeper/msg_server.go b/x/vault/keeper/msg_server.go index ef12948ba..e9fa791bc 100644 --- a/x/vault/keeper/msg_server.go +++ b/x/vault/keeper/msg_server.go @@ -1267,6 +1267,10 @@ func (k msgServer) MsgDepositStableMint(c context.Context, msg *types.MsgDeposit func (k msgServer) MsgWithdrawStableMint(c context.Context, msg *types.MsgWithdrawStableMintRequest) (*types.MsgWithdrawStableMintResponse, error) { ctx := sdk.UnwrapSDKContext(c) + getControl := k.GetWithdrawStableMintControl(ctx) + if getControl { + return nil, types.ErrorWithdrawStableMintVault + } esmStatus, found := k.esm.GetESMStatus(ctx, msg.AppId) status := false if found { @@ -1451,3 +1455,35 @@ func (k msgServer) MsgVaultInterestCalc(c context.Context, msg *types.MsgVaultIn return &types.MsgVaultInterestCalcResponse{}, nil } + +func (k msgServer) MsgWithdrawStableMintControl(c context.Context, msg *types.MsgWithdrawStableMintControlRequest) (*types.MsgWithdrawStableMintControlResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + + // check if address is admin + getAdmin := k.esm.GetParams(ctx).Admin + + // check if address is admin in getAdmin array + if getAdmin[0] != msg.From { + return nil, esmtypes.ErrorUnauthorized + } + + appMapping, found := k.asset.GetApp(ctx, msg.AppId) + if !found { + return nil, types.ErrorAppMappingDoesNotExist + } + // check app name is harbor + if appMapping.Name != "harbor" { + return nil, types.ErrorAppMappingDoesNotExist + } + + // check GetWithdrawStableMintControl value + control := k.GetWithdrawStableMintControl(ctx) + + if control { + k.SetWithdrawStableMintControl(ctx, false) + } else { + k.SetWithdrawStableMintControl(ctx, true) + } + + return &types.MsgWithdrawStableMintControlResponse{}, nil +} diff --git a/x/vault/keeper/vault.go b/x/vault/keeper/vault.go index 956f30bce..d25e1adfa 100644 --- a/x/vault/keeper/vault.go +++ b/x/vault/keeper/vault.go @@ -823,3 +823,34 @@ func (k Keeper) GetStableMintVaultRewardsOfAllApps(ctx sdk.Context) (mappingData return mappingData } + +func (k Keeper) SetWithdrawStableMintControl(ctx sdk.Context, control bool) { + var ( + store = k.Store(ctx) + key = types.StableVaultControlKeyPrefix + value = k.cdc.MustMarshal( + &protobuftypes.BoolValue{ + Value: control, + }, + ) + ) + + store.Set(key, value) +} + +func (k Keeper) GetWithdrawStableMintControl(ctx sdk.Context) bool { + var ( + store = k.Store(ctx) + key = types.StableVaultControlKeyPrefix + value = store.Get(key) + ) + + if value == nil { + return false + } + + var id protobuftypes.BoolValue + k.cdc.MustUnmarshal(value, &id) + + return id.GetValue() +} \ No newline at end of file diff --git a/x/vault/types/codec.go b/x/vault/types/codec.go index 73c162e50..01a2e8eff 100644 --- a/x/vault/types/codec.go +++ b/x/vault/types/codec.go @@ -21,6 +21,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgDepositStableMintRequest{}, "comdex/vault/MsgDepositStableMintRequest", nil) cdc.RegisterConcrete(&MsgWithdrawStableMintRequest{}, "comdex/vault/MsgWithdrawStableMintRequest", nil) cdc.RegisterConcrete(&MsgVaultInterestCalcRequest{}, "comdex/vault/MsgVaultInterestCalcRequest", nil) + cdc.RegisterConcrete(&MsgWithdrawStableMintControlRequest{}, "comdex/vault/MsgWithdrawStableMintControlRequest", nil) } func RegisterInterfaces(registry codectypes.InterfaceRegistry) { @@ -37,6 +38,7 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { &MsgDepositStableMintRequest{}, &MsgWithdrawStableMintRequest{}, &MsgVaultInterestCalcRequest{}, + &MsgWithdrawStableMintControlRequest{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/vault/types/errors.go b/x/vault/types/errors.go index 725eb9df9..3acd8c95c 100644 --- a/x/vault/types/errors.go +++ b/x/vault/types/errors.go @@ -32,4 +32,5 @@ var ( ErrorAppExtendedPairDataDoesNotExists = errors.Register(ModuleName, 1325, "App ExtendedPair Data Does Not Exists") ErrorUnknownMsgType = errors.Register(ModuleName, 1326, "unknown message type") ErrorCannotCreateStableMintVault = errors.Register(ModuleName, 1327, "Cannot Create Stable Mint Vault, StableMint tx command") + ErrorWithdrawStableMintVault = errors.Register(ModuleName, 1328, "Temporary suspension of withdrawals from the Stable Mint Vault") ) diff --git a/x/vault/types/keys.go b/x/vault/types/keys.go index ffd88ae7e..cdb13bee5 100644 --- a/x/vault/types/keys.go +++ b/x/vault/types/keys.go @@ -12,17 +12,18 @@ const ( ) var ( - TypeMsgCreateRequest = ModuleName + ":create" - TypeMsgDepositRequest = ModuleName + ":deposit" - TypeMsgWithdrawRequest = ModuleName + ":withdraw" - TypeMsgDrawRequest = ModuleName + ":draw" - TypeMsgRepayRequest = ModuleName + ":repay" - TypeMsgLiquidateRequest = ModuleName + ":liquidate" - TypeMsgDepositDrawRequest = ModuleName + ":deposit_draw" - TypeMsgCreateStableMintRequest = ModuleName + ":create_stablemint" - TypeMsgDepositStableMintRequest = ModuleName + ":deposit_stablemint" - TypeMsgWithdrawStableMintRequest = ModuleName + ":withdraw_stablemint" - TypeMsgVaultInterestCalcRequest = ModuleName + ":calculate_interest" + TypeMsgCreateRequest = ModuleName + ":create" + TypeMsgDepositRequest = ModuleName + ":deposit" + TypeMsgWithdrawRequest = ModuleName + ":withdraw" + TypeMsgDrawRequest = ModuleName + ":draw" + TypeMsgRepayRequest = ModuleName + ":repay" + TypeMsgLiquidateRequest = ModuleName + ":liquidate" + TypeMsgDepositDrawRequest = ModuleName + ":deposit_draw" + TypeMsgCreateStableMintRequest = ModuleName + ":create_stablemint" + TypeMsgDepositStableMintRequest = ModuleName + ":deposit_stablemint" + TypeMsgWithdrawStableMintRequest = ModuleName + ":withdraw_stablemint" + TypeMsgVaultInterestCalcRequest = ModuleName + ":calculate_interest" + TypeMsgWithdrawStableMintControlRequest = ModuleName + ":withdraw_stablemint_control" ) var ( @@ -34,6 +35,7 @@ var ( StableVaultIDPrefix = []byte{0x16} VaultLengthPrefix = []byte{0x17} StableVaultRewardsKeyPrefix = []byte{0x18} + StableVaultControlKeyPrefix = []byte{0x19} ) func VaultKey(vaultID uint64) []byte { diff --git a/x/vault/types/msg.go b/x/vault/types/msg.go index 8709aa9c4..12c183dde 100644 --- a/x/vault/types/msg.go +++ b/x/vault/types/msg.go @@ -16,6 +16,7 @@ var ( _ sdk.Msg = (*MsgDepositStableMintRequest)(nil) _ sdk.Msg = (*MsgWithdrawStableMintRequest)(nil) _ sdk.Msg = (*MsgVaultInterestCalcRequest)(nil) + _ sdk.Msg = (*MsgWithdrawStableMintControlRequest)(nil) ) func NewMsgCreateRequest( @@ -616,3 +617,46 @@ func (m *MsgVaultInterestCalcRequest) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{from} } + +func NewMsgWithdrawStableMintControlRequest( + from sdk.AccAddress, + appID uint64, +) *MsgWithdrawStableMintControlRequest { + return &MsgWithdrawStableMintControlRequest{ + From: from.String(), + AppId: appID, + } +} + +func (m *MsgWithdrawStableMintControlRequest) Route() string { + return RouterKey +} + +func (m *MsgWithdrawStableMintControlRequest) Type() string { + return TypeMsgWithdrawStableMintControlRequest +} + +func (m *MsgWithdrawStableMintControlRequest) ValidateBasic() error { + if m.From == "" { + return errors.Wrap(ErrorInvalidFrom, "from cannot be empty") + } + if _, err := sdk.AccAddressFromBech32(m.From); err != nil { + return errors.Wrapf(ErrorInvalidFrom, "%s", err) + } + + return nil +} + +func (m *MsgWithdrawStableMintControlRequest) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(m)) +} + +func (m *MsgWithdrawStableMintControlRequest) GetSigners() []sdk.AccAddress { + + from, err := sdk.AccAddressFromBech32(m.From) + if err != nil { + panic(err) + } + + return []sdk.AccAddress{from} +} diff --git a/x/vault/types/tx.pb.go b/x/vault/types/tx.pb.go index 81222ee83..a4da4603d 100644 --- a/x/vault/types/tx.pb.go +++ b/x/vault/types/tx.pb.go @@ -872,6 +872,80 @@ func (m *MsgVaultInterestCalcResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgVaultInterestCalcResponse proto.InternalMessageInfo +type MsgWithdrawStableMintControlRequest struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` +} + +func (m *MsgWithdrawStableMintControlRequest) Reset() { *m = MsgWithdrawStableMintControlRequest{} } +func (m *MsgWithdrawStableMintControlRequest) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawStableMintControlRequest) ProtoMessage() {} +func (*MsgWithdrawStableMintControlRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_4b7a3c3b9b1a607e, []int{22} +} +func (m *MsgWithdrawStableMintControlRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawStableMintControlRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawStableMintControlRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgWithdrawStableMintControlRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawStableMintControlRequest.Merge(m, src) +} +func (m *MsgWithdrawStableMintControlRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawStableMintControlRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawStableMintControlRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawStableMintControlRequest proto.InternalMessageInfo + +type MsgWithdrawStableMintControlResponse struct { +} + +func (m *MsgWithdrawStableMintControlResponse) Reset() { *m = MsgWithdrawStableMintControlResponse{} } +func (m *MsgWithdrawStableMintControlResponse) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawStableMintControlResponse) ProtoMessage() {} +func (*MsgWithdrawStableMintControlResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4b7a3c3b9b1a607e, []int{23} +} +func (m *MsgWithdrawStableMintControlResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawStableMintControlResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawStableMintControlResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgWithdrawStableMintControlResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawStableMintControlResponse.Merge(m, src) +} +func (m *MsgWithdrawStableMintControlResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawStableMintControlResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawStableMintControlResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawStableMintControlResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgCreateRequest)(nil), "comdex.vault.v1beta1.MsgCreateRequest") proto.RegisterType((*MsgCreateResponse)(nil), "comdex.vault.v1beta1.MsgCreateResponse") @@ -895,68 +969,73 @@ func init() { proto.RegisterType((*MsgWithdrawStableMintResponse)(nil), "comdex.vault.v1beta1.MsgWithdrawStableMintResponse") proto.RegisterType((*MsgVaultInterestCalcRequest)(nil), "comdex.vault.v1beta1.MsgVaultInterestCalcRequest") proto.RegisterType((*MsgVaultInterestCalcResponse)(nil), "comdex.vault.v1beta1.MsgVaultInterestCalcResponse") + proto.RegisterType((*MsgWithdrawStableMintControlRequest)(nil), "comdex.vault.v1beta1.MsgWithdrawStableMintControlRequest") + proto.RegisterType((*MsgWithdrawStableMintControlResponse)(nil), "comdex.vault.v1beta1.MsgWithdrawStableMintControlResponse") } func init() { proto.RegisterFile("comdex/vault/v1beta1/tx.proto", fileDescriptor_4b7a3c3b9b1a607e) } var fileDescriptor_4b7a3c3b9b1a607e = []byte{ - // 891 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x98, 0xcf, 0x6e, 0xe2, 0x46, - 0x18, 0xc0, 0xb1, 0x43, 0xd2, 0x30, 0x11, 0x4d, 0x98, 0x90, 0x88, 0x3a, 0xc5, 0x4e, 0xdd, 0x36, - 0xa5, 0x87, 0xd8, 0x25, 0xb9, 0x55, 0x95, 0xaa, 0x40, 0x2f, 0x1c, 0xa2, 0xb6, 0xae, 0x94, 0xa8, - 0x55, 0x25, 0x64, 0xf0, 0x84, 0x58, 0x05, 0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0xfc, 0xdf, 0x1c, 0xd8, 0x88, 0x6c, 0x4c, 0x70, 0x2f, 0x76, 0x0f, 0x8f, 0x66, - 0xb0, 0x3f, 0x95, 0x4d, 0x88, 0xc0, 0x48, 0x33, 0x99, 0x40, 0x60, 0x5c, 0x93, 0x9c, 0x40, 0x60, - 0x6c, 0xaf, 0x2a, 0xfd, 0x78, 0x79, 0x23, 0x26, 0xfe, 0xeb, 0x88, 0x89, 0xcb, 0x8e, 0xc8, 0x5d, - 0x75, 0x44, 0xee, 0x55, 0x47, 0xe4, 0xfe, 0xb9, 0x15, 0x13, 0x57, 0xb7, 0x62, 0xe2, 0xfa, 0x56, - 0x4c, 0xfc, 0xa2, 0x86, 0x0e, 0x90, 0x9e, 0xff, 0x5d, 0x7c, 0x72, 0x62, 0xd6, 0x4d, 0xbd, 0xc9, - 0x7e, 0xab, 0xfd, 0x7f, 0x01, 0xe9, 0x69, 0x52, 0x5b, 0xa2, 0xff, 0xea, 0xed, 0xbf, 0x0d, 0x00, - 0x00, 0xff, 0xff, 0x50, 0x76, 0xdc, 0x27, 0x22, 0x14, 0x00, 0x00, + // 935 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x98, 0x4f, 0x8f, 0xdb, 0x44, + 0x14, 0xc0, 0x63, 0x6f, 0x76, 0xe9, 0xbe, 0xd5, 0xb2, 0xdd, 0xd9, 0xb4, 0x0a, 0x2e, 0xb1, 0x8b, + 0x5b, 0x42, 0x38, 0xd4, 0x26, 0xdb, 0x13, 0x15, 0x12, 0x6a, 0xc2, 0x25, 0x87, 0x15, 0x60, 0xa4, + 0xad, 0x40, 0x48, 0x91, 0x13, 0xcf, 0xa6, 0x16, 0x89, 0xc7, 0xd8, 0xe3, 0xb2, 0x8b, 0x84, 0xc4, + 0x47, 0xe0, 0xc2, 0x8d, 0x0f, 0x80, 0xf8, 0x16, 0xdc, 0xf6, 0x04, 0x85, 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0xbd, 0x1f, 0x2e, 0xa3, 0xc2, 0xdd, 0x7f, 0x2b, 0xc0, 0x8d, 0xd4, 0x57, + 0x1a, 0x1d, 0xe6, 0xee, 0xe1, 0xf9, 0x08, 0xee, 0x2f, 0xa5, 0x93, 0x20, 0x30, 0x57, 0xea, 0x16, + 0x10, 0xc8, 0x2a, 0xe1, 0x0b, 0x08, 0x64, 0x56, 0x52, 0xf4, 0xbd, 0x90, 0x71, 0x38, 0xf3, 0xa2, + 0x86, 0xde, 0x5d, 0x62, 0x51, 0xc9, 0xf2, 0x2b, 0x3d, 0xf8, 0x37, 0xaa, 0x51, 0x5c, 0x8d, 0x8f, + 0xcf, 0x9f, 0xcb, 0x85, 0x1f, 0x87, 0x72, 0xe1, 0x7c, 0x28, 0x0b, 0x4f, 0x87, 0xb2, 0xf0, 0xe7, + 0x50, 0x16, 0xbe, 0xbb, 0x90, 0x0b, 0x4f, 0x2f, 0xe4, 0xc2, 0xb3, 0x0b, 0xb9, 0xf0, 0x99, 0x9e, + 0x38, 0x76, 0xc7, 0x7e, 0xee, 0x91, 0x93, 0x13, 0xbb, 0x6b, 0x9b, 0x7d, 0xfe, 0xac, 0x4f, 0xbe, + 0x9d, 0xb2, 0x33, 0xb8, 0xb3, 0xc5, 0xbe, 0x85, 0xde, 0xff, 0x27, 0x00, 0x00, 0xff, 0xff, 0x2e, + 0xe3, 0x43, 0x19, 0x58, 0x15, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -982,6 +1061,7 @@ type MsgClient interface { MsgDepositStableMint(ctx context.Context, in *MsgDepositStableMintRequest, opts ...grpc.CallOption) (*MsgDepositStableMintResponse, error) MsgWithdrawStableMint(ctx context.Context, in *MsgWithdrawStableMintRequest, opts ...grpc.CallOption) (*MsgWithdrawStableMintResponse, error) MsgVaultInterestCalc(ctx context.Context, in *MsgVaultInterestCalcRequest, opts ...grpc.CallOption) (*MsgVaultInterestCalcResponse, error) + MsgWithdrawStableMintControl(ctx context.Context, in *MsgWithdrawStableMintControlRequest, opts ...grpc.CallOption) (*MsgWithdrawStableMintControlResponse, error) } type msgClient struct { @@ -1091,6 +1171,15 @@ func (c *msgClient) MsgVaultInterestCalc(ctx context.Context, in *MsgVaultIntere return out, nil } +func (c *msgClient) MsgWithdrawStableMintControl(ctx context.Context, in *MsgWithdrawStableMintControlRequest, opts ...grpc.CallOption) (*MsgWithdrawStableMintControlResponse, error) { + out := new(MsgWithdrawStableMintControlResponse) + err := c.cc.Invoke(ctx, "/comdex.vault.v1beta1.Msg/MsgWithdrawStableMintControl", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { MsgCreate(context.Context, *MsgCreateRequest) (*MsgCreateResponse, error) @@ -1104,6 +1193,7 @@ type MsgServer interface { MsgDepositStableMint(context.Context, *MsgDepositStableMintRequest) (*MsgDepositStableMintResponse, error) MsgWithdrawStableMint(context.Context, *MsgWithdrawStableMintRequest) (*MsgWithdrawStableMintResponse, error) MsgVaultInterestCalc(context.Context, *MsgVaultInterestCalcRequest) (*MsgVaultInterestCalcResponse, error) + MsgWithdrawStableMintControl(context.Context, *MsgWithdrawStableMintControlRequest) (*MsgWithdrawStableMintControlResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -1143,6 +1233,9 @@ func (*UnimplementedMsgServer) MsgWithdrawStableMint(ctx context.Context, req *M func (*UnimplementedMsgServer) MsgVaultInterestCalc(ctx context.Context, req *MsgVaultInterestCalcRequest) (*MsgVaultInterestCalcResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MsgVaultInterestCalc not implemented") } +func (*UnimplementedMsgServer) MsgWithdrawStableMintControl(ctx context.Context, req *MsgWithdrawStableMintControlRequest) (*MsgWithdrawStableMintControlResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MsgWithdrawStableMintControl not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -1346,6 +1439,24 @@ func _Msg_MsgVaultInterestCalc_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Msg_MsgWithdrawStableMintControl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawStableMintControlRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MsgWithdrawStableMintControl(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.vault.v1beta1.Msg/MsgWithdrawStableMintControl", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MsgWithdrawStableMintControl(ctx, req.(*MsgWithdrawStableMintControlRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "comdex.vault.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -1394,6 +1505,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "MsgVaultInterestCalc", Handler: _Msg_MsgVaultInterestCalc_Handler, }, + { + MethodName: "MsgWithdrawStableMintControl", + Handler: _Msg_MsgWithdrawStableMintControl_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/vault/v1beta1/tx.proto", @@ -2232,6 +2347,64 @@ func (m *MsgVaultInterestCalcResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } +func (m *MsgWithdrawStableMintControlRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgWithdrawStableMintControlRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawStableMintControlRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AppId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x10 + } + if len(m.From) > 0 { + i -= len(m.From) + copy(dAtA[i:], m.From) + i = encodeVarintTx(dAtA, i, uint64(len(m.From))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgWithdrawStableMintControlResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgWithdrawStableMintControlResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawStableMintControlResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -2595,6 +2768,31 @@ func (m *MsgVaultInterestCalcResponse) Size() (n int) { return n } +func (m *MsgWithdrawStableMintControlRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.AppId != 0 { + n += 1 + sovTx(uint64(m.AppId)) + } + return n +} + +func (m *MsgWithdrawStableMintControlResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4963,6 +5161,157 @@ func (m *MsgVaultInterestCalcResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgWithdrawStableMintControlRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgWithdrawStableMintControlRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawStableMintControlRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.From = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgWithdrawStableMintControlResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgWithdrawStableMintControlResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawStableMintControlResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0