misc: fix _swapChecked for cyclic swap, update encoder swap path validation, add cyclic sequesntial swap integration test
This commit is contained in:
@@ -14,6 +14,7 @@ import "@permit2/src/interfaces/IAllowanceTransfer.sol";
|
||||
import "./Dispatcher.sol";
|
||||
import {LibSwap} from "../lib/LibSwap.sol";
|
||||
import {IPoolManager} from "@uniswap/v4-core/src/interfaces/IPoolManager.sol";
|
||||
import "forge-std/console.sol";
|
||||
|
||||
// ✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷
|
||||
// ✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷✷
|
||||
@@ -259,7 +260,6 @@ contract TychoRouter is AccessControl, Dispatcher, Pausable, ReentrancyGuard {
|
||||
: IERC20(tokenIn).balanceOf(address(this));
|
||||
|
||||
amountOut = _swap(amountIn, nTokens, swaps);
|
||||
|
||||
uint256 currentBalance = tokenIn == address(0)
|
||||
? address(this).balance
|
||||
: IERC20(tokenIn).balanceOf(address(this));
|
||||
@@ -323,6 +323,10 @@ contract TychoRouter is AccessControl, Dispatcher, Pausable, ReentrancyGuard {
|
||||
revert TychoRouter__EmptySwaps();
|
||||
}
|
||||
|
||||
console.log("amountIn", amountIn);
|
||||
console.log("nTokens", nTokens);
|
||||
console.logBytes(swaps_);
|
||||
|
||||
uint256 currentAmountIn;
|
||||
uint256 currentAmountOut;
|
||||
uint8 tokenInIndex = 0;
|
||||
|
||||
Reference in New Issue
Block a user