feat(univ4): Refactor input and handle single swap case

Construct the uniswap v4 specific objects inside the executor
The swap test in the executor alone doesn't work anymore because of the callback data prepended to the rest of he calldata

--- don't change below this line ---
ENG-4222 Took 4 hours 0 minutes


Took 40 seconds
This commit is contained in:
Diana Carvalho
2025-02-13 18:40:10 +00:00
parent bb7c6c25a5
commit be7883affc
5 changed files with 182 additions and 140 deletions

View File

@@ -449,9 +449,9 @@ contract TychoRouter is
returns (bytes memory)
{
require(data.length >= 20, "Invalid data length");
bytes4 selector = bytes4(data[data.length - 24:data.length - 20]);
address executor = address(uint160(bytes20(data[data.length - 20:])));
bytes memory protocolData = data[:data.length - 24];
address executor = address(uint160(bytes20(data[0:20])));
bytes4 selector = bytes4(data[20:24]);
bytes memory protocolData = data[24:];
if (!executors[executor]) {
revert ExecutionDispatcher__UnapprovedExecutor();