feat: Add swap method with tests

Changes:
- If the tokenIn is ETH, skip permit2 approval
- Make executors payable: When using delegatecall the executor inherits the execution context of whoever calls it. Our main swap function can accept ETH, it needs to be payable so by consequence the executors also need to be.
- Set uniswap v2 executor in test router
- Add tests for all possible cases of swap
- Add tests for all cases of splitSwap
- Add test functions to handle permit2 and encode swaps

--- don't change below this line ---
ENG-4041 Took 3 hours 50 minutes

Took 49 seconds


Took 14 seconds
This commit is contained in:
Diana Carvalho
2025-01-27 17:10:47 +00:00
parent a8f6fc1eec
commit 50429ad05c
7 changed files with 537 additions and 21 deletions

View File

@@ -12,6 +12,7 @@ contract UniswapV2Executor is IExecutor {
function swap(uint256 givenAmount, bytes calldata data)
external
payable
returns (uint256 calculatedAmount)
{
address target;