Commit Graph

148 Commits

Author SHA1 Message Date
royvardhan
a700189aaf feat: add balancer v2 executor 2025-01-27 22:54:56 +05:30
Tamara
0e0c13b169 Merge pull request #27 from propeller-heads/router/tnl/ENG-4046-static-call-verifier
feat: Perform staticcall to CallbackVerifier
2025-01-27 10:22:15 -05:00
Tamara
cb38be7ad6 Merge branch 'main' into router/tnl/ENG-4046-static-call-verifier 2025-01-27 10:21:15 -05:00
semantic-release-bot
5be639e510 chore(release): 0.17.0 [skip ci]
## [0.17.0](https://github.com/propeller-heads/tycho-execution/compare/0.16.0...0.17.0) (2025-01-27)

### Features

* add pause/unpause methods ([c982ed9](c982ed99e8))

### Bug Fixes

* ci ([4ee337d](4ee337d1ee))
* test pauser ([5734b53](5734b53554))
2025-01-27 15:18:32 +00:00
Harsh Vardhan Roy
466e3222e5 Merge pull request #24 from propeller-heads/router/hr/ENG-4171-Implement-Pause
feat: add pause/unpause methods
2025-01-27 20:46:08 +05:30
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
7f53411a73 Merge branch 'main' into router/tnl/ENG-4046-static-call-verifier 2025-01-27 10:08:39 -05:00
TAMARA LIPOWSKI
ee5040043b docs: No repetition in testCallVerifierNoSelector 2025-01-27 10:08:30 -05:00
semantic-release-bot
6e81eccfdb chore(release): 0.16.0 [skip ci]
## [0.16.0](https://github.com/propeller-heads/tycho-execution/compare/0.15.0...0.16.0) (2025-01-27)

### Features

* add balance v2 encoder test ([9cecea8](9cecea8968))

### Bug Fixes

* async ([7c198ff](7c198fff92))
2025-01-27 14:43:07 +00:00
Harsh Vardhan Roy
2f73e8da41 Merge pull request #26 from propeller-heads/encoder/hr/ENG-4068-Balance-V2-Test 2025-01-27 20:09:18 +05:30
royvardhan
5734b53554 fix: test pauser 2025-01-27 17:11:47 +05:30
royvardhan
7c198fff92 fix: async 2025-01-27 13:44:03 +05:30
royvardhan
9cecea8968 feat: add balance v2 encoder test 2025-01-27 13:44:03 +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
semantic-release-bot
8a5d38d5ee chore(release): 0.15.0 [skip ci]
## [0.15.0](https://github.com/propeller-heads/tycho-execution/compare/0.14.0...0.15.0) (2025-01-24)

### Features

* UniswapV2 SwapExecutor ([5627a19](5627a1902b))

### Bug Fixes

* Add input validation size in Uniswapv2SwapExecutor ([ed44f4e](ed44f4e993))
* Remove exactOut logic from Uniswapv2SwapExecutor ([b9f4451](b9f4451769))
2025-01-24 17:06:34 +00:00
dianacarvalho1
bf50ec59f0 Merge pull request #23 from propeller-heads/router/dc/ENG-4033-univ2-executor
feat: UniswapV2 SwapExecutor
2025-01-24 17:04:12 +00: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
semantic-release-bot
ceedaa6348 chore(release): 0.14.0 [skip ci]
## [0.14.0](https://github.com/propeller-heads/tycho-execution/compare/0.13.0...0.14.0) (2025-01-24)

### Features

* delegatecall to executor in SwapExecutionDispatcher ([e91ee96](e91ee96129))
* Emit event when removing executor ([1fabff1](1fabff19c4))

### Bug Fixes

* ISwapExecutor shouldn't be payable ([3df17e8](3df17e8924))
* Silence slither warnings ([b616e11](b616e11354))
2025-01-24 16:51:12 +00:00
Tamara
7265301531 Merge pull request #20 from propeller-heads/router/tnl/ENG-4043-delegate-call-executor
feat: delegatecall to executor in SwapExecutionDispatcher
2025-01-24 11:47:19 -05: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
royvardhan
f0f9339101 chore: add TODO in test 2025-01-24 22:00:13 +05:30
royvardhan
c982ed99e8 feat: add pause/unpause methods 2025-01-24 18:12:56 +05:30
TAMARA LIPOWSKI
3df17e8924 fix: ISwapExecutor shouldn't be payable
No reason for that.
2025-01-23 15:43:16 -05:00
TAMARA LIPOWSKI
fb9f340cb7 refactor: Move contract code-checking logic to SwapExecutionDispatcher
I was inspired to do this because, when disabling the slither check for the delegatecall when calling the swap executor, I realized it's not clear from the same contract that we have already checked for contract code existence when setting the executor. 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 delegatecall 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 checks contract validity before setting the executor in the SwapExecutionDispatcher
2025-01-23 15:40:24 -05:00
TAMARA LIPOWSKI
b616e11354 fix: Silence slither warnings
- low level calls are fine, since we are checking for success, and we have already checked for contract existence when setting swap executors
- dead-code is silenced
- fix solidity version
2025-01-23 15:22:31 -05:00
TAMARA LIPOWSKI
825af0f8d7 test: Thorough tests for main SwapExecutionDispatcher method 2025-01-23 15:22:31 -05:00
TAMARA LIPOWSKI
e91ee96129 feat: delegatecall to executor in SwapExecutionDispatcher 2025-01-23 15:22:31 -05:00
semantic-release-bot
70509f547d chore(release): 0.13.0 [skip ci]
## [0.13.0](https://github.com/propeller-heads/tycho-execution/compare/0.12.0...0.13.0) (2025-01-23)

### Features

* Implement Permit2 ([ce9ae49](ce9ae49e6f))

### Bug Fixes

* Correct encoding of the approvals ([04e925f](04e925fe81))
* Small improvements ([b9cfc4a](b9cfc4a35b))
2025-01-23 17:22:41 +00:00
dianacarvalho1
2858af94ab Merge pull request #15 from propeller-heads/encoding/dc/ENG-4063-permit2
feat: Implement Permit2 encoding
2025-01-23 17:20:03 +00:00
dianacarvalho1
45af3585ec Merge branch 'main' into encoding/dc/ENG-4063-permit2 2025-01-23 17:18:49 +00:00
semantic-release-bot
7e49741e93 chore(release): 0.12.0 [skip ci]
## [0.12.0](https://github.com/propeller-heads/tycho-execution/compare/0.11.0...0.12.0) (2025-01-23)

### Features

* add tests for withdraw, fee and make it DRY ([056582c](056582ca2f))

### Bug Fixes

* pr comments ([9c99b73](9c99b73884))
2025-01-23 17:08:52 +00:00
Harsh Vardhan Roy
434ce60bfd Merge pull request #22 from propeller-heads/router/hr/ENG-4167-Tests-Withdraw-FeeReceiver 2025-01-23 22:36:24 +05:30
royvardhan
9c99b73884 fix: pr comments 2025-01-23 21:54:31 +05:30
Diana Carvalho
b9cfc4a35b fix: Small improvements
- Rename test
- Improve error messages
- Remove unnecessary asserts

--- don't change below this line ---
ENG-4063 Took 52 seconds
2025-01-23 15:53:13 +00:00
Diana Carvalho
7d34236f0c ci: Don't run tests with --all-features flag
This was running the test that should be skipped in CI and it is flagged as
#[cfg_attr(not(feature = "fork-tests"), ignore)]

--- don't change below this line ---
ENG-4063 Took 6 minutes
2025-01-23 15:52:19 +00:00
Diana Carvalho
04e925fe81 fix: Correct encoding of the approvals
- Add data validations similar to the ones done in the Permit2 SDK
- Fix Domain main (!!!) It's Permit2 not Permit
- Return the whole function signature data (owner, permit_single, signature) encoded

test improvements:
- Don't compare the timestamps, this was making the test fail sometimes and pass other times
- Add a test to run on an anvil fork and actually call permit2 contract to double check the encoded data works

misc:
Rename get_allowance_data -> get_existing_allowance

--- don't change below this line ---
ENG-4063 Took 5 hours 19 minutes


Took 11 seconds
2025-01-23 15:52:19 +00:00
Diana Carvalho
ce9ae49e6f feat: Implement Permit2
- Retrieve allowance data from an RPC
- Encode approvals:
  - Create PermitSingle (and PermitDetails)
  - Use alloy eip712 to get signing hash on typed data
  - Sign data
- Add chrono and alloy eip712 and signer-local to Cargo.toml

--- don't change below this line ---
ENG-4063 Took 1 hour 58 minutes

Took 18 seconds

Took 32 seconds

Took 9 seconds

Took 1 minute


Took 32 minutes
2025-01-23 15:52:19 +00:00
royvardhan
056582ca2f feat: add tests for withdraw, fee and make it DRY 2025-01-23 21:04:05 +05:30
semantic-release-bot
7bfd6c981c chore(release): 0.11.0 [skip ci]
## [0.11.0](https://github.com/propeller-heads/tycho-execution/compare/0.10.0...0.11.0) (2025-01-23)

### Features

* add LibPrefixLengthEncodedByteArray with tests ([f25da21](f25da218d7))
* keep assembly ([ae662d0](ae662d0026))
2025-01-23 14:45:03 +00:00
Harsh Vardhan Roy
8015e1a672 Merge pull request #21 from propeller-heads/router/hr/ENG-4056-Bytes-Array-Conversion
feat: add LibPrefixLengthEncodedByteArray
2025-01-23 20:12:38 +05:30
royvardhan
e6f3fc7004 chore: move to lib/bytes 2025-01-23 19:14:56 +05:30