Skip to content

Commit 3b693c4

Browse files
committed
Unnecessary Transfer When feeAmount is Zero
Spearbit #5
1 parent 07ed9b2 commit 3b693c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libraries/SwapLib.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ library SwapLib {
167167

168168
// Slice off separate LP fee recipient
169169

170-
if (ctx.sParams.feeRecipient != address(0)) {
170+
if (ctx.sParams.feeRecipient != address(0) && feeAmount != 0) {
171171
IERC20(assetInput).safeTransfer(ctx.sParams.feeRecipient, feeAmount);
172172

173173
amount -= feeAmount;

0 commit comments

Comments
 (0)