Commit Graph

208 Commits

Author SHA1 Message Date
TAMARA LIPOWSKI
e83b8d9aef feat: Take Chain object containing native/wrapped addresses
- This way this chain object contains everything we need, we don't need to worry about doing any transformation or calling any supplementary functions inside any of the encoders
- Needed to move our new Chain object to a higher level since this is used in the higher-level encoder traits. This required some weird default values in the constants in order to avoid using alloy's hex literal. I could have instead opted to make Bytes parse a string I think, though this would mean possibly returning an error at the constants level, which is not nice either.

Question:
- Do we want the user to be in charge of passing the native and wrapped token every single time? This may be a bit annoying for the user. For now, I have defaulted to those in constants.rs, this would take 5 mins to remove though if you don't like it, and it would get rid of this complicated bytes initialization.
2025-02-05 17:14:56 -05:00
royvardhan
fd4045e6fe feat: remove manual parsing 2025-02-05 22:57:38 +05:30
semantic-release-bot
cb01f95af9 chore(release): 0.31.0 [skip ci]
## [0.31.0](https://github.com/propeller-heads/tycho-execution/compare/0.30.1...0.31.0) (2025-02-05)

### Features

* add tests for split swap validations ([b69aef9](b69aef9b8f))
* add tests for wrap unwrap case ([4d97c3f](4d97c3f16d))
* add validation for split swap ([f80ffa9](f80ffa924f))

### Bug Fixes

* checks in validations ([95edd5b](95edd5b1fe))
* get_mock_split_swap_strategy_encoder ([7b72263](7b7226356d))
* use native action to validate path ([c787f5e](c787f5e722))
2025-02-05 15:03:14 +00:00
royvardhan
6cec83fde5 fix: ci 2025-02-05 17:36:27 +05:30
royvardhan
4f7fe3b96d feat: add encoder bin 2025-02-05 16:53:20 +05:30
semantic-release-bot
25a26f21be chore(release): 0.30.1 [skip ci]
## [0.30.1](https://github.com/propeller-heads/tycho-execution/compare/0.30.0...0.30.1) (2025-02-04)

### Bug Fixes

* deprecated signature ([576f89d](576f89d24c))
2025-02-04 18:17:33 +00:00
royvardhan
576f89d24c fix: deprecated signature 2025-02-04 23:30:23 +05:30
semantic-release-bot
6557ede64b chore(release): 0.30.0 [skip ci]
## [0.30.0](https://github.com/propeller-heads/tycho-execution/compare/0.29.1...0.30.0) (2025-02-04)

### Features

* Refactor Registries ([23875b8](23875b8b02))
2025-02-04 17:36:31 +00:00
semantic-release-bot
a92ba96d86 chore(release): 0.29.1 [skip ci]
## [0.29.1](https://github.com/propeller-heads/tycho-execution/compare/0.29.0...0.29.1) (2025-02-04)

### Bug Fixes

* Fix bug with token indexing when wrapping/unwrapping ([3f4e27a](3f4e27a348))
* test fixes after merge ([ff283bc](ff283bc333))
2025-02-04 16:54:33 +00:00
semantic-release-bot
e21a8de6c9 chore(release): 0.29.0 [skip ci]
## [0.29.0](https://github.com/propeller-heads/tycho-execution/compare/0.28.0...0.29.0) (2025-02-04)

### Features

* add swap encoder test in balancer v2 executor ([6333072](6333072178))

### Bug Fixes

* executor test naming ([e6310d6](e6310d65d1))
2025-02-04 15:46:38 +00:00
semantic-release-bot
00171ea72e chore(release): 0.28.0 [skip ci]
## [0.28.0](https://github.com/propeller-heads/tycho-execution/compare/0.27.0...0.28.0) (2025-02-04)

### Features

* Tycho encoder validation ([4bc6159](4bc615913e))

### Bug Fixes

* test_validate_fails_for_unwrap_wrong_last_swap ([0660321](06603210bc))
2025-02-04 15:37:28 +00:00
semantic-release-bot
580a86bc0f chore(release): 0.27.0 [skip ci]
## [0.27.0](https://github.com/propeller-heads/tycho-execution/compare/0.26.0...0.27.0) (2025-02-04)

### Features

* Add complex swap to quickstart example ([80454f0](80454f012d))
* Add simple quickstart example ([84d162d](84d162d418))

### Bug Fixes

* bring back one #[allow(dead_code)] ([ae315b4](ae315b452a))
* Calculate min_amount_out correctly and extend test to prove this ([de1c782](de1c782bc1))
2025-02-04 09:27:05 +00:00
semantic-release-bot
c4eb7b03b2 chore(release): 0.26.0 [skip ci]
## [0.26.0](https://github.com/propeller-heads/tycho-execution/compare/0.25.3...0.26.0) (2025-02-03)

### Features

* Verify that no amount in is left in the router ([0860d67](0860d67d7a))
2025-02-03 17:43:04 +00:00
semantic-release-bot
9d32291c97 chore(release): 0.25.3 [skip ci]
## [0.25.3](https://github.com/propeller-heads/tycho-execution/compare/0.25.2...0.25.3) (2025-01-31)

### Bug Fixes

* transfer ETH if tokenOut is ETH ([3245ea7](3245ea7295))
2025-01-31 17:23:04 +00:00
semantic-release-bot
db31cde6b1 chore(release): 0.25.2 [skip ci]
## [0.25.2](https://github.com/propeller-heads/tycho-execution/compare/0.25.1...0.25.2) (2025-01-31)

### Bug Fixes

* Accidentally changed wrong test's calldata ([faacd3f](faacd3f25c))
* Expect decimal during encoding, add assert to test ([5a81ed6](5a81ed6be5))
2025-01-31 17:18:47 +00:00
semantic-release-bot
b0b24edbd6 chore(release): 0.25.1 [skip ci]
## [0.25.1](https://github.com/propeller-heads/tycho-execution/compare/0.25.0...0.25.1) (2025-01-31)

### Bug Fixes

* Fix selector - shouldn't contain spaces ([5d6f0c1](5d6f0c1673))
* Fix token index order in strategy encoding. ([c85c353](c85c353e34))
2025-01-31 15:40:53 +00:00
semantic-release-bot
d153c69b8f chore(release): 0.25.0 [skip ci]
## [0.25.0](https://github.com/propeller-heads/tycho-execution/compare/0.24.0...0.25.0) (2025-01-31)

### Features

* Add ChainId model ([089e7d2](089e7d2e0f))
* Implement SplitSwapStrategyEncoder ([feb91cc](feb91cc639))
* Remove generalisation on user approvals manager ([3a69bbf](3a69bbf603))
* Simplify router encoder ([6e8d2ed](6e8d2ede59))

### Bug Fixes

* Don't leak evm specific code to interfaces(PrivateKeySigner, Chain) ([7a8872c](7a8872cc41))
* Post merge's fixes ([a28b548](a28b54888e))
* replace all unwraps with proper error handling ([5f3d440](5f3d4406bd))
* Use abi_encode_packed in ple_encode() ([82e671d](82e671df39))
* Use max instead of min to get the min_amount_out ([575c5be](575c5bea5e))
2025-01-31 09:25:10 +00:00
semantic-release-bot
7fee0fd5e2 chore(release): 0.24.0 [skip ci]
## [0.24.0](https://github.com/propeller-heads/tycho-execution/compare/0.23.0...0.24.0) (2025-01-30)

### Features

* rename batchSetExecutor to setExecutors ([c653062](c653062027))
* replace setExecutor with batchSetExecutor ([ea504fa](ea504faca1))

### Bug Fixes

* rm redundant test ([24e95b1](24e95b1206))
2025-01-30 15:57:45 +00:00
semantic-release-bot
14849b2e29 chore(release): 0.23.0 [skip ci]
## [0.23.0](https://github.com/propeller-heads/tycho-execution/compare/0.22.0...0.23.0) (2025-01-30)

### Features

* add executor encoder test ([ad70a0d](ad70a0d5a8))
* add swap test with hex for univ2 executor ([0196767](0196767eff))
* add univ2 executor test with hex ([c482e21](c482e21a5f))
* remove exact_out from USV2 ([8cb95f0](8cb95f0950))
* resolve pr comments ([1b8bf56](1b8bf56c75))
* update ExecutorEncoder interface and relevant types ([5c39651](5c396512cf))
2025-01-30 15:52:02 +00:00
semantic-release-bot
ee0aafbc4d chore(release): 0.22.0 [skip ci]
## [0.22.0](https://github.com/propeller-heads/tycho-execution/compare/0.21.0...0.22.0) (2025-01-30)

### Features

* fixed USV3 Verification ([96af542](96af542923))
* Implement generic callback ([fafeba9](fafeba9248))
* UniswapV3Executor and integration tests ([ca32446](ca32446a9e))
* USV3 verification ([7822c4f](7822c4f913))

### Bug Fixes

* Remove amountReceived and dataOffset from the callback verification ([63b94b5](63b94b5584))
* Remove amountReceived, dataOffset from ICallbackVerifier interface ([33ada0c](33ada0cf26))
* Remove exactOut from USV3 encoding ([d8b44f6](d8b44f623b))
2025-01-30 15:40:49 +00:00
semantic-release-bot
44ca2d5176 chore(release): 0.21.0 [skip ci]
## [0.21.0](https://github.com/propeller-heads/tycho-execution/compare/0.20.0...0.21.0) (2025-01-28)

### Features

* add balancer v2 executor ([a700189](a700189aaf))
* add node.js workflow ([25756ff](25756fffdd))
* add tests for Balancer V2 executor ([a4e405f](a4e405fb75))
* approve max ([cb6d165](cb6d165e7f))
* update remappings and remove node modules ([b65b682](b65b682e8d))

### Bug Fixes

* balancer v2 encoder bug ([a6a624b](a6a624b740))
* build ([5dc5e23](5dc5e23239))
* ci ([b1ca478](b1ca478294))
* clippy ([877f625](877f625efc))
* exclude node modules from slither ([4b3c5c5](4b3c5c5005))
* filter paths slither ([6c30cf8](6c30cf8f66))
* rm exactOut ([44db2e5](44db2e52b3))
* slither ([b854282](b85428212a))
* slither ([7a83edd](7a83eddc92))
2025-01-28 18:42:03 +00:00
semantic-release-bot
f9ded54a0e chore(release): 0.20.0 [skip ci]
## [0.20.0](https://github.com/propeller-heads/tycho-execution/compare/0.19.0...0.20.0) (2025-01-28)

### Features

* Add executor and selector to Swap ([c2347ac](c2347ac79e))
* Add swap method (first attempt) ([a8f6fc1](a8f6fc1eec))
* Add swap method with tests ([50429ad](50429ad05c))
* Assume that funds will never go straight from a pool to the receiver ([655cf91](655cf91984))
* Smother slither and add a reentrancy guard in swap() ([dfa7033](dfa7033d2e))
* Wrap and unwrap ETH ([3b2d9fc](3b2d9fcbdf))

### Bug Fixes

* fix submodules ([0a1f522](0a1f522207))
* Remove checkMinAmount ([d8de65a](d8de65aedf))
2025-01-28 17:14:21 +00:00
semantic-release-bot
7d35b8bb36 chore(release): 0.19.0 [skip ci]
## [0.19.0](https://github.com/propeller-heads/tycho-execution/compare/0.18.0...0.19.0) (2025-01-28)

### Features

* UniswapV3SwapEncoder ([9c63e09](9c63e099a9)), closes [/github.com/propeller-heads/tycho-protocol-sdk/blob/3c08359cf112e15c137dd5256b8dc8e9cd6c1626/substreams/ethereum-uniswap-v3/src/modules/1_map_pool_created.rs#L64](3c08359cf1/substreams/ethereum-uniswap-v3/src/modules/1_map_pool_created.rs/issues/L64)
2025-01-28 15:06:00 +00:00
semantic-release-bot
cfa80d77b9 chore(release): 0.18.0 [skip ci]
## [0.18.0](https://github.com/propeller-heads/tycho-execution/compare/0.17.0...0.18.0) (2025-01-27)

### Features

* Perform staticcall to CallbackVerifier ([ad0748e](ad0748e9c3))
2025-01-27 15:24:42 +00: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
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
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
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
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
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
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
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
semantic-release-bot
f409535cfd chore(release): 0.10.0 [skip ci]
## [0.10.0](https://github.com/propeller-heads/tycho-execution/compare/0.9.0...0.10.0) (2025-01-23)

### Features

* add fee methods ([0dc7edc](0dc7edccfa))

### Bug Fixes

* use FEE_SETTER_ROLE for setFeeReceiver ([15d3bec](15d3becf60))
2025-01-23 09:41:25 +00:00
semantic-release-bot
bd9e9241d3 chore(release): 0.9.0 [skip ci]
## [0.9.0](https://github.com/propeller-heads/tycho-execution/compare/0.8.0...0.9.0) (2025-01-22)

### Features

* Emit events when setting executors/verifiers ([59950a7](59950a7575))
* Set swap executors and verifiers ([4cb3286](4cb3286c94))
2025-01-22 19:25:48 +00:00
semantic-release-bot
68d29f1970 chore(release): 0.8.0 [skip ci]
## [0.8.0](https://github.com/propeller-heads/tycho-execution/compare/0.7.0...0.8.0) (2025-01-22)

### Features

* add receiver in event ([2c3af0f](2c3af0ff31))
* add withdraw methods ([78fa890](78fa890cd3))

### Bug Fixes

* ci ([0c05874](0c05874477))
* disable slither for native withdraw ([f3363a2](f3363a24f4))
* undo rm lib ([a1e7b55](a1e7b552b6))
* use send for native transfer ([c6c0ddd](c6c0ddd498))
2025-01-22 17:12:21 +00:00
semantic-release-bot
60f4274304 chore(release): 0.7.0 [skip ci]
## [0.7.0](https://github.com/propeller-heads/tycho-execution/compare/0.6.0...0.7.0) (2025-01-22)

### Features

* UniswapV2 Swap Encoder ([7b4bf02](7b4bf0205d))
2025-01-22 14:59:41 +00:00
semantic-release-bot
7890f26812 chore(release): 0.6.0 [skip ci]
## [0.6.0](https://github.com/propeller-heads/tycho-execution/compare/0.5.0...0.6.0) (2025-01-21)

### Features

* Add openzeppelin lib for access control ([a8f62ee](a8f62ee837))
* Add permit2 lib for approval management ([cb9053b](cb9053bd88))
* initial TychoRouter skeleton ([ab28a47](ab28a4730d)), closes [lib/openzeppelin-contracts/contracts/access/AccessControl.sol#4](https://github.com/lib/openzeppelin-contracts/contracts/access/AccessControl.sol/issues/4) [lib/openzeppelin-contracts/contracts/access/IAccessControl.sol#4](https://github.com/lib/openzeppelin-contracts/contracts/access/IAccessControl.sol/issues/4) [lib/openzeppelin-contracts/contracts/utils/Context.sol#4](https://github.com/lib/openzeppelin-contracts/contracts/utils/Context.sol/issues/4) [lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol#4](https://github.com/lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol/issues/4) [lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol#4](https://github.com/lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol/issues/4) [lib/permit2/src/interfaces/IAllowanceTransfer.sol#2](https://github.com/lib/permit2/src/interfaces/IAllowanceTransfer.sol/issues/2) [lib/permit2/src/interfaces/IEIP712.sol#2](https://github.com/lib/permit2/src/interfaces/IEIP712.sol/issues/2)

### Bug Fixes

* Filter paths when running slither in CI ([96809d4](96809d4801))
2025-01-21 14:35:47 +00:00
semantic-release-bot
649b1b0bcb chore(release): 0.5.0 [skip ci]
## [0.5.0](https://github.com/propeller-heads/tycho-execution/compare/0.4.0...0.5.0) (2025-01-20)

### Features

* Implement ProtocolApprovalsManager ([cbf2b4d](cbf2b4de5a))
2025-01-20 17:25:09 +00:00
Diana Carvalho
cbf2b4de5a feat: Implement ProtocolApprovalsManager
I decided to make ProtocolApprovalsManager public method sync not to propagate asynceness early on onto the rest of the code. If later we decide that it is better to have this async, it should be easier to make that change than the opposite one.

--- don't change below this line ---
ENG-4064 Took 24 minutes
2025-01-20 16:05:06 +00:00
semantic-release-bot
8a709b3033 chore(release): 0.4.0 [skip ci]
## [0.4.0](https://github.com/propeller-heads/tycho-execution/compare/0.3.0...0.4.0) (2025-01-20)

### Features

* Add Slither to CI ([f0620bd](f0620bd180))
* Add Slither to README.md and include contract file to test ([2998bb3](2998bb3fb1))

### Bug Fixes

* Bump to latest Solidity version (0.8.28) ([f987125](f987125489)), closes [src/Counter.sol#2](https://github.com/src/Counter.sol/issues/2)
* Specify foundry subdir when running slither in CI ([40f0a2a](40f0a2a2b7))
2025-01-20 14:21:36 +00:00
semantic-release-bot
a16b2affed chore(release): 0.3.0 [skip ci]
## [0.3.0](https://github.com/propeller-heads/tycho-execution/compare/0.2.0...0.3.0) (2025-01-17)

### Features

* Add EncodingError ([bab5caa](bab5caa6f8))

### Bug Fixes

* Add RecoverableError ([af6d73a](af6d73a540))
2025-01-17 17:14:08 +00:00
Diana Carvalho
bab5caa6f8 feat: Add EncodingError
Change method signatures to expect it and raise it where it makes sense

--- don't change below this line ---
ENG-4076 <#DTT#>
2025-01-17 17:00:52 +00:00
semantic-release-bot
e77a50b2bb chore(release): 0.2.0 [skip ci]
## [0.2.0](https://github.com/propeller-heads/tycho-execution/compare/0.1.0...0.2.0) (2025-01-17)

### Features

* Simplify StrategyEncoders and RouterEncoder ([38b8bb0](38b8bb0e78))
2025-01-17 16:57:49 +00:00
semantic-release-bot
b07cb9bc76 chore(release): 0.1.0 [skip ci]
## [0.1.0](https://github.com/propeller-heads/tycho-execution/compare/0.0.1...0.1.0) (2025-01-17)

### Features

* Add chain in config.json for the executor addresses ([f5df1bb](f5df1bbd87))
* Add evm feature gate ([6c6ba21](6c6ba21894))

### Bug Fixes

* Make executor_address a String instead of Address ([1d3ac22](1d3ac22087))
2025-01-17 15:22:16 +00:00
Diana Carvalho
6c6ba21894 feat: Add evm feature gate
- Move all evm code inside evm directory
- StrategyEncoder:
  - Kept StrategyEncoder trait but created a new one: EVMStrategyEncoder to implement encode_protocol_header (that is evm specific).
  - All StrategyEncoders implement both traits now
  - Renamed DefaultStrategySelector -> EVMStrategySelector
- RouterEncoder:
  - Created a RouterEncoder trait and a EVMRouterEncoder that implements it
- Moved utils inside evm directory as well
- Renamed config.json -> executor_addresses.json and moved it to a higher config directory
- Make alloy optional and dependent on the evm feature gate

--- don't change below this line ---
ENG-4075 <#DTT#>
2025-01-17 12:52:39 +00:00
semantic-release-bot
2fb8c8f8c3 chore(release): 0.0.1 [skip ci]
## [0.0.1](https://github.com/propeller-heads/tycho-execution/compare/0.0.0...0.0.1) (2025-01-17)

### Bug Fixes

* change release version ([d584e0a](d584e0a1e5))
2025-01-17 12:44:18 +00:00
Valentin Khramtsov
d584e0a1e5 fix: change release version 2025-01-17 15:39:53 +03:00
semantic-release-bot
3996f1fe2c 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-01-17)

### Bug Fixes

* change release version ([2b35aa4](2b35aa4577))
* change release version ([46db261](46db261198))
2025-01-17 12:31:07 +00:00