Commit Graph

189 Commits

Author SHA1 Message Date
royvardhan
6f421eb374 fix: inequality check for amountConsumed and amountIn 2025-03-05 00:35:51 +05:30
Diana Carvalho
db9c8cde5a fix: Make permit2 permit an action in the universal router
--- don't change below this line ---
ENG-4286 Took 1 hour 35 minutes
2025-03-03 18:33:22 +00:00
Harsh Vardhan Roy
d3e0e066fa Merge branch 'main' into router/hr/ENG-4280-gas-test 2025-03-01 00:11:34 +05:30
royvardhan
ec8d59eeae test: remove gas usage numbers from GasTest 2025-03-01 00:09:15 +05:30
royvardhan
6f69748ba4 test: update gas usage numbers in GasTest 2025-02-28 22:02:21 +05:30
royvardhan
5db95781e5 test: add isPermit2 bool in GasTest for readability 2025-02-28 10:11:04 +05:30
TAMARA LIPOWSKI
33973a65b8 fix: make USV2 factory configurable in Executor
- This factory is not the same for Ethereum and Base, so Base txs were failing when verifying pool addresses.
- I've double checked that we don't have this problem for Balancer V2 - the vault address in the same on Base and on Ethereum Mainnet.
2025-02-27 23:15:08 -05:00
royvardhan
9014fc7383 test: add permit2 tests for simple swaps in TychoRouter and GasTest 2025-02-28 00:40:56 +05:30
royvardhan
35e706d6ea test: add GasTest to compare with Universal Router gas usage 2025-02-28 00:40:56 +05:30
Diana Carvalho
59eb2195b6 feat: Change license to SPDX-License-Identifier: UNLICENSED everywhere
Remove unnecessary files

--- don't change below this line ---
ENG-4260 Took 13 minutes
2025-02-27 17:38:53 +00:00
royvardhan
030505c497 test: add vm.rollFork with correct block in base network tests 2025-02-26 23:04:40 +05:30
royvardhan
ed2bc414d8 test: update asserts in base network test 2025-02-26 22:01:18 +05:30
royvardhan
2323ad3fd9 test: add simple base network tests in usv2 and router 2025-02-26 22:01:18 +05:30
royvardhan
bfaa63a1a0 test: fix router tests with new integration calldata 2025-02-24 21:37:40 +05:30
royvardhan
18efe0305b fix: usv4 integration tests and remove selector from swap/strategy encoder 2025-02-24 19:48:25 +05:30
royvardhan
69745b18fd feat: rm selector from usv3, usv4, update tests, and rename dispatcher file 2025-02-24 17:16:27 +05:30
royvardhan
58116e074a feat: hardcode callback and swap selection in dispatcher 2025-02-24 10:56:17 +05:30
royvardhan
f4f5b841e7 chore: keep test naming consistent 2025-02-22 01:39:11 +05:30
royvardhan
4b77128df2 chore: rename _computePairAddress to _verifyPairAddress, add fake v2 pool in v2 test file 2025-02-22 00:26:15 +05:30
royvardhan
40bd37a1a4 chore: rm redundant usv3 test 2025-02-21 23:28:03 +05:30
royvardhan
2f1507dd0e test: add target verification tests for usv2, usv3 2025-02-21 23:28:03 +05:30
TAMARA LIPOWSKI
023ae9c1ea chore: merge main 2025-02-21 09:48:22 -05:00
TAMARA LIPOWSKI
c42421718b docs: Fix typos in code comments 2025-02-21 09:44:21 -05:00
TAMARA LIPOWSKI
a7aa4d7ebb fix: Native ETH input/output integration tests/fixes
- Only for single swaps
- Used USV4 for this because it's the only DEX we support that allows native ETH swaps
- For Native ETH input single swaps, we need to properly check the remaining amount (we were treating them wronly like ERC20 tokens)
- For Native ETH output single swaps, we were passing the incorrect currency (the settle always needs to be the out token and the take always needs to be the in token, this should not depend on the zeroForOne value).
2025-02-21 00:23:24 -05:00
Diana Carvalho
20e6419a20 feat: Adapt SplitSwapStrategyEncoder to have optional permit2 logic
- If the signer_pk is not passed -> use the swap method that expects the tokens to be already in the Router
- If it is passed -> compute permit2 and use swap method that does the token in transfer
- Extend builder to have another shortcut
- Add integration test with contract
- Update bin (and simplified it) and quickstart

--- don't change below this line ---
ENG-4255 Took 1 hour 51 minutes

Took 2 minutes

Took 7 seconds
2025-02-20 18:29:11 +00:00
TAMARA LIPOWSKI
d65d575003 feat: Don't encode min amount for USV4
We aren't checking min amount for any other executor. This would be overkill (since we are already checking in the main router) and also inconsistent.
2025-02-20 12:15:40 -05:00
TAMARA LIPOWSKI
9eda00cbb6 chore: PR comments 2025-02-20 11:51:08 -05:00
TAMARA LIPOWSKI
bb8778b2bf chore: merge main 2025-02-20 11:45:18 -05:00
TAMARA LIPOWSKI
2d267792f3 docs: Fixed outdated comments
Some copypastas, some other improvements.
2025-02-20 10:46:27 -05:00
TAMARA LIPOWSKI
45fdfc708d feat: UniswapV4 integration test and fixes
- Biggest issue: We must encode the executor address, not the router address, in the USV4 swap encoder
2025-02-19 18:12:11 -05:00
TAMARA LIPOWSKI
c3482a509a feat: TychoRouter swap method not requiring Permit2
- Assume the tokens have been transferred into our router beforehand.
2025-02-19 16:15:57 -05:00
royvardhan
e2a2aaaad1 refactor: usv4 swap encoder test, encoder 2025-02-19 23:59:27 +05:30
royvardhan
f7ddace559 feat: early return in usv4 swap encoder for second swap, add utils 2025-02-19 21:42:13 +05:30
royvardhan
5e9b38876e feat: add integration test for complex swaps 2025-02-19 20:32:55 +05:30
royvardhan
1bfe656e6b feat: add new attributes in encoding context, update usv4 swap encoder and tests 2025-02-19 08:39:21 +05:30
royvardhan
529456f40c feat: add single swap integration test for usv4 executor 2025-02-18 21:24:49 +05:30
Diana Carvalho
2aa63d7ec0 feat: Change signature of _handleCallback to take only bytes calldata
The selector and executor are decoded inside this function now.
For Uniswap V3 I had to manually slice the msg.data from uniswapV3SwapCallback to get the data that matters for the callback

Took 3 hours 12 minutes
2025-02-18 11:11:43 +00:00
royvardhan
2604935609 chore: update unlockCallback and uniswapV3SwapCallback 2025-02-17 22:51:40 +05:30
Harsh Vardhan Roy
0d5c55c546 Merge branch 'main' into router/hr/ENG-4237-refactor-usv3-callback 2025-02-17 21:56:49 +05:30
royvardhan
14e5c127c6 chore: rm safecallback from router 2025-02-15 01:06:23 +05:30
royvardhan
9b8175aff9 chore: cleanup 2025-02-15 01:01:16 +05:30
royvardhan
ad91e485d3 feat: rename execution dispatcher to dispatcher and use dispatcher for USV4 callback 2025-02-15 00:44:28 +05:30
royvardhan
9d3b96f997 feat: add uniswapV3SwapCallback in USV3 executor 2025-02-15 00:34:07 +05:30
royvardhan
cccb252bf2 feat: update handleCallback in USV3 to do verification 2025-02-14 23:27:44 +05:30
royvardhan
d0027e6cf2 refactor: rm callback verifier dispatcher 2025-02-14 23:11:01 +05:30
Diana Carvalho
69d03f0608 fix: Fix PLE tests that break after foundry update
--- don't change below this line ---
ENG-4222 Took 12 minutes

Took 15 seconds
2025-02-14 12:39:36 +00:00
Diana Carvalho
8a8bc697eb fix(univ4): Make slither happy
--- don't change below this line ---
ENG-4222 Took 17 minutes

Took 47 seconds


Took 14 seconds
2025-02-14 12:39:36 +00:00
Diana Carvalho
4d0f5cec64 fix(univ4): Append callback data instead of prepending
Bring back tests on the executor level. This way the executor can actually be used alone

--- don't change below this line ---
ENG-4222 Took 12 minutes
2025-02-14 12:02:07 +00:00
Diana Carvalho
21a8c1a27a feat(univ4): Implement swapping with multiple hops
--- don't change below this line ---
ENG-4222 Took 47 minutes
2025-02-14 12:02:07 +00:00
Diana Carvalho
be7883affc 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
2025-02-14 12:02:07 +00:00