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

@@ -2,12 +2,12 @@
pragma solidity ^0.8.26;
import {IFlashAccountant} from "./IFlashAccountant.sol";
import {PoolKey} from "../types/poolKey.sol";
import {EkuboPoolKey} from "../types/poolKey.sol";
import {SqrtRatio} from "../types/sqrtRatio.sol";
interface ICore is IFlashAccountant {
function swap_611415377(
PoolKey memory poolKey,
EkuboPoolKey memory poolKey,
int128 amount,
bool isToken1,
SqrtRatio sqrtRatioLimit,

View File

@@ -5,7 +5,7 @@ pragma solidity ^0.8.26;
type Config is bytes32;
// Each pool has its own state associated with this key
struct PoolKey {
struct EkuboPoolKey {
address token0;
address token1;
Config config;