fix: Fix bug with token indexing when wrapping/unwrapping
The issue was that we weren't indexing WETH properly since it was looking for the WETH address in tokens, when only native ETH would be in there - Found by adding integration tests for the wrapping and unwrapping cases.
This commit is contained in:
@@ -207,6 +207,7 @@ contract TychoRouter is
|
||||
tokenInIndex = swapData.tokenInIndex();
|
||||
tokenOutIndex = swapData.tokenOutIndex();
|
||||
split = swapData.splitPercentage();
|
||||
|
||||
currentAmountIn = split > 0
|
||||
? (amounts[tokenInIndex] * split) / 0xffffff
|
||||
: remainingAmounts[tokenInIndex];
|
||||
|
||||
Reference in New Issue
Block a user