Commit Graph

183 Commits

Author SHA1 Message Date
royvardhan
c653062027 feat: rename batchSetExecutor to setExecutors 2025-01-30 19:29:24 +05:30
royvardhan
719a15c0e5 chore: fmt 2025-01-30 19:00:15 +05:30
royvardhan
ea504faca1 feat: replace setExecutor with batchSetExecutor 2025-01-30 18:58:54 +05:30
TAMARA LIPOWSKI
92b4ee00d3 chore: remove unused factory variable 2025-01-29 19:53:22 -05:00
TAMARA LIPOWSKI
ca32446a9e feat: UniswapV3Executor and integration tests
- Note: I think we can get the fee straight from the pool... why did we always encode this and send it from the solver? Is this bound to change sometimes?
2025-01-29 19:51:17 -05:00
Diana Carvalho
33ada0cf26 fix: Remove amountReceived, dataOffset from ICallbackVerifier interface
--- don't change below this line ---
ENG-4081 Took 1 hour 36 minutes
2025-01-29 20:19:34 +00:00
Diana Carvalho
63b94b5584 fix: Remove amountReceived and dataOffset from the callback verification
--- don't change below this line ---
ENG-4047 Took 20 minutes
2025-01-29 20:19:34 +00:00
Diana Carvalho
fafeba9248 feat: Implement generic callback
--- don't change below this line ---
ENG-4047 Took 26 minutes


Took 4 minutes

Took 8 seconds

Took 59 seconds

Took 22 seconds
2025-01-29 20:19:34 +00:00
TAMARA LIPOWSKI
d3f1136486 chore: Remove v3-periphery from gitmodules
- We aren't using this anymore since the solc version is outdated
2025-01-29 14:05:56 -05:00
TAMARA LIPOWSKI
96af542923 feat: fixed USV3 Verification
- We cannot use the regular v3-periphery library because of outdated solc versions. I've copied the v3-updated library which we have used in our previous project
2025-01-29 12:12:58 -05:00
TAMARA LIPOWSKI
057c616b0c chore: merge main 2025-01-29 10:19:18 -05:00
TAMARA LIPOWSKI
3b9f7dbb52 chore: update gitmodules 2025-01-29 10:11:32 -05:00
TAMARA LIPOWSKI
7822c4f913 feat: USV3 verification 2025-01-29 10:10:13 -05:00
Harsh Vardhan Roy
cb6d165e7f feat: approve max 2025-01-28 23:49:28 +05:30
royvardhan
15e3933aa7 chore: cleanup 2025-01-28 23:21:22 +05:30
royvardhan
b65b682e8d feat: update remappings and remove node modules 2025-01-28 23:19:06 +05:30
royvardhan
b85428212a fix: slither 2025-01-28 22:59:02 +05:30
royvardhan
b1ca478294 fix: ci 2025-01-28 22:54:31 +05:30
Harsh Vardhan Roy
6af6780f2e Merge branch 'main' into router/hr/ENG-4035-Balancer-V2-Executor 2025-01-28 22:43:02 +05:30
royvardhan
6c30cf8f66 fix: filter paths slither 2025-01-28 22:41:36 +05:30
Diana Carvalho
0a1f522207 fix: fix submodules
--- don't change below this line ---
ENG-4041 Took 6 minutes
2025-01-28 17:10:15 +00:00
Diana Carvalho
655cf91984 feat: Assume that funds will never go straight from a pool to the receiver
- The funds will always go through the router
- Rename splitSwap for Swap
- Improve tests

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


Took 23 seconds

Took 42 seconds
2025-01-28 17:10:15 +00:00
royvardhan
7a83eddc92 fix: slither 2025-01-28 22:38:26 +05:30
Diana Carvalho
dfa7033d2e feat: Smother slither and add a reentrancy guard in swap()
--- don't change below this line ---
ENG-4041 Took 34 minutes
2025-01-28 16:59:29 +00:00
Diana Carvalho
c2347ac79e 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
2025-01-28 16:59:29 +00:00
Diana Carvalho
dfa0f7d176 chore: Address compilers warnings and use EXECUTOR_SETTER instead of Bob in tests
--- don't change below this line ---
ENG-4041 Took 48 seconds


Took 18 seconds
2025-01-28 16:59:29 +00:00
Diana Carvalho
d8de65aedf fix: Remove checkMinAmount
If minAmountOut == 0, then skip the check

--- don't change below this line ---
ENG-4041 Took 35 minutes
2025-01-28 16:59:29 +00:00
Diana Carvalho
50429ad05c 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
2025-01-28 16:59:29 +00:00
Diana Carvalho
a8f6fc1eec feat: Add swap method (first attempt)
Will add tests and fullproof it in a future PR

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

Took 42 seconds

Took 5 seconds
2025-01-28 16:59:29 +00:00
Diana Carvalho
3b2d9fcbdf feat: Wrap and unwrap ETH
--- don't change below this line ---
ENG-4041 Took 2 hours 28 minutes

Took 14 seconds

Took 11 seconds

Took 2 minutes

Took 1 minute


Took 7 minutes
2025-01-28 16:59:29 +00:00
royvardhan
a4e405fb75 feat: add tests for Balancer V2 executor 2025-01-28 19:32:45 +05:30
royvardhan
5dc5e23239 fix: build 2025-01-28 18:57:59 +05:30
royvardhan
44db2e52b3 fix: rm exactOut 2025-01-28 18:32:28 +05:30
royvardhan
a700189aaf feat: add balancer v2 executor 2025-01-27 22:54:56 +05:30
Tamara
cb38be7ad6 Merge branch 'main' into router/tnl/ENG-4046-static-call-verifier 2025-01-27 10:21:15 -05:00
royvardhan
4ee337d1ee fix: ci 2025-01-27 20:44:01 +05:30
Harsh Vardhan Roy
68f07b1852 Merge branch 'main' into router/hr/ENG-4171-Implement-Pause 2025-01-27 20:40:36 +05:30
TAMARA LIPOWSKI
ee5040043b docs: No repetition in testCallVerifierNoSelector 2025-01-27 10:08:30 -05:00
royvardhan
5734b53554 fix: test pauser 2025-01-27 17:11:47 +05:30
TAMARA LIPOWSKI
8ef061fd75 refactor: Move code check to CallbackVerificationDispatcher
[copied from exact same reasoning with execution code-checking]

I was inspired to do this because, when disabling the slither check for the staticcall when calling the callback verifier, I realized it's not clear from the same contract that we have already checked for contract code existence when setting the verifier. This made me feel uneasy, as this contract can then not stand alone and must rely on the higher level contract to safely check for code existence, otherwise the staticcall is unsafe. Keeping this logic in a separate contract seems error-prone to me, as we may remove the check for code existence without immediately realizing the implications of doing so.

For this reason I have organized it as follows:
- Logic/tests relating to proper roles/access control in the main TychoRouter.
- Lower-level logic/tests that check contract validity before setting the callback verifier in the CallbackVerificationDispatcher
2025-01-24 17:17:10 -05:00
TAMARA LIPOWSKI
ad0748e9c3 feat: Perform staticcall to CallbackVerifier 2025-01-24 16:55:21 -05:00
Diana Carvalho
9c2b205c30 chore: Rename all SwapExecutor to Executor only for simplicity
--- don't change below this line ---
ENG-4033 Took 9 minutes
2025-01-24 17:03:00 +00:00
Diana Carvalho
1ad04bc9e9 chore: After rebase fixes
--- don't change below this line ---
ENG-4033 Took 5 minutes
2025-01-24 17:03:00 +00:00
Diana Carvalho
b3241804c6 chore: Rename Uniswapv2SwapExecutor to UniswapV2Executor
--- don't change below this line ---
ENG-4033 Took 4 minutes
2025-01-24 17:03:00 +00:00
Diana Carvalho
ed44f4e993 fix: Add input validation size in Uniswapv2SwapExecutor
--- don't change below this line ---
ENG-4033 Took 12 minutes
2025-01-24 17:03:00 +00:00
Diana Carvalho
b9f4451769 fix: Remove exactOut logic from Uniswapv2SwapExecutor
We don't support it now

--- don't change below this line ---
ENG-4033 Took 9 minutes
2025-01-24 17:03:00 +00:00
Diana Carvalho
5627a1902b feat: UniswapV2 SwapExecutor
--- don't change below this line ---
ENG-4033 Took 52 minutes

Took 3 minutes

Took 5 minutes

Took 36 seconds

Took 2 minutes


Took 30 seconds
2025-01-24 17:03:00 +00:00
TAMARA LIPOWSKI
1fabff19c4 feat: Emit event when removing executor
- This is not so relevant for security, but it would sabotage our performance if an executor was wrongly removed, so it's worth it to know every time this happens.
2025-01-24 11:45:24 -05:00
TAMARA LIPOWSKI
5214710530 chore: docstrings and other small improvements 2025-01-24 11:39:49 -05:00
royvardhan
4fe0a76cf9 chore: fmt 2025-01-24 22:01:18 +05:30