feat: Support Ekubo callback in TychoRouter

- add integration test
- cannot directly call _handleCallback from the locked method of the tycho router because of bytes memory to bytes callback conversion
- Rename to EkuboPoolKey because of conflict with USV4 pool key

- Bonus: fix bug where input token to swap method must be ERC20 (we should also support ETH)
This commit is contained in:
TAMARA LIPOWSKI
2025-03-27 23:38:32 +01:00
parent 393f1f9472
commit b3078f9c7b
9 changed files with 120 additions and 10 deletions

View File

@@ -1,7 +1,8 @@
use crate::encoding::{
errors::EncodingError,
evm::swap_encoder::swap_encoders::{
BalancerV2SwapEncoder, UniswapV2SwapEncoder, UniswapV3SwapEncoder, UniswapV4SwapEncoder,
BalancerV2SwapEncoder, EkuboSwapEncoder, UniswapV2SwapEncoder, UniswapV3SwapEncoder,
UniswapV4SwapEncoder,
},
swap_encoder::SwapEncoder,
};
@@ -29,6 +30,7 @@ impl SwapEncoderBuilder {
"uniswap_v3" => Ok(Box::new(UniswapV3SwapEncoder::new(self.executor_address))),
"pancakeswap_v3" => Ok(Box::new(UniswapV3SwapEncoder::new(self.executor_address))),
"uniswap_v4" => Ok(Box::new(UniswapV4SwapEncoder::new(self.executor_address))),
"ekubo" => Ok(Box::new(EkuboSwapEncoder::new(self.executor_address))),
_ => Err(EncodingError::FatalError(format!(
"Unknown protocol system: {}",
self.protocol_system