feat: Do not use V4Router for uniswap v4

Do our own implementation. In the end this is much cleaner than I expected and I was able to do a few improvements:
- we don't need to use actions. using function selectors and delegate call instead
- we don't need to convert into V4 Router types
- we don't need to check balances to get the amount out, we can just use the returned value

--- don't change below this line ---
ENG-4437 Took 3 hours 56 minutes


Took 3 minutes

Took 11 minutes
This commit is contained in:
Diana Carvalho
2025-04-17 14:55:46 +01:00
parent 5567ee459c
commit cd608cb8e9
2 changed files with 293 additions and 73 deletions

View File

@@ -786,8 +786,8 @@ contract TychoRouter is AccessControl, Dispatcher, Pausable, ReentrancyGuard {
returns (bytes memory)
{
if (data.length < 24) revert TychoRouter__InvalidDataLength();
_handleCallback(data);
return "";
bytes memory result = _handleCallback(data);
return result;
}
function _balanceOf(address token, address owner)