Skip to content

Commit

Permalink
deploy custom callback to cronos
Browse files Browse the repository at this point in the history
  • Loading branch information
ezynda3 committed Nov 14, 2024
1 parent d69f1f2 commit 5bc4895
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 8 deletions.
13 changes: 9 additions & 4 deletions config/dexs.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@
"0x6140b987d6B51Fd75b66C3B07733Beb5167c42fc",
"0x70D6cFE9146D6B6ebEb88BcB22fa220E78058D6F",
"0x11d40Dc8Ff0CE92F54A315aD8e674a55a866cBEe",
"0xf2614A233c7C3e7f08b1F887Ba133a13f1eb2c55"
"0xf2614A233c7C3e7f08b1F887Ba133a13f1eb2c55",
"0xf88F6948C8AFf60c0B011f3175CDF459c66Ed035"
],
"evmos": [
"0xdFC2983401614118E1F2D5A5FD93C17Fecf8BdC6",
Expand Down Expand Up @@ -618,7 +619,9 @@
"0xf2614A233c7C3e7f08b1F887Ba133a13f1eb2c55",
"0xbbbbbBB520d69a9775E85b458C58c648259FAD5F"
],
"opbnb": ["0x6140b987d6B51Fd75b66C3B07733Beb5167c42fc"],
"opbnb": [
"0x6140b987d6B51Fd75b66C3B07733Beb5167c42fc"
],
"polygon": [
"0x5215E9fd223BC909083fbdB2860213873046e45d",
"0xdFC2983401614118E1F2D5A5FD93C17Fecf8BdC6",
Expand Down Expand Up @@ -774,7 +777,9 @@
"0xf91bb752490473b8342a3e964e855b9f9a2a668e"
],
"avalancheFujiTestnet": [],
"bscTestnet": ["0x1b02da8cb0d097eb8d57a175b88c7d8b47997506"],
"bscTestnet": [
"0x1b02da8cb0d097eb8d57a175b88c7d8b47997506"
],
"localanvil": [],
"mumbai": [
"0x5215E9fd223BC909083fbdB2860213873046e45d",
Expand All @@ -783,4 +788,4 @@
"0xf471d32cb40837bf24529fcf17418fc1a4807626",
"0x427bFc2E0aa683ec43fbF7861d5F4A74147938d8"
]
}
}
10 changes: 10 additions & 0 deletions deployments/_deployments_log_file.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
}
Expand Down
4 changes: 2 additions & 2 deletions deployments/cronos.diamond.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
"ERC20Proxy": "0x9B112948F3c71eBFb59961657b37c21328cFb01e",
"Executor": "0xd00DaEC49Cd4F33Fe8542050294759cD971c7116",
"FeeCollector": "0x11d40Dc8Ff0CE92F54A315aD8e674a55a866cBEe",
"LiFiDEXAggregator": "0x6140b987d6B51Fd75b66C3B07733Beb5167c42fc",
"LiFuelFeeCollector": "0x6140b987d6B51Fd75b66C3B07733Beb5167c42fc",
"LiFiDEXAggregator": "",
"LiFuelFeeCollector": "0x70D6cFE9146D6B6ebEb88BcB22fa220E78058D6F",
"ReceiverAcrossV3": "",
"Receiver": "0x4891e076b18FccEBE62962A26e74df85BB04168b",
"ReceiverStargateV2": "",
Expand Down
2 changes: 1 addition & 1 deletion deployments/cronos.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
"SymbiosisFacet": "0x70a51Bbc58D6180709D99a759bd91A3feD212fD3",
"EmergencyPauseFacet": "0x3CDDc79Da7c829643F5b2378110158Ea6ff349F9",
"TokenWrapper": "0x693c18A628866BdD04956d9544Ce769C0e468149",
"LiFiDEXAggregator": "0x6140b987d6B51Fd75b66C3B07733Beb5167c42fc"
"LiFiDEXAggregator": "0xf88F6948C8AFf60c0B011f3175CDF459c66Ed035"
}
17 changes: 16 additions & 1 deletion src/Periphery/LiFiDEXAggregator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5bc4895

Please sign in to comment.