diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index b7706bc..42b1c0a 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -51002,6 +51002,12 @@ paths: btc_voucher_denom: type: string title: The denomination of the voucher + deposit_enabled: + type: boolean + title: Indicates if deposit is enabled + withdraw_enabled: + type: boolean + title: Indicates if withdrawal is enabled vaults: type: array items: @@ -82670,6 +82676,12 @@ definitions: btc_voucher_denom: type: string title: The denomination of the voucher + deposit_enabled: + type: boolean + title: Indicates if deposit is enabled + withdraw_enabled: + type: boolean + title: Indicates if withdrawal is enabled vaults: type: array items: @@ -83102,6 +83114,12 @@ definitions: btc_voucher_denom: type: string title: The denomination of the voucher + deposit_enabled: + type: boolean + title: Indicates if deposit is enabled + withdraw_enabled: + type: boolean + title: Indicates if withdrawal is enabled vaults: type: array items: diff --git a/proto/side/btcbridge/params.proto b/proto/side/btcbridge/params.proto index 7242ed6..32e18d6 100644 --- a/proto/side/btcbridge/params.proto +++ b/proto/side/btcbridge/params.proto @@ -15,14 +15,18 @@ message Params { uint64 max_acceptable_block_depth = 2; // The denomination of the voucher string btc_voucher_denom = 3; + // Indicates if deposit is enabled + bool deposit_enabled = 4; + // Indicates if withdrawal is enabled + bool withdraw_enabled = 5; // Asset vaults - repeated Vault vaults = 4; + repeated Vault vaults = 6; // Protocol limitations - ProtocolLimits protocol_limits = 5 [(gogoproto.nullable) = false]; + ProtocolLimits protocol_limits = 7 [(gogoproto.nullable) = false]; // Protocol fees - ProtocolFees protocol_fees = 6 [(gogoproto.nullable) = false]; + ProtocolFees protocol_fees = 8 [(gogoproto.nullable) = false]; // TSS params - TSSParams tss_params = 7 [(gogoproto.nullable) = false]; + TSSParams tss_params = 9 [(gogoproto.nullable) = false]; } // AssetType defines the type of asset diff --git a/x/btcbridge/keeper/deposit.go b/x/btcbridge/keeper/deposit.go index 832ccea..e768f71 100644 --- a/x/btcbridge/keeper/deposit.go +++ b/x/btcbridge/keeper/deposit.go @@ -303,11 +303,6 @@ func (k Keeper) getOutputsForMintRunes(ctx sdk.Context, tx *wire.MsgTx, edict *t return outs, vouts, vaults, nil } -// ProtocolDepositFeeEnabled returns true if the protocol fee is required for deposit, false otherwise -func (k Keeper) ProtocolDepositFeeEnabled(ctx sdk.Context) bool { - return k.GetParams(ctx).ProtocolFees.DepositFee > 0 -} - func (k Keeper) existsInHistory(ctx sdk.Context, txHash string) bool { store := ctx.KVStore(k.storeKey) diff --git a/x/btcbridge/keeper/msg_server.go b/x/btcbridge/keeper/msg_server.go index 372b533..5ef257e 100644 --- a/x/btcbridge/keeper/msg_server.go +++ b/x/btcbridge/keeper/msg_server.go @@ -48,6 +48,10 @@ func (m msgServer) SubmitDepositTransaction(goCtx context.Context, msg *types.Ms return nil, err } + if !m.DepositEnabled(ctx) { + return nil, types.ErrDepositNotEnabled + } + txHash, recipient, err := m.ProcessBitcoinDepositTransaction(ctx, msg) if err != nil { ctx.Logger().Error("Error processing bitcoin deposit transaction", "error", err) @@ -98,6 +102,10 @@ func (m msgServer) WithdrawToBitcoin(goCtx context.Context, msg *types.MsgWithdr ctx := sdk.UnwrapSDKContext(goCtx) + if !m.WithdrawEnabled(ctx) { + return nil, types.ErrWithdrawNotEnabled + } + sender := sdk.MustAccAddressFromBech32(msg.Sender) amount, err := sdk.ParseCoinNormalized(msg.Amount) diff --git a/x/btcbridge/keeper/params.go b/x/btcbridge/keeper/params.go new file mode 100644 index 0000000..57321b9 --- /dev/null +++ b/x/btcbridge/keeper/params.go @@ -0,0 +1,25 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// DepositEnabled returns true if deposit enabled, false otherwise +func (k Keeper) DepositEnabled(ctx sdk.Context) bool { + return k.GetParams(ctx).DepositEnabled +} + +// WithdrawEnabled returns true if withdrawal enabled, false otherwise +func (k Keeper) WithdrawEnabled(ctx sdk.Context) bool { + return k.GetParams(ctx).WithdrawEnabled +} + +// ProtocolDepositFeeEnabled returns true if the protocol fee is required for deposit, false otherwise +func (k Keeper) ProtocolDepositFeeEnabled(ctx sdk.Context) bool { + return k.GetParams(ctx).ProtocolFees.DepositFee > 0 +} + +// ProtocolWithdrawFeeEnabled returns true if the protocol fee is required for withdrawal, false otherwise +func (k Keeper) ProtocolWithdrawFeeEnabled(ctx sdk.Context) bool { + return k.GetParams(ctx).ProtocolFees.WithdrawFee > 0 +} diff --git a/x/btcbridge/keeper/withdraw.go b/x/btcbridge/keeper/withdraw.go index d126f42..fd99d2c 100644 --- a/x/btcbridge/keeper/withdraw.go +++ b/x/btcbridge/keeper/withdraw.go @@ -372,8 +372,3 @@ func (k Keeper) burnLockedAssets(ctx sdk.Context, txHash string) error { return nil } - -// ProtocolWithdrawFeeEnabled returns true if the protocol fee is required for withdrawal, false otherwise -func (k Keeper) ProtocolWithdrawFeeEnabled(ctx sdk.Context) bool { - return k.GetParams(ctx).ProtocolFees.WithdrawFee > 0 -} diff --git a/x/btcbridge/types/errors.go b/x/btcbridge/types/errors.go index 225c11c..9fdb325 100644 --- a/x/btcbridge/types/errors.go +++ b/x/btcbridge/types/errors.go @@ -21,6 +21,7 @@ var ( ErrTransactionAlreadyMinted = errorsmod.Register(ModuleName, 2107, "transaction already minted") ErrInvalidDepositTransaction = errorsmod.Register(ModuleName, 2108, "invalid deposit transaction") ErrInvalidDepositAmount = errorsmod.Register(ModuleName, 2109, "invalid deposit amount") + ErrDepositNotEnabled = errorsmod.Register(ModuleName, 2110, "deposit not enabled") ErrInvalidAmount = errorsmod.Register(ModuleName, 3100, "invalid amount") ErrInvalidFeeRate = errorsmod.Register(ModuleName, 3101, "invalid fee rate") @@ -33,6 +34,7 @@ var ( ErrInvalidSignatures = errorsmod.Register(ModuleName, 3108, "invalid signatures") ErrWithdrawRequestNotExist = errorsmod.Register(ModuleName, 3109, "withdrawal request does not exist") ErrWithdrawRequestConfirmed = errorsmod.Register(ModuleName, 3110, "withdrawal request has been confirmed") + ErrWithdrawNotEnabled = errorsmod.Register(ModuleName, 3111, "withdrawal not enabled") ErrUTXODoesNotExist = errorsmod.Register(ModuleName, 4100, "utxo does not exist") ErrUTXOLocked = errorsmod.Register(ModuleName, 4101, "utxo locked") diff --git a/x/btcbridge/types/params.go b/x/btcbridge/types/params.go index a83d51c..bd8124b 100644 --- a/x/btcbridge/types/params.go +++ b/x/btcbridge/types/params.go @@ -28,6 +28,8 @@ func NewParams() Params { Confirmations: 1, MaxAcceptableBlockDepth: 100, BtcVoucherDenom: "sat", + DepositEnabled: true, + WithdrawEnabled: true, Vaults: []*Vault{}, ProtocolLimits: ProtocolLimits{ BtcMinDeposit: 50000, // 0.0005 BTC diff --git a/x/btcbridge/types/params.pb.go b/x/btcbridge/types/params.pb.go index b11e7ef..3c0fd60 100644 --- a/x/btcbridge/types/params.pb.go +++ b/x/btcbridge/types/params.pb.go @@ -72,14 +72,18 @@ type Params struct { MaxAcceptableBlockDepth uint64 `protobuf:"varint,2,opt,name=max_acceptable_block_depth,json=maxAcceptableBlockDepth,proto3" json:"max_acceptable_block_depth,omitempty"` // The denomination of the voucher BtcVoucherDenom string `protobuf:"bytes,3,opt,name=btc_voucher_denom,json=btcVoucherDenom,proto3" json:"btc_voucher_denom,omitempty"` + // Indicates if deposit is enabled + DepositEnabled bool `protobuf:"varint,4,opt,name=deposit_enabled,json=depositEnabled,proto3" json:"deposit_enabled,omitempty"` + // Indicates if withdrawal is enabled + WithdrawEnabled bool `protobuf:"varint,5,opt,name=withdraw_enabled,json=withdrawEnabled,proto3" json:"withdraw_enabled,omitempty"` // Asset vaults - Vaults []*Vault `protobuf:"bytes,4,rep,name=vaults,proto3" json:"vaults,omitempty"` + Vaults []*Vault `protobuf:"bytes,6,rep,name=vaults,proto3" json:"vaults,omitempty"` // Protocol limitations - ProtocolLimits ProtocolLimits `protobuf:"bytes,5,opt,name=protocol_limits,json=protocolLimits,proto3" json:"protocol_limits"` + ProtocolLimits ProtocolLimits `protobuf:"bytes,7,opt,name=protocol_limits,json=protocolLimits,proto3" json:"protocol_limits"` // Protocol fees - ProtocolFees ProtocolFees `protobuf:"bytes,6,opt,name=protocol_fees,json=protocolFees,proto3" json:"protocol_fees"` + ProtocolFees ProtocolFees `protobuf:"bytes,8,opt,name=protocol_fees,json=protocolFees,proto3" json:"protocol_fees"` // TSS params - TssParams TSSParams `protobuf:"bytes,7,opt,name=tss_params,json=tssParams,proto3" json:"tss_params"` + TssParams TSSParams `protobuf:"bytes,9,opt,name=tss_params,json=tssParams,proto3" json:"tss_params"` } func (m *Params) Reset() { *m = Params{} } @@ -136,6 +140,20 @@ func (m *Params) GetBtcVoucherDenom() string { return "" } +func (m *Params) GetDepositEnabled() bool { + if m != nil { + return m.DepositEnabled + } + return false +} + +func (m *Params) GetWithdrawEnabled() bool { + if m != nil { + return m.WithdrawEnabled + } + return false +} + func (m *Params) GetVaults() []*Vault { if m != nil { return m.Vaults @@ -432,55 +450,57 @@ func init() { func init() { proto.RegisterFile("side/btcbridge/params.proto", fileDescriptor_f1d33573cda8a6d2) } var fileDescriptor_f1d33573cda8a6d2 = []byte{ - // 758 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x41, 0x6f, 0xe3, 0x44, - 0x18, 0x8d, 0x9b, 0x34, 0xc5, 0x93, 0x36, 0x1b, 0x46, 0x0b, 0x6b, 0xc2, 0xca, 0xcd, 0x46, 0x2b, - 0x14, 0xad, 0x84, 0xcd, 0x96, 0x0b, 0x12, 0x12, 0x52, 0xd3, 0xa4, 0xb0, 0x82, 0x5d, 0x05, 0x27, - 0x5d, 0x04, 0x97, 0xd1, 0x78, 0x3c, 0x75, 0x46, 0xb1, 0x3d, 0x96, 0x67, 0x9c, 0x26, 0xff, 0x01, - 0x21, 0x8e, 0x9c, 0xf8, 0x3d, 0x3d, 0xf6, 0xc0, 0x81, 0x13, 0xa0, 0xf6, 0x8f, 0xa0, 0x19, 0xdb, - 0x69, 0x52, 0x84, 0xb4, 0x37, 0xcf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x02, 0x73, 0x33, 0x09, 0xb0, - 0x0b, 0x3e, 0x3c, 0x9d, 0x4e, 0xc7, 0x33, 0x34, 0xfb, 0x71, 0x32, 0x46, 0x17, 0x6f, 0xa6, 0x93, - 0xf1, 0xd9, 0xab, 0xf3, 0x57, 0xe3, 0x51, 0xa7, 0x06, 0x21, 0x68, 0x6f, 0x71, 0xc3, 0xd9, 0x59, - 0xc7, 0x80, 0x8f, 0x41, 0x67, 0x1b, 0xf3, 0xce, 0x4e, 0x3e, 0xeb, 0xec, 0x3d, 0x40, 0xbd, 0x8b, - 0x37, 0xe3, 0x69, 0xa7, 0x3e, 0xfc, 0xe6, 0xfa, 0xd6, 0x36, 0x6e, 0x6e, 0x6d, 0xe3, 0x9f, 0x5b, - 0xdb, 0xf8, 0xf5, 0xce, 0xae, 0xdd, 0xdc, 0xd9, 0xb5, 0x3f, 0xef, 0xec, 0xda, 0x4f, 0x4e, 0xc8, - 0xe4, 0x3c, 0xf7, 0x1d, 0xc2, 0x63, 0x57, 0x0d, 0x69, 0xf5, 0x90, 0xf4, 0xc2, 0x5d, 0x6d, 0xfd, - 0x29, 0xd5, 0x3c, 0x0b, 0xbf, 0xa9, 0x05, 0x9f, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x32, 0xea, - 0x05, 0x30, 0x48, 0x05, 0x00, 0x00, + // 796 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x4f, 0x6f, 0x23, 0x35, + 0x18, 0xc6, 0x33, 0x4d, 0x9b, 0x76, 0xde, 0xb6, 0x69, 0xb0, 0x16, 0x76, 0x28, 0xab, 0x34, 0x1b, + 0xad, 0x20, 0xac, 0x44, 0x86, 0x2d, 0x17, 0x24, 0x24, 0xa4, 0xa6, 0x49, 0x61, 0x05, 0xbb, 0x0a, + 0x93, 0x74, 0x11, 0x5c, 0x2c, 0x8f, 0xc7, 0x9d, 0x5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a9, 0x22, 0x6d, 0x37, 0xa8, 0x96, 0xe8, 0x21, 0x6c, 0xca, + 0x3c, 0xc4, 0x17, 0xec, 0xca, 0x86, 0xea, 0x06, 0x2d, 0x99, 0x87, 0xdf, 0xb0, 0x2b, 0xf4, 0x39, + 0x00, 0x51, 0x8a, 0x69, 0xac, 0xaf, 0x24, 0xb3, 0xe1, 0xb5, 0xff, 0xdd, 0xfc, 0xc8, 0x10, 0xf3, + 0x2b, 0xc9, 0x02, 0x97, 0x54, 0x9f, 0xa6, 0xd9, 0x25, 0xcb, 0x14, 0x17, 0xa9, 0x4d, 0x72, 0x3d, + 0xa8, 0x96, 0xfd, 0x9f, 0x1c, 0x68, 0xdf, 0xbd, 0x42, 0xf4, 0x21, 0x98, 0x89, 0xc0, 0x09, 0x4f, + 0x71, 0x99, 0xb7, 0x3d, 0x61, 0x33, 0xd8, 0x0d, 0x35, 0x7d, 0xc1, 0xd3, 0x71, 0x21, 0xa2, 0x01, + 0x74, 0x2a, 0xae, 0x4a, 0xdb, 0x1e, 0xb8, 0x19, 0xb4, 0x0b, 0xf0, 0xfb, 0x52, 0xad, 0x49, 0xb2, + 0xbc, 0x25, 0x9b, 0xb7, 0x24, 0x59, 0x56, 0x64, 0x5f, 0xc2, 0xce, 0x6a, 0x06, 0xe8, 0x00, 0xb6, + 0xab, 0x51, 0x3c, 0x63, 0xac, 0x3c, 0x07, 0x94, 0xd2, 0x09, 0x63, 0xe8, 0x31, 0xec, 0xd4, 0x23, + 0x68, 0x88, 0xe2, 0x00, 0xdb, 0x95, 0x66, 0x90, 0x47, 0xe0, 0x52, 0xb1, 0x58, 0x30, 0xaa, 0x45, + 0x56, 0x8e, 0xfc, 0xad, 0xd0, 0xff, 0xcd, 0x01, 0xb7, 0x0e, 0x0c, 0x7d, 0x07, 0x28, 0xba, 0x88, + 0xb1, 0xe6, 0x09, 0x13, 0xb9, 0xc6, 0x92, 0x65, 0x5c, 0x44, 0xb6, 0xad, 0xc9, 0xb9, 0x78,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ff, 0xeb, 0x9a, 0xb5, 0xa7, 0x9c, 0x05, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -512,7 +532,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x3a + dAtA[i] = 0x4a { size, err := m.ProtocolFees.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -522,7 +542,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x32 + dAtA[i] = 0x42 { size, err := m.ProtocolLimits.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -532,7 +552,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x3a if len(m.Vaults) > 0 { for iNdEx := len(m.Vaults) - 1; iNdEx >= 0; iNdEx-- { { @@ -544,9 +564,29 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x32 } } + if m.WithdrawEnabled { + i-- + if m.WithdrawEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.DepositEnabled { + i-- + if m.DepositEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } if len(m.BtcVoucherDenom) > 0 { i -= len(m.BtcVoucherDenom) copy(dAtA[i:], m.BtcVoucherDenom) @@ -758,6 +798,12 @@ func (m *Params) Size() (n int) { if l > 0 { n += 1 + l + sovParams(uint64(l)) } + if m.DepositEnabled { + n += 2 + } + if m.WithdrawEnabled { + n += 2 + } if len(m.Vaults) > 0 { for _, e := range m.Vaults { l = e.Size() @@ -952,6 +998,46 @@ func (m *Params) Unmarshal(dAtA []byte) error { m.BtcVoucherDenom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DepositEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DepositEnabled = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WithdrawEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.WithdrawEnabled = bool(v != 0) + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Vaults", wireType) } @@ -985,7 +1071,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ProtocolLimits", wireType) } @@ -1018,7 +1104,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ProtocolFees", wireType) } @@ -1051,7 +1137,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 7: + case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field TssParams", wireType) }