From 5bc48954866314cb43953a589d8b78743758174a Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Thu, 14 Nov 2024 11:56:22 +0300 Subject: [PATCH] deploy custom callback to cronos --- config/dexs.json | 13 +++++++++---- deployments/_deployments_log_file.json | 10 ++++++++++ deployments/cronos.diamond.json | 4 ++-- deployments/cronos.json | 2 +- src/Periphery/LiFiDEXAggregator.sol | 17 ++++++++++++++++- 5 files changed, 38 insertions(+), 8 deletions(-) diff --git a/config/dexs.json b/config/dexs.json index 7546f25ea..7fee040c2 100644 --- a/config/dexs.json +++ b/config/dexs.json @@ -298,7 +298,8 @@ "0x6140b987d6B51Fd75b66C3B07733Beb5167c42fc", "0x70D6cFE9146D6B6ebEb88BcB22fa220E78058D6F", "0x11d40Dc8Ff0CE92F54A315aD8e674a55a866cBEe", - "0xf2614A233c7C3e7f08b1F887Ba133a13f1eb2c55" + "0xf2614A233c7C3e7f08b1F887Ba133a13f1eb2c55", + "0xf88F6948C8AFf60c0B011f3175CDF459c66Ed035" ], "evmos": [ "0xdFC2983401614118E1F2D5A5FD93C17Fecf8BdC6", @@ -618,7 +619,9 @@ "0xf2614A233c7C3e7f08b1F887Ba133a13f1eb2c55", "0xbbbbbBB520d69a9775E85b458C58c648259FAD5F" ], - "opbnb": ["0x6140b987d6B51Fd75b66C3B07733Beb5167c42fc"], + "opbnb": [ + "0x6140b987d6B51Fd75b66C3B07733Beb5167c42fc" + ], "polygon": [ "0x5215E9fd223BC909083fbdB2860213873046e45d", "0xdFC2983401614118E1F2D5A5FD93C17Fecf8BdC6", @@ -774,7 +777,9 @@ "0xf91bb752490473b8342a3e964e855b9f9a2a668e" ], "avalancheFujiTestnet": [], - "bscTestnet": ["0x1b02da8cb0d097eb8d57a175b88c7d8b47997506"], + "bscTestnet": [ + "0x1b02da8cb0d097eb8d57a175b88c7d8b47997506" + ], "localanvil": [], "mumbai": [ "0x5215E9fd223BC909083fbdB2860213873046e45d", @@ -783,4 +788,4 @@ "0xf471d32cb40837bf24529fcf17418fc1a4807626", "0x427bFc2E0aa683ec43fbF7861d5F4A74147938d8" ] -} +} \ No newline at end of file diff --git a/deployments/_deployments_log_file.json b/deployments/_deployments_log_file.json index 1e9b459c3..ae44d2fbb 100644 --- a/deployments/_deployments_log_file.json +++ b/deployments/_deployments_log_file.json @@ -23480,6 +23480,16 @@ "SALT": "", "VERIFIED": "true" } + ], + "1.4.0": [ + { + "ADDRESS": "0xf88F6948C8AFf60c0B011f3175CDF459c66Ed035", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-11-14 11:54:19", + "CONSTRUCTOR_ARGS": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000d38743b48d26743c0ec6898d699394fbc94657ee", + "SALT": "", + "VERIFIED": "true" + } ] } } diff --git a/deployments/cronos.diamond.json b/deployments/cronos.diamond.json index ebc2b9096..2043fb655 100644 --- a/deployments/cronos.diamond.json +++ b/deployments/cronos.diamond.json @@ -62,8 +62,8 @@ "ERC20Proxy": "0x9B112948F3c71eBFb59961657b37c21328cFb01e", "Executor": "0xd00DaEC49Cd4F33Fe8542050294759cD971c7116", "FeeCollector": "0x11d40Dc8Ff0CE92F54A315aD8e674a55a866cBEe", - "LiFiDEXAggregator": "0x6140b987d6B51Fd75b66C3B07733Beb5167c42fc", - "LiFuelFeeCollector": "0x6140b987d6B51Fd75b66C3B07733Beb5167c42fc", + "LiFiDEXAggregator": "", + "LiFuelFeeCollector": "0x70D6cFE9146D6B6ebEb88BcB22fa220E78058D6F", "ReceiverAcrossV3": "", "Receiver": "0x4891e076b18FccEBE62962A26e74df85BB04168b", "ReceiverStargateV2": "", diff --git a/deployments/cronos.json b/deployments/cronos.json index 2f542bf21..b98dde7ec 100644 --- a/deployments/cronos.json +++ b/deployments/cronos.json @@ -24,5 +24,5 @@ "SymbiosisFacet": "0x70a51Bbc58D6180709D99a759bd91A3feD212fD3", "EmergencyPauseFacet": "0x3CDDc79Da7c829643F5b2378110158Ea6ff349F9", "TokenWrapper": "0x693c18A628866BdD04956d9544Ce769C0e468149", - "LiFiDEXAggregator": "0x6140b987d6B51Fd75b66C3B07733Beb5167c42fc" + "LiFiDEXAggregator": "0xf88F6948C8AFf60c0B011f3175CDF459c66Ed035" } \ No newline at end of file diff --git a/src/Periphery/LiFiDEXAggregator.sol b/src/Periphery/LiFiDEXAggregator.sol index 3b1225aef..1f213cc11 100644 --- a/src/Periphery/LiFiDEXAggregator.sol +++ b/src/Periphery/LiFiDEXAggregator.sol @@ -22,7 +22,7 @@ uint160 constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970 /// @title LiFi DEX Aggregator /// @author Ilya Lyalin (contract copied from: https://github.com/sushiswap/sushiswap/blob/c8c80dec821003eb72eb77c7e0446ddde8ca9e1e/protocols/route-processor/contracts/RouteProcessor4.sol) /// @notice Processes calldata to swap using various DEXs -/// @custom:version 1.3.0 +/// @custom:version 1.4.0 contract LiFiDEXAggregator is Ownable { using SafeERC20 for IERC20; using Approve for IERC20; @@ -650,6 +650,21 @@ contract LiFiDEXAggregator is Ownable { uniswapV3SwapCallback(amount0Delta, amount1Delta, data); } + /// @notice Called to `msg.sender` after executing a swap via VVS FinanceV3#swap. + /// @dev In the implementation you must pay the pool tokens owed for the swap. + /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by + /// the end of the swap. If positive, the callback must send that amount of token0 to the pool. + /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by + /// the end of the swap. If positive, the callback must send that amount of token1 to the pool. + /// @param data Any data passed through by the caller via the VVS Finance V3#swap call + function vvsV3SwapCallback( + int256 amount0Delta, + int256 amount1Delta, + bytes calldata data + ) external { + uniswapV3SwapCallback(amount0Delta, amount1Delta, data); + } + /// @notice Curve pool swap. Legacy pools that don't return amountOut and have native coins are not supported /// @param stream [pool, poolType, fromIndex, toIndex, recipient, output token] /// @param from Where to take liquidity for swap