Commit Graph

1002 Commits

Author SHA1 Message Date
Diana Carvalho
0ff4aef0c7 chore: Write encoding rust calldata to file and read in solidity test
This way we can automatically replace the calldata when something changes. We don't need to manually replace the string ourselves.

--- don't change below this line ---
ENG-4453 Took 3 hours 26 minutes
2025-04-29 10:23:47 +01:00
semantic-release-bot
b03c58d833 chore(release): 0.84.0 [skip ci]
## [0.84.0](https://github.com/propeller-heads/tycho-execution/compare/0.83.0...0.84.0) (2025-04-28)

### Features

* Clear transient storage after swap call ([1b003dc](1b003dc483))
2025-04-28 14:25:10 +00:00
Tamara
ff14c8f144 Merge pull request #182 from propeller-heads/router/tnl/reset-transient-storage
feat: Clear transient storage after swap call
2025-04-28 10:23:15 -04:00
Tamara
b27e6c62ec Merge branch 'main' into router/tnl/reset-transient-storage 2025-04-28 09:32:35 -04:00
Tamara
94591339a1 Merge pull request #181 from propeller-heads/router/tnl/rename-dispatcher-methods
chore: rename dispatcher methods for clarity
2025-04-28 09:13:17 -04:00
Tamara
07fbc0ac10 Merge branch 'main' into router/tnl/rename-dispatcher-methods 2025-04-28 09:00:21 -04:00
semantic-release-bot
f141d2dda1 chore(release): 0.83.0 [skip ci]
## [0.83.0](https://github.com/propeller-heads/tycho-execution/compare/0.82.1...0.83.0) (2025-04-28)

### Features

* Add security check for callback selector ([4de1d10](4de1d10406))

### Bug Fixes

* Remove tload from executor ([3fb17c7](3fb17c71da))
2025-04-28 12:58:53 +00:00
Tamara
87d6ead4c7 Merge branch 'main' into router/tnl/rename-dispatcher-methods 2025-04-28 08:56:08 -04:00
Tamara
f6c62e2b0f Merge pull request #180 from propeller-heads/router/tnl/remove-tload-usv4
fix: Remove tload from executor
2025-04-28 08:55:54 -04:00
TAMARA LIPOWSKI
1b003dc483 feat: Clear transient storage after swap call
- This was originally remaining if no callback was performed, possible resulting in unexpected behaviour and an increased attack surface.
- Also specify nonzero slot for transient storage in order to reduce the risk of dangerous slot collision.
2025-04-25 21:39:09 -04:00
TAMARA LIPOWSKI
8b55d90608 chore: rename dispatcher methods for clarity 2025-04-25 21:07:48 -04:00
TAMARA LIPOWSKI
732450670f chore: remove outdated docstring 2025-04-25 18:33:14 -04:00
TAMARA LIPOWSKI
4de1d10406 feat: Add security check for callback selector
- Do not allow any callback to be chosen, for security and clarity purposes
2025-04-25 11:02:12 -04:00
TAMARA LIPOWSKI
3fb17c71da fix: Remove tload from executor
- Store the executor address when deploying instead.
- We would like to keep all instances of tload and tstore within the callback mechanism of our main TychoRouter contract for security reasons and to prevent any unexpected behaviour
- This way it's easy to reason that UniswapV4Executor will only ever execute a delegatecall to itself. Before it could in theory execute a delegatecall to any address. One had to look at all occurences of tstore(0, x) to ensure the address was constrained.
2025-04-24 16:57:08 -04:00
semantic-release-bot
32c2d52971 chore(release): 0.82.1 [skip ci]
## [0.82.1](https://github.com/propeller-heads/tycho-execution/compare/0.82.0...0.82.1) (2025-04-24)

### Bug Fixes

* Make clippy happy after new format! format ([7bf0b48](7bf0b48ea6))
2025-04-24 13:45:34 +00:00
dianacarvalho1
b972b04901 Merge pull request #178 from propeller-heads/router/dc/test-improvements
chore: move single tests to TychoRouterProtocolIntegration.t.sol
2025-04-24 14:43:35 +01:00
Diana Carvalho
7bf0b48ea6 fix: Make clippy happy after new format! format
Took 19 minutes
2025-04-24 13:34:08 +01:00
Diana Carvalho
fa872f5f0e chore: move single tests to TychoRouterProtocolIntegration.t.sol
They were in TychoRouterSplitSwap.t.sol
Add docs to _balancerOf

Took 2 hours 8 minutes


Took 18 seconds
2025-04-24 13:06:50 +01:00
semantic-release-bot
6b3a26f392 chore(release): 0.82.0 [skip ci]
## [0.82.0](https://github.com/propeller-heads/tycho-execution/compare/0.81.0...0.82.0) (2025-04-23)

### Features

* (WIP) Support selection of transfer into router ([a301a1c](a301a1cef3))
* Add sequential swap methods ([3ae9d3a](3ae9d3ad67))
* Add SequentialSwap integration test with regular approvals ([6e7bf3c](6e7bf3c019))
* Add SingleSwap integration test and fix bug in method signatures ([df1c05e](df1c05ea00))
* Add TokenTransfer class to BalancerV2 ([3a73fef](3a73fef933))
* Add TokenTransfer class to Curve ([462be54](462be5463b))
* Add transfer out for Curve ([328a281](328a281a44))
* Add transfer out for Uniswap V4 ([ec87969](ec87969aa6))
* Allow for token_in_already_in_router ([df92be8](df92be8875))
* allow to pass msg.sender to USV3 callback ([a37805d](a37805d046))
* allow to pass msg.sender to USV3 callback ([8969186](8969186654))
* Decode single and sequential swaps in LibSwap ([1dad4af](1dad4afb6b))
* Delete EVMStrategyEncoder (this is now unnecessary) ([6430c99](6430c99d76))
* Do not use V4Router for uniswap v4 ([cd608cb](cd608cb8e9))
* ExecutorTransferMethods helper contract ([147ba68](147ba68392))
* ExecutorTransferMethods in UniswapV3Executor ([3189139](31891397c7))
* ExecutorTransferMethods in UniswapV3Executor ([3890099](389009901e))
* Fix rollFork usage for Ekubo test ([d7b5e6d](d7b5e6dba5))
* Make USV3 callback work with direct executor call ([5562dd2](5562dd210e))
* No more fee taking ([6f2e5ac](6f2e5ac10e))
* Optimize transfer to first pool ([59a80dc](59a80dc392))
* Proper USV2Executor transfer decoding + tests ([e8f56ff](e8f56ff088))
* Proper USV2Executor transfer decoding + tests ([ca1d474](ca1d474f08))
* Proper USV3Executor transfer decoding + tests ([e3ac394](e3ac394d27))
* Refactor callback for pancakeV3 and Ekubo to use transient storage ([deb10b8](deb10b82de))
* Refactor callback to use transient storage ([af44956](af449562b0))
* Refactor TychoEncoder ([8b4b79b](8b4b79b353))
* Rename split swap interfaces ([7fc008a](7fc008a718))
* sequential swap solution validation ([0d8150e](0d8150e22f))
* Single swap methods. ([6434566](64345663d0))
* SingleSwapStrategyEncoder ([11a05e4](11a05e4f18))
* SingleSwapStrategyEncoder ([5d586c2](5d586c25e3))
* SingleSwapStrategyEncoder ([a5f07a2](a5f07a25ef))
* Support in between swaps optimizations ([efe12cf](efe12cfcd6))
* Support out transfer straight to the receiver ([9bcb58e](9bcb58e5aa))
* Support returning values from the callback ([fb35a53](fb35a5305a))
* Support using the TransferType in uniswap v4 ([4a61de5](4a61de56b7))
* **tycho-router-encoder:** Select strategy depending on the solution ([f5e712e](f5e712e0ff))
* Update tycho-encode bin with new arguments ([aba280a](aba280acd0))
* Use TokenTransfer optimization helper in Ekubo ([d9066d0](d9066d0a09))

### Bug Fixes

* Add slither ignore for loop call ([860bba4](860bba4b7a))
* After merge format fixes ([2b48293](2b48293b3d))
* After merge test fixes ([02cbb67](02cbb67b38))
* After rebase fixes ([8145f41](8145f416b7))
* bad merge ([7e98145](7e98145ad7))
* Bring back receiver address zero check ([d447551](d447551e20))
* Calldata size for Ekubo pay callback ([be65c89](be65c890bb))
* Changes after rebase ([d5d6e37](d5d6e37041))
* Configurable fee on USV2 executor. ([4f9785f](4f9785fdac))
* Conscious slither silencing ([4a20fa6](4a20fa6215))
* consider wrapping scenario when getting transfer type ([dbc9042](dbc9042a2f))
* Fix after merge with main ([fff8ef0](fff8ef0d87))
* Fix executor address in test and remove duplicated test ([2f81b16](2f81b167d4))
* Fix integration tests with transfer in method support ([d3ff9fd](d3ff9fd0e2))
* fix slither CI action ([8f23463](8f2346330a))
* Fixes after merge with feature branch ([26ec308](26ec30852d))
* Integration tests after merge ([3f6bc56](3f6bc5643e))
* No more EVMStrategyEncoder ([56d3eee](56d3eee618))
* Post rebase fixes ([d024fe2](d024fe240b))
* Prevent multiple callbacks ([f91b101](f91b101a94))
* properly add ekubo_v2 to constants ([11886b3](11886b3ac1))
* Remove router_address from Solution object ([fcedd39](fcedd39f30))
* Rename constants and update docstrings for clarity ([244b7d3](244b7d3482))
* test fix after rebase ([61c0163](61c0163bee))
* Test+formatting fixes after rebase. ([e96ea1b](e96ea1b10b))
* Tighten max feeBps in USV2 executor ([af68016](af68016223))
* TransferType renaming after rebase ([cf0300d](cf0300dd72))
* unsupported protocols for chained swaps are always unsupported ([8aa5b08](8aa5b08b41))
* USV3 encoding/decoding after rebase ([f3c4128](f3c4128eda))

### Reverts

* Revert "chore(release): 1.0.0 [skip ci]" ([07be6b9](07be6b932c))
* Revert "chore(release): 1.0.1 [skip ci]" ([a5e0d16](a5e0d16c8c))
* Revert "chore(release): 1.0.2 [skip ci]" ([2bfd780](2bfd7806f8))
* Revert "chore(release): 1.1.0 [skip ci]" ([e15ed9b](e15ed9b16e))
2025-04-23 14:18:57 +00:00
dianacarvalho1
b8b86f39b8 Merge pull request #177 from propeller-heads/precious-backup-branch-2
feat: Gas optimizations feature
2025-04-23 15:16:48 +01:00
Diana Carvalho
2b48293b3d fix: After merge format fixes
Took 5 minutes
2025-04-23 12:57:14 +01:00
Diana Carvalho
07be6b932c Revert "chore(release): 1.0.0 [skip ci]"
This reverts commit 24eddf47769f8ac37f3f7fb19a781726731e3884.


Took 7 seconds
2025-04-23 12:31:54 +01:00
Diana Carvalho
a5e0d16c8c Revert "chore(release): 1.0.1 [skip ci]"
This reverts commit 17d5f38b947aa4a00e4d4657825a2538638e416c.


Took 3 seconds
2025-04-23 12:31:54 +01:00
Diana Carvalho
2bfd7806f8 Revert "chore(release): 1.0.2 [skip ci]"
This reverts commit a5fc8b49d6f3cc676470a76fe3eb1e84ba8f6b7a.


Took 25 seconds
2025-04-23 12:31:54 +01:00
Diana Carvalho
e15ed9b16e Revert "chore(release): 1.1.0 [skip ci]"
This reverts commit 6ec1d1de5ad8922bd80d56b3d76c377f02343ee2.


Took 14 minutes
2025-04-23 12:31:54 +01:00
semantic-release-bot
8e75099d82 chore(release): 1.1.0 [skip ci]
## [1.1.0](https://github.com/propeller-heads/tycho-execution/compare/1.0.2...1.1.0) (2025-04-23)

### Features

* Update tycho-encode bin with new arguments ([7646a57](7646a5705c))
2025-04-23 12:31:54 +01:00
dianacarvalho1
d27e628902 Merge pull request #175 from propeller-heads/encoding/dc/bin-update
feat: Update tycho-encode bin with new arguments
2025-04-23 12:31:53 +01:00
semantic-release-bot
b63aad9d2e chore(release): 1.0.2 [skip ci]
## [1.0.2](https://github.com/propeller-heads/tycho-execution/compare/1.0.1...1.0.2) (2025-04-23)

### Bug Fixes

* After merge test fixes ([4ac108e](4ac108e7d1))
2025-04-23 12:31:53 +01:00
dianacarvalho1
d409ae764a Merge branch 'main' into encoding/dc/bin-update 2025-04-23 12:31:53 +01:00
dianacarvalho1
3604cc4667 Merge pull request #173 from propeller-heads/router/tnl/more-protocol-integration
test: 5-hop Multi protocol integration test
2025-04-23 12:31:53 +01:00
dianacarvalho1
eae7dfafc5 Merge branch 'main' into encoding/dc/bin-update 2025-04-23 12:31:53 +01:00
semantic-release-bot
48565f3460 chore(release): 1.0.1 [skip ci]
## [1.0.1](https://github.com/propeller-heads/tycho-execution/compare/1.0.0...1.0.1) (2025-04-23)

### Bug Fixes

* Changes after rebase ([d39a2ac](d39a2accce))
* Configurable fee on USV2 executor. ([826aa54](826aa54631))
* Tighten max feeBps in USV2 executor ([e07573b](e07573bbb8))
2025-04-23 12:31:53 +01:00
Diana Carvalho
02cbb67b38 fix: After merge test fixes
Took 11 minutes
2025-04-23 12:31:53 +01:00
Diana Carvalho
aba280acd0 feat: Update tycho-encode bin with new arguments
--- don't change below this line ---
ENG-4446 Took 51 minutes


Took 9 seconds
2025-04-23 12:31:53 +01:00
dianacarvalho1
f41fa004c9 Merge pull request #168 from propeller-heads/router/tnl/ENG-4440-configure-usv2-fork-fee
fix: Configurable fee on USV2 executor.
2025-04-23 12:31:53 +01:00
dianacarvalho1
fc249d5977 Merge branch 'main' into router/tnl/more-protocol-integration 2025-04-23 12:31:53 +01:00
semantic-release-bot
104e1ecd43 chore(release): 1.0.0 [skip ci]
## [1.0.0](https://github.com/propeller-heads/tycho-execution/compare/0.81.0...1.0.0) (2025-04-22)

### Features

* (WIP) Support selection of transfer into router ([528bd74](528bd746f7))
* Add sequential swap methods ([2e3ffa2](2e3ffa2c70))
* Add SequentialSwap integration test with regular approvals ([8836598](8836598e53))
* Add SingleSwap integration test and fix bug in method signatures ([9c4dfef](9c4dfef80d))
* Add TokenTransfer class to BalancerV2 ([8e7dd0b](8e7dd0b9e7))
* Add TokenTransfer class to Curve ([0e0dff7](0e0dff7f5a))
* Add transfer out for Curve ([005c5a6](005c5a6207))
* Add transfer out for Uniswap V4 ([534e4f0](534e4f00db))
* Allow for token_in_already_in_router ([655c0b2](655c0b2635))
* allow to pass msg.sender to USV3 callback ([bf4b229](bf4b229268))
* allow to pass msg.sender to USV3 callback ([e71a0bb](e71a0bb354))
* Decode single and sequential swaps in LibSwap ([9be4845](9be48456e5))
* Delete EVMStrategyEncoder (this is now unnecessary) ([1fabef7](1fabef7a97))
* Do not use V4Router for uniswap v4 ([09b5a73](09b5a732ef))
* ExecutorTransferMethods helper contract ([abd9db9](abd9db937d))
* ExecutorTransferMethods in UniswapV3Executor ([dbbd30e](dbbd30e596))
* ExecutorTransferMethods in UniswapV3Executor ([e5426f3](e5426f3038))
* Fix rollFork usage for Ekubo test ([d7b5e6d](d7b5e6dba5))
* Make USV3 callback work with direct executor call ([51a7910](51a7910844))
* No more fee taking ([89f9121](89f9121e4c))
* Optimize transfer to first pool ([bf63696](bf63696142))
* Proper USV2Executor transfer decoding + tests ([b7ff870](b7ff870a7c))
* Proper USV2Executor transfer decoding + tests ([9dce2c7](9dce2c7465))
* Proper USV3Executor transfer decoding + tests ([1e37320](1e37320087))
* Refactor callback for pancakeV3 and Ekubo to use transient storage ([deb10b8](deb10b82de))
* Refactor callback to use transient storage ([af44956](af449562b0))
* Refactor TychoEncoder ([1996fd3](1996fd39e8))
* sequential swap solution validation ([efa5096](efa5096661))
* Single swap methods. ([72ccadc](72ccadcaae))
* SingleSwapStrategyEncoder ([5efeb8b](5efeb8b305))
* SingleSwapStrategyEncoder ([03f6961](03f6961b13))
* SingleSwapStrategyEncoder ([dbf5d1d](dbf5d1ddda))
* Support in between swaps optimizations ([83d3721](83d3721bf1))
* Support out transfer straight to the receiver ([d28c254](d28c254225))
* Support returning values from the callback ([fb35a53](fb35a5305a))
* Support using the TransferType in uniswap v4 ([2ecbabe](2ecbabeafc))
* **tycho-router-encoder:** Select strategy depending on the solution ([7f14f1a](7f14f1a4ff))
* Use TokenTransfer optimization helper in Ekubo ([d4e8642](d4e864272d))

### Bug Fixes

* Add slither ignore for loop call ([15f4ed5](15f4ed5d36))
* After rebase fixes ([ae30218](ae30218842))
* bad merge ([03ef744](03ef744373))
* Bring back receiver address zero check ([8e60b6b](8e60b6beba))
* Calldata size for Ekubo pay callback ([fb855d0](fb855d00a4))
* Conscious slither silencing ([a645fc7](a645fc72ab))
* consider wrapping scenario when getting transfer type ([028e860](028e8605a1))
* Fix after merge with main ([3de5a19](3de5a192b6))
* Fix executor address in test and remove duplicated test ([9456dc7](9456dc7b0b))
* Fix integration tests with transfer in method support ([0f3a910](0f3a9101b9))
* fix slither CI action ([7431b26](7431b266e1))
* Fixes after merge with feature branch ([26e6c6c](26e6c6c266))
* Integration tests after merge ([55242fb](55242fb8c4))
* No more EVMStrategyEncoder ([fbbc4c5](fbbc4c5277))
* Post rebase fixes ([01483c4](01483c4407))
* Prevent multiple callbacks ([f91b101](f91b101a94))
* properly add ekubo_v2 to constants ([24dd814](24dd814098))
* Remove --ignore-compile flag for slither ([353667e](353667e565))
* Remove router_address from Solution object ([9eb18f4](9eb18f4474))
* Rename constants and update docstrings for clarity ([11dffdc](11dffdcb28))
* test fix after rebase ([e05ffed](e05ffedd5d))
* Test+formatting fixes after rebase. ([6cf0f52](6cf0f523c1))
* TransferType renaming after rebase ([12c410b](12c410bb03))
* unsupported protocols for chained swaps are always unsupported ([9ce6fc0](9ce6fc0153))
* USV3 encoding/decoding after rebase ([2d0a3ac](2d0a3ac3fd))
2025-04-23 12:31:53 +01:00
TAMARA LIPOWSKI
d5d6e37041 fix: Changes after rebase 2025-04-23 12:31:53 +01:00
TAMARA LIPOWSKI
132eed4bb9 test: 5-hop Multi-protocol integration test
- Needed to add ekubo and uniswap v4 to callback-limited protocols.
- I had to bump the fork block in all of our integration tests: The way it was before meant that certain integration tests were using certain executor addresses, and others were using different ones, because of the redeployment. This was a pain to account for on the rust side. Instead, all tests now use an Ekubo-compatible fork block. Values needed to be updated because of price changes between blocks.
2025-04-23 12:31:53 +01:00
dianacarvalho1
54f04ac785 Merge pull request #119 from propeller-heads/feature/gas-optimization
breaking: Gas optimization feature
2025-04-23 12:31:53 +01:00
TAMARA LIPOWSKI
af68016223 fix: Tighten max feeBps in USV2 executor
Value was too lenient. We are assuming no forks will have higher fees than the original USV2.
2025-04-23 12:31:53 +01:00
TAMARA LIPOWSKI
4f9785fdac fix: Configurable fee on USV2 executor.
- This fee is not the same depending on the fork. For example, Pancake V2 uses a 0.25% fee, while the USV2 fee is 0.3%. We were wrongly hard-coding this fee to 0.3%.
2025-04-23 12:31:53 +01:00
Diana Carvalho
7614e36f18 Merge branch 'refs/heads/main' into feature/gas-optimization
# Conflicts:
#	foundry/src/Dispatcher.sol
#	foundry/test/executors/CurveExecutor.t.sol

Took 4 minutes

Took 12 seconds
2025-04-23 12:31:51 +01:00
dianacarvalho1
ca349a8e11 Merge pull request #166 from propeller-heads/router/dc/ENG-4437-uniswapv4-refactor
feat: Do not use V4Router for uniswap v4
2025-04-23 12:31:42 +01:00
dianacarvalho1
4a3a8ac6a6 Merge pull request #172 from propeller-heads/router/tnl/ENG-4443-usv3-executor-swap
feat: Make USV3 callback work with direct executor call
2025-04-23 12:31:42 +01:00
Diana Carvalho
d024fe240b fix: Post rebase fixes
--- don't change below this line ---
ENG-4437 Took 2 minutes
2025-04-23 12:31:42 +01:00
dianacarvalho1
342d2cfa1a Merge pull request #174 from propeller-heads/encoding/dc/ENG-4446-tokens-already-in-router
feat: Allow for token_in_already_in_router
2025-04-23 12:31:42 +01:00
TAMARA LIPOWSKI
5562dd210e feat: Make USV3 callback work with direct executor call
- We have decided to now support calling our executors normally (without using delegatecalls) since they now support specifying token transfers.
- This was disabled for UniswapV3 in the past also because of data decoding issues. This seems to be the solution, though.
2025-04-23 12:31:42 +01:00
Diana Carvalho
eb2c17d0ba docs: Add comment to delegatecall in UniV4 executor
--- don't change below this line ---
ENG-4437 Took 8 minutes
2025-04-23 12:31:42 +01:00
Diana Carvalho
dff4a345fc chore: Move get_receiver logic inside TransferOptimization
Added tests for all cases

--- don't change below this line ---
ENG-4446 Took 1 hour 8 minutes
2025-04-23 12:31:42 +01:00