Skip to content

Commit

Permalink
fix: issue-82
Browse files Browse the repository at this point in the history
  • Loading branch information
fann95 committed Oct 31, 2023
1 parent 97f30b9 commit b568b21
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contracts/abstract/ApproveSwapAndPay.sol
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ abstract contract ApproveSwapAndPay {
// Maximizing approval if necessary
_maxApproveIfNecessary(tokenIn, externalSwap.swapTarget, amountIn);
uint256 balanceOutBefore = _getBalance(tokenOut);
(externalSwap.swapAmountInDataIndex > externalSwap.swapData.length / 0x20).revertError(
ErrLib.ErrorCode.INVALID_SWAP
);
// Patching the amount and calling the external swap
externalSwap.swapTarget._patchAmountAndCall(
externalSwap.swapData,
Expand Down

0 comments on commit b568b21

Please sign in to comment.