Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Commit

Permalink
registry for kim v4 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vminkov committed Apr 1, 2024
1 parent afcd8a5 commit 47ab292
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions contracts/liquidators/registry/LiquidatorsRegistryExtension.sol
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,13 @@ contract LiquidatorsRegistryExtension is LiquidatorsRegistryStorage, DiamondExte
} else if (isStrategy(strategy, "UniswapV3LiquidatorFunder")) {
strategyData = uniswapV3LiquidatorFunderData(inputToken, outputToken);
} else if (isStrategy(strategy, "AlgebraSwapLiquidator")) {
strategyData = algebraSwapLiquidatorData(inputToken, outputToken);
} else if (isStrategy(strategy, "KimUniV4Liquidator")) {
strategyData = kimV4LiquidatorData(inputToken, outputToken);
address swapRouter;
if (block.chainid == 34443) {
swapRouter = 0xAc48FcF1049668B285f3dC72483DF5Ae2162f7e8;
} else {
swapRouter = ap.getAddress("ALGEBRA_SWAP_ROUTER");
}
strategyData = algebraSwapLiquidatorData(inputToken, outputToken, swapRouter);
} else if (isStrategy(strategy, "GammaAlgebraLpTokenLiquidator")) {
strategyData = gammaAlgebraLpTokenLiquidatorData(inputToken, outputToken);
} else if (isStrategy(strategy, "GammaUniswapV3LpTokenLiquidator")) {
Expand Down Expand Up @@ -459,21 +463,12 @@ contract LiquidatorsRegistryExtension is LiquidatorsRegistryStorage, DiamondExte
strategyData = abi.encode(getUniswapV2Router(inputToken), swapPath);
}

function algebraSwapLiquidatorData(IERC20Upgradeable inputToken, IERC20Upgradeable outputToken)
internal
view
returns (bytes memory strategyData)
{
strategyData = abi.encode(outputToken, ap.getAddress("ALGEBRA_SWAP_ROUTER"));
}

function kimV4LiquidatorData(IERC20Upgradeable inputToken, IERC20Upgradeable outputToken)
function algebraSwapLiquidatorData(IERC20Upgradeable inputToken, IERC20Upgradeable outputToken, address swapRouter)
internal
view
returns (bytes memory strategyData)
{
address kimV4SwapRouter = 0xAc48FcF1049668B285f3dC72483DF5Ae2162f7e8;
strategyData = abi.encode(outputToken, kimV4SwapRouter);
strategyData = abi.encode(outputToken, swapRouter);
}

function gammaAlgebraLpTokenLiquidatorData(IERC20Upgradeable inputToken, IERC20Upgradeable outputToken)
Expand Down

0 comments on commit 47ab292

Please sign in to comment.