feat: Add executor and selector to Swap

Add tests to Swap
Modify ExecutionDispatcher and TychoRouter to account for these changes

--- don't change below this line ---
ENG-4041 Took 57 minutes


Took 10 seconds
This commit is contained in:
Diana Carvalho
2025-01-28 12:19:07 +00:00
parent dfa0f7d176
commit c2347ac79e
7 changed files with 176 additions and 86 deletions

View File

@@ -167,10 +167,13 @@ contract TychoRouterTestSetup is Test, Constants {
uint8 tokenInIndex,
uint8 tokenOutIndex,
uint24 split,
address executor,
bytes4 selector,
bytes memory protocolData
) internal pure returns (bytes memory) {
return
abi.encodePacked(tokenInIndex, tokenOutIndex, split, protocolData);
return abi.encodePacked(
tokenInIndex, tokenOutIndex, split, executor, selector, protocolData
);
}
function encodeUniswapV2Swap(
@@ -178,9 +181,7 @@ contract TychoRouterTestSetup is Test, Constants {
address target,
address receiver,
bool zero2one
) internal view returns (bytes memory) {
return abi.encodePacked(
usv2Executor, bytes4(0), tokenIn, target, receiver, zero2one
);
) internal pure returns (bytes memory) {
return abi.encodePacked(tokenIn, target, receiver, zero2one);
}
}