diff --git a/proto/feeabstraction/feeabs/v1beta1/proposal.proto b/proto/feeabstraction/feeabs/v1beta1/proposal.proto index 26c1d31c..f550ae8f 100644 --- a/proto/feeabstraction/feeabs/v1beta1/proposal.proto +++ b/proto/feeabstraction/feeabs/v1beta1/proposal.proto @@ -22,6 +22,8 @@ message HostChainFeeAbsConfig { uint64 pool_id = 3; // Host chain fee abstraction connection status HostChainFeeAbsStatus status = 4; + // A minimum amount threshold allow cross-chain swap call + uint64 min_swap_amount = 5; } message AddHostZoneProposal { diff --git a/tests/interchaintest/feeabs/types.go b/tests/interchaintest/feeabs/types.go index 106a184f..afbc0380 100644 --- a/tests/interchaintest/feeabs/types.go +++ b/tests/interchaintest/feeabs/types.go @@ -16,11 +16,12 @@ const ( type HostChainFeeAbsConfig struct { // ibc token is allowed to be used as fee token - IbcDenom string `protobuf:"bytes,1,opt,name=ibc_denom,json=ibcDenom,proto3" json:"ibc_denom,omitempty" yaml:"allowed_token"` + IbcDenom string `json:"ibc_denom,omitempty"` // token_in in cross_chain swap contract. - OsmosisPoolTokenDenomIn string `protobuf:"bytes,2,opt,name=osmosis_pool_token_denom_in,json=osmosisPoolTokenDenomIn,proto3" json:"osmosis_pool_token_denom_in,omitempty"` + OsmosisPoolTokenDenomIn string `json:"osmosis_pool_token_denom_in,omitempty"` // pool id - PoolId string `protobuf:"varint,3,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"` + PoolId string `json:"pool_id,omitempty"` // Host chain fee abstraction connection status - Status string `protobuf:"varint,4,opt,name=status,proto3,enum=feeabstraction.feeabs.v1beta1.HostChainFeeAbsStatus" json:"status,omitempty"` + Status string `json:"status,omitempty"` + MinSwapAmount string `json:"min_swap_amount,omitempty"` } diff --git a/tests/interchaintest/host_zone_proposal_test.go b/tests/interchaintest/host_zone_proposal_test.go index a35bd0f9..89eb6db6 100644 --- a/tests/interchaintest/host_zone_proposal_test.go +++ b/tests/interchaintest/host_zone_proposal_test.go @@ -42,6 +42,7 @@ func TestHostZoneProposal(t *testing.T) { OsmosisPoolTokenDenomIn: "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9", PoolId: "1", Status: feeabsCli.HostChainFeeAbsStatus_UPDATED, + MinSwapAmount: "0", }}) // Start testing for set host zone proposal @@ -64,6 +65,7 @@ func TestHostZoneProposal(t *testing.T) { OsmosisPoolTokenDenomIn: "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9", PoolId: "1", Status: feeabsCli.HostChainFeeAbsStatus_FROZEN, + MinSwapAmount: "10", }}) // Start testing for delete host zone proposal diff --git a/tests/interchaintest/proposal/add_host_zone.json b/tests/interchaintest/proposal/add_host_zone.json index 8be69f89..7916119b 100644 --- a/tests/interchaintest/proposal/add_host_zone.json +++ b/tests/interchaintest/proposal/add_host_zone.json @@ -6,7 +6,8 @@ "ibc_denom": "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9", "osmosis_pool_token_denom_in": "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9", "pool_id": "1", - "status": 0 + "status": 0, + "min_swap_amount": "0" }, "deposit": "100000000stake" } \ No newline at end of file diff --git a/tests/interchaintest/proposal/set_host_zone.json b/tests/interchaintest/proposal/set_host_zone.json index 680af306..94683fd6 100644 --- a/tests/interchaintest/proposal/set_host_zone.json +++ b/tests/interchaintest/proposal/set_host_zone.json @@ -6,7 +6,8 @@ "ibc_denom": "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9", "osmosis_pool_token_denom_in": "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9", "pool_id": "1", - "status": 2 + "status": 2, + "min_swap_amount": "10" }, "deposit": "100000000stake" } \ No newline at end of file diff --git a/x/feeabs/keeper/ibc.go b/x/feeabs/keeper/ibc.go index 5197695c..ca6b211c 100644 --- a/x/feeabs/keeper/ibc.go +++ b/x/feeabs/keeper/ibc.go @@ -226,8 +226,8 @@ func (k Keeper) transferOsmosisCrosschainSwap(ctx sdk.Context, hostChainConfig t nativeDenomIBCedInOsmosis := params.NativeIbcedInOsmosis chainName := params.ChainName - if !token.Amount.IsPositive() { - return nil + if !token.Amount.IsPositive() || token.Amount.LT(sdk.NewIntFromUint64(hostChainConfig.MinSwapAmount)) { + return fmt.Errorf("invalid amount to transfer, expect minimum %v, got %v", hostChainConfig.MinSwapAmount, token.Amount) } memo, err := types.BuildCrossChainSwapMemo(nativeDenomIBCedInOsmosis, params.OsmosisCrosschainSwapAddress, moduleAccountAddress.String(), chainName) @@ -389,3 +389,8 @@ func (k Keeper) IbcQueryHostZoneFilter(ctx sdk.Context, hostZoneConfig types.Hos return false } + +// for testing +func (k Keeper) TransferOsmosisCrosschainSwap(ctx sdk.Context, hostChainConfig types.HostChainFeeAbsConfig) error { + return k.transferOsmosisCrosschainSwap(ctx, hostChainConfig) +} diff --git a/x/feeabs/keeper/ibc_test.go b/x/feeabs/keeper/ibc_test.go index 8fda3cf8..05385a11 100644 --- a/x/feeabs/keeper/ibc_test.go +++ b/x/feeabs/keeper/ibc_test.go @@ -1,11 +1,17 @@ package keeper_test import ( + "fmt" + "testing" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" "github.com/stretchr/testify/require" sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/osmosis-labs/fee-abstraction/v7/x/feeabs/types" @@ -215,3 +221,62 @@ func (s *KeeperTestSuite) generateQueryRequest() []abci.RequestQuery { Data: icqReqDataBz, }} } + +// test unsuccessful osmosisCrooschainSwap due to below swap threshold +func (s *KeeperTestSuite) TestTransferOsmosisCrosschainSwap() { + tests := []struct { + name string + AmountToTransfer uint64 + hostConfig types.HostChainFeeAbsConfig + wantErr bool + }{ + { + "swap zero token", + 0, + types.HostChainFeeAbsConfig{ + IbcDenom: IBCDenom, + OsmosisPoolTokenDenomIn: OsmosisIBCDenom, + Status: types.HostChainFeeAbsStatus_UPDATED, + PoolId: 1, + MinSwapAmount: 1000, + }, + true, + }, + { + "swap amount below min", + 500, + types.HostChainFeeAbsConfig{ + IbcDenom: IBCDenom, + OsmosisPoolTokenDenomIn: OsmosisIBCDenom, + Status: types.HostChainFeeAbsStatus_UPDATED, + PoolId: 1, + MinSwapAmount: 1000, + }, + true, + }, + } + + for _, tc := range tests { + tc := tc + s.T().Run(tc.name, func(t *testing.T) { + s.FundFeeAbsModuleAccount(s.ctx, tc.AmountToTransfer) + err := s.feeAbsKeeper.TransferOsmosisCrosschainSwap(s.ctx, tc.hostConfig) + if tc.wantErr { + require.Error(t, err) + require.Contains(t, err.Error(), fmt.Sprintf("invalid amount to transfer, expect minimum %v, got %v", tc.hostConfig.MinSwapAmount, tc.AmountToTransfer)) + + } else { + require.NoError(t, err) + } + }) + } +} + +// helper function to fund fee abs module account for testing +func (s *KeeperTestSuite) FundFeeAbsModuleAccount(ctx sdk.Context, amount uint64) { + s.T().Helper() + err := s.feeAbsApp.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(sdk.NewCoin(IBCDenom, sdk.NewIntFromUint64(amount)))) + require.NoError(s.T(), err) + err = s.feeAbsApp.BankKeeper.SendCoinsFromModuleToModule(ctx, minttypes.ModuleName, types.ModuleName, sdk.NewCoins(sdk.NewCoin(IBCDenom, sdk.NewIntFromUint64(amount)))) + require.NoError(s.T(), err) +} diff --git a/x/feeabs/types/proposal.pb.go b/x/feeabs/types/proposal.pb.go index f7dff118..be525237 100644 --- a/x/feeabs/types/proposal.pb.go +++ b/x/feeabs/types/proposal.pb.go @@ -62,6 +62,8 @@ type HostChainFeeAbsConfig struct { PoolId uint64 `protobuf:"varint,3,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"` // Host chain fee abstraction connection status Status HostChainFeeAbsStatus `protobuf:"varint,4,opt,name=status,proto3,enum=feeabstraction.feeabs.v1beta1.HostChainFeeAbsStatus" json:"status,omitempty"` + // A minimum amount threshold allow cross-chain swap call + MinSwapAmount uint64 `protobuf:"varint,5,opt,name=min_swap_amount,json=minSwapAmount,proto3" json:"min_swap_amount,omitempty"` } func (m *HostChainFeeAbsConfig) Reset() { *m = HostChainFeeAbsConfig{} } @@ -125,6 +127,13 @@ func (m *HostChainFeeAbsConfig) GetStatus() HostChainFeeAbsStatus { return HostChainFeeAbsStatus_UPDATED } +func (m *HostChainFeeAbsConfig) GetMinSwapAmount() uint64 { + if m != nil { + return m.MinSwapAmount + } + return 0 +} + type AddHostZoneProposal struct { // the title of the proposal Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` @@ -264,40 +273,42 @@ func init() { } var fileDescriptor_c397b73ee3101036 = []byte{ - // 515 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x93, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0xc7, 0xe3, 0x36, 0xa4, 0xed, 0x06, 0x41, 0x59, 0x02, 0x8d, 0x5a, 0x70, 0xa2, 0x9c, 0x22, - 0x44, 0x6d, 0x95, 0x0f, 0x21, 0x2a, 0x84, 0x94, 0x36, 0xad, 0xa8, 0x84, 0x68, 0xe4, 0xa4, 0x97, - 0x5c, 0xcc, 0xda, 0x9e, 0x38, 0x2b, 0xec, 0x1d, 0x2b, 0xbb, 0x29, 0xf4, 0x0d, 0x38, 0xf2, 0x08, - 0xbc, 0x04, 0xef, 0xc0, 0xb1, 0x47, 0x4e, 0x08, 0x25, 0x6f, 0x00, 0x2f, 0x80, 0xd6, 0xeb, 0xa2, - 0x00, 0x12, 0x12, 0x12, 0x17, 0x6e, 0xfe, 0x8f, 0x7f, 0x33, 0xb3, 0xf3, 0x45, 0xee, 0x8e, 0x00, - 0x58, 0x20, 0xd5, 0x84, 0x85, 0x8a, 0xa3, 0x70, 0x8d, 0x74, 0x4f, 0x77, 0x02, 0x50, 0x6c, 0xc7, - 0xcd, 0x26, 0x98, 0xa1, 0x64, 0x89, 0x93, 0x4d, 0x50, 0x21, 0xbd, 0xfd, 0x33, 0xed, 0x18, 0xe9, - 0x14, 0xf4, 0x66, 0x2d, 0xc6, 0x18, 0x73, 0xd2, 0xd5, 0x5f, 0xc6, 0x69, 0xb3, 0x11, 0x23, 0xc6, - 0x09, 0xb8, 0xb9, 0x0a, 0xa6, 0x23, 0x57, 0xf1, 0x14, 0xa4, 0x62, 0x69, 0x56, 0x00, 0xb7, 0x0a, - 0x80, 0x65, 0xdc, 0x65, 0x42, 0xa0, 0x62, 0x3a, 0xb8, 0x34, 0x7f, 0x5b, 0xdf, 0x2c, 0x72, 0xe3, - 0x19, 0x4a, 0xb5, 0x3f, 0x66, 0x5c, 0x1c, 0x02, 0x74, 0x02, 0xb9, 0x8f, 0x62, 0xc4, 0x63, 0xfa, - 0x90, 0xac, 0xf1, 0x20, 0xf4, 0x23, 0x10, 0x98, 0xd6, 0xad, 0xa6, 0xd5, 0x5e, 0xdb, 0xab, 0x7f, - 0xfd, 0xdc, 0xa8, 0x9d, 0xb1, 0x34, 0xd9, 0x6d, 0xb1, 0x24, 0xc1, 0xd7, 0x10, 0xf9, 0x0a, 0x5f, - 0x81, 0x68, 0x79, 0xab, 0x3c, 0x08, 0xbb, 0x9a, 0xa4, 0x4f, 0xc8, 0x16, 0xca, 0x14, 0x25, 0x97, - 0x7e, 0x86, 0x98, 0x18, 0xc0, 0x44, 0xf1, 0xb9, 0xa8, 0x2f, 0xe9, 0x40, 0xde, 0x46, 0x81, 0xf4, - 0x10, 0x93, 0x81, 0x06, 0x72, 0xdf, 0x23, 0x41, 0x37, 0xc8, 0x4a, 0xee, 0xc5, 0xa3, 0xfa, 0x72, - 0xd3, 0x6a, 0x97, 0xbd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xd2, 0xf9, 0xdc, 0x2e, 0x7d, 0x9a, 0xdb, - 0xa5, 0xe1, 0xe3, 0x98, 0xab, 0xf1, 0x34, 0x70, 0x42, 0x4c, 0xdd, 0x62, 0x93, 0xb7, 0x13, 0x7d, - 0xd8, 0x23, 0x80, 0xed, 0xc5, 0x7b, 0x3f, 0x7d, 0xe4, 0xbe, 0xb9, 0x38, 0x7a, 0x75, 0x96, 0x81, - 0x0c, 0x2a, 0xf9, 0xd9, 0xdd, 0xff, 0x1e, 0x00, 0x00, 0xff, 0xff, 0x1d, 0xf6, 0x94, 0xd1, 0x1a, - 0x04, 0x00, 0x00, + // 548 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x54, 0xcf, 0x6e, 0xd3, 0x4e, + 0x10, 0x8e, 0xfb, 0x27, 0x6d, 0x37, 0xbf, 0x1f, 0x2d, 0x4b, 0xa0, 0x56, 0x0b, 0x4e, 0x94, 0x03, + 0x8a, 0x10, 0xb5, 0x55, 0xfe, 0x08, 0x51, 0x21, 0xa4, 0xb4, 0x69, 0x45, 0x25, 0x44, 0x23, 0x27, + 0xbd, 0xe4, 0x62, 0xd6, 0xf6, 0xc6, 0x59, 0x61, 0xef, 0x58, 0xd9, 0x4d, 0x43, 0xdf, 0x80, 0x23, + 0x77, 0x2e, 0xbc, 0x04, 0xef, 0xc0, 0xb1, 0x47, 0x4e, 0x08, 0x25, 0x6f, 0xc0, 0x13, 0xa0, 0xdd, + 0x75, 0x51, 0x00, 0x09, 0x09, 0x89, 0x0b, 0xb7, 0xfd, 0x66, 0xbf, 0x99, 0x9d, 0xf9, 0x66, 0x76, + 0xd0, 0xdd, 0x01, 0xa5, 0x24, 0x14, 0x72, 0x44, 0x22, 0xc9, 0x80, 0x7b, 0x06, 0x7a, 0x67, 0xbb, + 0x21, 0x95, 0x64, 0xd7, 0xcb, 0x47, 0x90, 0x83, 0x20, 0xa9, 0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x29, 0x5d, 0xcc, 0x9c, 0xd2, 0xa7, 0x99, 0x53, + 0xea, 0x3f, 0x4e, 0x98, 0x1c, 0x8e, 0x43, 0x37, 0x82, 0xcc, 0x2b, 0x26, 0x7e, 0x27, 0x55, 0x0b, + 0x60, 0x40, 0xe9, 0xce, 0xfc, 0x5e, 0x38, 0x7b, 0xe4, 0xbd, 0xbe, 0x5c, 0x0e, 0xf2, 0x3c, 0xa7, + 0x22, 0x2c, 0xeb, 0xef, 0x79, 0xff, 0x5b, 0x00, 0x00, 0x00, 0xff, 0xff, 0x80, 0x4f, 0x27, 0xe7, + 0x42, 0x04, 0x00, 0x00, } func (m *HostChainFeeAbsConfig) Marshal() (dAtA []byte, err error) { @@ -320,6 +331,11 @@ func (m *HostChainFeeAbsConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.MinSwapAmount != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.MinSwapAmount)) + i-- + dAtA[i] = 0x28 + } if m.Status != 0 { i = encodeVarintProposal(dAtA, i, uint64(m.Status)) i-- @@ -520,6 +536,9 @@ func (m *HostChainFeeAbsConfig) Size() (n int) { if m.Status != 0 { n += 1 + sovProposal(uint64(m.Status)) } + if m.MinSwapAmount != 0 { + n += 1 + sovProposal(uint64(m.MinSwapAmount)) + } return n } @@ -723,6 +742,25 @@ func (m *HostChainFeeAbsConfig) Unmarshal(dAtA []byte) error { break } } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinSwapAmount", wireType) + } + m.MinSwapAmount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinSwapAmount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipProposal(dAtA[iNdEx:])