Commit Graph

222 Commits

Author SHA1 Message Date
Diana Carvalho
38b8bb0e78 feat: Simplify StrategyEncoders and RouterEncoder
No more SingleSwapStrategyEncoder or SequentialStrategyEncoder
No more batch routing (so no need for batch permits as well). If multiple solutions are found, return multiple Transactions

--- don't change below this line ---
ENG-4076 <#DTT#>
2025-01-17 16:21:26 +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
Diana Carvalho
1d3ac22087 fix: Make executor_address a String instead of Address
--- don't change below this line ---
ENG-4075 <#DTT#>
2025-01-17 12:52:39 +00:00
Diana Carvalho
f5df1bbd87 feat: Add chain in config.json for the executor addresses
--- don't change below this line ---
ENG-4075 <#DTT#>
2025-01-17 12:52:39 +00:00
TAMARA LIPOWSKI
20fb01280c chore: add dummy test to make CI happy
Right now it complains and fails because no tests: `error: no tests to run`
2025-01-16 16:41:07 -05:00
TAMARA LIPOWSKI
f8e8a72c53 chore: fix clippy warnings and nightly fmt 2025-01-16 16:35:02 -05:00
Diana Carvalho
e93bf11a85 fix: Constrain new in SwapEncoder so it does not apply to trait objects 2025-01-16 17:18:11 +00:00
Diana Carvalho
30f2ac9f6b fix: Add new to SwapEncoder trait
Add executor_address in SwapEncoderBuilder::new and not in the builder pattern
2025-01-16 17:18:11 +00:00
Diana Carvalho
6d8cbcd80c feat: Add builder pattern and registry for SwapEncoders
Save swap executor addresses in a config file
2025-01-16 17:18:11 +00:00
Diana Carvalho
6f8bbd89a5 feat: Make check amount optional 2025-01-16 17:18:11 +00:00
Diana Carvalho
5a661ab6ca feat: Add Transaction as output of encoding 2025-01-16 17:18:11 +00:00
Diana Carvalho
f9f83b439f fix: Add expected_amount to Solution 2025-01-16 17:18:11 +00:00
Diana Carvalho
a25c56e667 fix: Simplify models. Delete Solution and rename Order->Solution 2025-01-16 17:18:11 +00:00
Diana Carvalho
68c5a914eb feat: Remove batch execute logic from StrategyEncoder
Add action_type and selector to StrategyEncoder
Rename SequentialExactInStrategyEncoder -> SequentialStrategyEncoder
2025-01-16 17:18:11 +00:00
Diana Carvalho
93410b4fe2 fix: TokenApprovalsManager should not implement ApprovalsManager
They should be separate.
ApprovalsManager is only for user approvals
2025-01-16 17:18:11 +00:00
Diana Carvalho
3e609c75ae feat: Support encoding only the pool swap
Create StraightToPoolStrategyEncoder
2025-01-16 17:18:11 +00:00
Diana Carvalho
4991883fc8 feat: ApprovalsManager trait
Make Permit2 and TokenApprovalsManager implement it.
This way in the RouternEncoder we can use either one (I'm not exactly sure what this would mean in the contract though)

I'm not sure I like this generalisation. The TokenApprovalsManager was made with a different purpose: to approve token allowances for the pools (like balancer and curve) for our router
2025-01-16 17:18:09 +00:00
Diana Carvalho
6e67875821 feat: Add StrategySelector
This way the user could be able to extend this easily
2025-01-16 17:17:52 +00:00
Diana Carvalho
647f697ea2 chore: Refactor models:
- Delete min_checked_amount and use check_amount instead
- Use Bytes and not Address in interfaces
- Move router_address from Solution to Order
2025-01-16 17:17:52 +00:00
Diana Carvalho
5d79da44f3 feat: Add permit2 draft 2025-01-16 17:17:52 +00:00
Diana Carvalho
fa462ee9f3 feat: Handle native actions 2025-01-16 17:17:52 +00:00
Diana Carvalho
36fe8f4b76 feat: Initial draft of encoding module 2025-01-16 17:17:50 +00:00