Skip to content

Commit

Permalink
fix(x/crosschain): ensure crosschain ibcTransfer fee is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
fx0x55 committed Jan 9, 2025
1 parent 9020cc4 commit 9321585
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion x/crosschain/keeper/bridge_call_out.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,15 @@ func (k Keeper) CrosschainBaseCoin(
originToken bool,
) error {
if fxTarget.IsIBC() {
if !fee.IsZero() {
return sdkerrors.ErrInvalidRequest.Wrap("ibc transfer fee must be zero")
}
sequence, err := k.IBCTransfer(ctx, from.Bytes(), receipt, amount, fxTarget.IBCChannel, memo)
if err != nil {
return err
}
if originToken {
return k.erc20Keeper.SetCache(ctx, types.NewIBCTransferKey(fxTarget.IBCChannel, sequence), amount.Amount.Add(fee.Amount))
return k.erc20Keeper.SetCache(ctx, types.NewIBCTransferKey(fxTarget.IBCChannel, sequence), amount.Amount)
}
} else {
if _, err := k.BuildOutgoingTxBatch(ctx, from, receipt, amount, fee); err != nil {
Expand Down

0 comments on commit 9321585

Please sign in to comment.