Commit Graph

1329 Commits

Author SHA1 Message Date
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
TAMARA LIPOWSKI
556af0253d test: Add test for USV4 sequential swap 2025-02-14 00:51:06 -05:00
TAMARA LIPOWSKI
b452372714 refactor: deduplicate validation for Split & USV4 strategy
We use the same validation for both SplitSwapStrategy and UniswapV4Strategy - so, instead, put the validation into a Validator trait that gets initialized in both swap strategies in order to avoid duplication.
2025-02-13 15:30:09 -05:00
royvardhan
5853de679a feat: move callback testing to usv3 executor 2025-02-14 01:29:30 +05:30
TAMARA LIPOWSKI
f32210bb1f feat: (WIP) UniswapV4 encoding
- To keep any knowledge of USV4 separate from regular splits, I've made a new USV4 encoding strategy that will be used only if we detect sequential USV4 swaps.
- For single USV4 swaps without necessary optimizations, the regular split swap strategy can be used
- No need to change the swap struct interface to take multiple swaps - this concatenation can be done at the swap strategy level.

TODO:
- test
- deduplicate code from split strategy
- UniswapV4SwapEncoder
2025-02-13 14:51:08 -05:00
royvardhan
80500e615e feat: fix input decoding in usv3 executor and execution dispatcher 2025-02-14 00:53:43 +05:30
royvardhan
bd1971334e feat: update new interface in codebase 2025-02-13 20:54:54 +05:30
royvardhan
a309825769 refactor: rm usv3 callback from router and add generic callback to executor 2025-02-13 20:31:21 +05:30
semantic-release-bot
bb7c6c25a5 chore(release): 0.38.0 [skip ci]
## [0.38.0](https://github.com/propeller-heads/tycho-execution/compare/0.37.0...0.38.0) (2025-02-13)

### Features

* Add a production foundry profile ([dae38ce](dae38ceaf9))
* Support uniswap v4 callback in TychoRouter ([591d73b](591d73ba71))

### Bug Fixes

* Verify that the executor exists in the uni v4 callback ([4c5e3bf](4c5e3bf6a9))
2025-02-13 12:12:02 +00:00
dianacarvalho1
52a3c966cb Merge pull request #64 from propeller-heads/router/dc/ENG-4223-uniswap-v4-callback
feat: Uniswap v4 callback
2025-02-13 12:09:19 +00:00
Diana Carvalho
dae38ceaf9 feat: Add a production foundry profile
It can be used with FOUNDRY_PROFILE=production forge build

--- don't change below this line ---
ENG-4223 Took 15 minutes
2025-02-13 12:00:59 +00:00
Diana Carvalho
4c5e3bf6a9 fix: Verify that the executor exists in the uni v4 callback
--- don't change below this line ---
ENG-4223 Took 10 minutes
2025-02-13 12:00:59 +00:00
Diana Carvalho
591d73ba71 feat: Support uniswap v4 callback in TychoRouter
Make TychoRouter inherit from SafeCallback and then delegatecall to the UniswapV4 executor
Add a test for this. I had to update the block of our forked network in the tests. Because of this I had to update all the asserts in previous tests

Had to change the optimizer_runs in foundry.toml because of weird Yul errors when compiling

--- don't change below this line ---
ENG-4223 Took 1 hour 21 minutes

Took 7 seconds


Took 35 seconds
2025-02-13 12:00:59 +00:00
Diana Carvalho
29eb50d0a1 chore: Create a UniswapV4Utils with encoding functions
--- don't change below this line ---
ENG-4223 Took 4 hours 33 minutes

Took 2 minutes


Took 28 minutes
2025-02-13 12:00:59 +00:00
semantic-release-bot
28bfe2e32a chore(release): 0.37.0 [skip ci]
## [0.37.0](https://github.com/propeller-heads/tycho-execution/compare/0.36.2...0.37.0) (2025-02-12)

### Features

* add callback ([ed90cb4](ed90cb4ef1))
* add new pair test ([7ca647f](7ca647f009))
* add router params ([e62c332](e62c332451))
* add test for UniswapV4Executor ([4599f07](4599f07df0))
* add univ4 executor ([cb4c8f4](cb4c8f4e51))
* handle amounts in unlockCallback ([b2097ca](b2097ca4a5))
* move encoding to test ([c264084](c264084783))
* support multi swap decoding ([d998c88](d998c88cfe))
* update solc and add V4Router into UniswapV4Executor ([bdd3daf](bdd3daffba))

### Bug Fixes

* _pay and msgSender ([d790682](d79068282a))
* add equality check, amountInOrOut check, update _decodeData ([b47cff3](b47cff3fc9))
* git submodules and strict equality check in v4 executor ([a8cc84d](a8cc84ddce))
* handle native token balance changes ([0c40e9e](0c40e9e979))
* reciever issue ([ae0b07b](ae0b07b2a4))
* remove executeActions wrapper, strict equality checks and rename swap return ([2371ab2](2371ab2a1f))
* remove extra _receiver and redundant asserts ([ff3209b](ff3209b1c8))
* rm callback fn ([1a36c33](1a36c33bc6))
* rm redundant transfer ([24d4e76](24d4e762a2))
2025-02-12 20:01:08 +00:00
Harsh Vardhan Roy
f7380b95e4 Merge pull request #58 from propeller-heads/router/hr/ENG-4105-uniswap-v4-executor 2025-02-13 01:29:21 +05:30
royvardhan
d79068282a fix: _pay and msgSender 2025-02-13 00:25:26 +05:30
royvardhan
0c40e9e979 fix: handle native token balance changes 2025-02-13 00:25:26 +05:30
royvardhan
fe48c64e8e chore: change balance checks naming 2025-02-13 00:25:26 +05:30
royvardhan
2371ab2a1f fix: remove executeActions wrapper, strict equality checks and rename swap return 2025-02-13 00:25:26 +05:30
royvardhan
b47cff3fc9 fix: add equality check, amountInOrOut check, update _decodeData 2025-02-13 00:25:26 +05:30
royvardhan
ff3209b1c8 fix: remove extra _receiver and redundant asserts 2025-02-13 00:25:26 +05:30
royvardhan
a555683257 chore: consistent naming 2025-02-13 00:25:26 +05:30
royvardhan
120c96215f chore: remove redundant data from _decodeData 2025-02-13 00:25:25 +05:30
royvardhan
a8cc84ddce fix: git submodules and strict equality check in v4 executor 2025-02-13 00:25:25 +05:30
royvardhan
d998c88cfe feat: support multi swap decoding 2025-02-13 00:25:25 +05:30
royvardhan
c264084783 feat: move encoding to test 2025-02-13 00:25:25 +05:30
royvardhan
ae0b07b2a4 fix: reciever issue 2025-02-13 00:25:25 +05:30
royvardhan
7ca647f009 feat: add new pair test 2025-02-13 00:25:25 +05:30
royvardhan
4599f07df0 feat: add test for UniswapV4Executor 2025-02-13 00:25:25 +05:30
royvardhan
e62c332451 feat: add router params 2025-02-13 00:25:25 +05:30
royvardhan
bdd3daffba feat: update solc and add V4Router into UniswapV4Executor 2025-02-13 00:25:25 +05:30
royvardhan
24d4e762a2 fix: rm redundant transfer 2025-02-13 00:25:25 +05:30
royvardhan
1a36c33bc6 fix: rm callback fn 2025-02-13 00:25:25 +05:30
royvardhan
b2097ca4a5 feat: handle amounts in unlockCallback 2025-02-13 00:25:25 +05:30
royvardhan
ed90cb4ef1 feat: add callback 2025-02-13 00:25:25 +05:30
royvardhan
cb4c8f4e51 feat: add univ4 executor 2025-02-13 00:25:25 +05:30
semantic-release-bot
00fe142952 chore(release): 0.36.2 [skip ci]
## [0.36.2](https://github.com/propeller-heads/tycho-execution/compare/0.36.1...0.36.2) (2025-02-12)

### Bug Fixes

* Miscellaneous audit remarks ([582533f](582533fa31))
2025-02-12 09:54:29 +00:00
dianacarvalho1
3ce384ea16 Merge pull request #63 from propeller-heads/router/dc/ENG-4226-misc-audit-remarks
fix: Miscellaneous audit remarks
2025-02-12 09:51:39 +00:00
Diana Carvalho
582533fa31 fix: Miscellaneous audit remarks
- Move pause functions together
- Add missing zero checks
- Use openzepplin's sendValues instead of transfer

--- don't change below this line ---
ENG-4226 Took 25 minutes


Took 2 minutes
2025-02-11 16:35:26 +00:00
semantic-release-bot
0626cea164 chore(release): 0.36.1 [skip ci]
## [0.36.1](https://github.com/propeller-heads/tycho-execution/compare/0.36.0...0.36.1) (2025-02-11)
2025-02-11 16:33:23 +00:00
Tamara
135994f13a Merge pull request #61 from propeller-heads/encoding/tnl/small-misc-fixes
refactor: (Solution) replace check_amount with checked_amount
2025-02-11 11:31:37 -05:00
TAMARA LIPOWSKI
1c565deb57 refactor: (Solution) replace check_amount with checked_amount
- This is to have consistency with checked_token
2025-02-11 11:25:58 -05:00
semantic-release-bot
c4c282a62e chore(release): 0.36.0 [skip ci]
## [0.36.0](https://github.com/propeller-heads/tycho-execution/compare/0.35.1...0.36.0) (2025-02-11)

### Features

* Add selector to Transaction ([dd7ecac](dd7ecac324))
2025-02-11 16:20:41 +00:00
dianacarvalho1
e4e44ecd9c Merge pull request #60 from propeller-heads/encoding/dc/extend-transaction-to-have-selector
feat: Add selector to Transaction
2025-02-11 16:18:48 +00:00
dianacarvalho1
0d641582dd Merge branch 'main' into encoding/dc/extend-transaction-to-have-selector 2025-02-11 16:17:20 +00:00
semantic-release-bot
3d2c148f70 chore(release): 0.35.1 [skip ci]
## [0.35.1](https://github.com/propeller-heads/tycho-execution/compare/0.35.0...0.35.1) (2025-02-11)

### Bug Fixes

* (TychoRouter) Revert if empty swaps ([37efe52](37efe52c10))
2025-02-11 14:52:52 +00:00
Tamara
5e29dd94b2 Merge pull request #59 from propeller-heads/router/tnl/ENG-4074-no-empty-swaps
fix: (TychoRouter) Revert if empty swaps
2025-02-11 09:50:03 -05:00
Diana Carvalho
dd7ecac324 feat: Add selector to Transaction
Return selector in the StrategyEncoder. This is needed for the ExecutorStrategyEncoder

--- don't change below this line ---
ENG-4088 Took 12 minutes


Took 13 seconds
2025-02-11 12:20:47 +00:00
TAMARA LIPOWSKI
37efe52c10 fix: (TychoRouter) Revert if empty swaps
- This is for security purposes. Max uncovered a vulnerability where funds could be stolen if we don't ether the while loop (i.e. if we have empty swaps).
2025-02-10 23:49:01 -05:00