From 308ba1d35c10a053253cc05a7109b9c28fd516bd Mon Sep 17 00:00:00 2001 From: 0xOsiris Date: Wed, 20 Sep 2023 13:16:57 -0500 Subject: [PATCH] base swap callbacks --- foundry.toml | 1 + src/ConveyorRouterV1.sol | 2 -- src/callbacks/ConveyorSwapCallbacks.sol | 14 ++------------ src/callbacks/UniswapV3Callback.sol | 2 +- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/foundry.toml b/foundry.toml index f6ca9596..d9ebc5d5 100644 --- a/foundry.toml +++ b/foundry.toml @@ -7,3 +7,4 @@ optimizer = true optimizer_runs = 200 + diff --git a/src/ConveyorRouterV1.sol b/src/ConveyorRouterV1.sol index 3b1dfdba..e05fe587 100644 --- a/src/ConveyorRouterV1.sol +++ b/src/ConveyorRouterV1.sol @@ -7,7 +7,6 @@ import {SafeERC20} from "../lib/libraries/token/SafeERC20.sol"; import {ConveyorMath} from "./lib/ConveyorMath.sol"; import {ConveyorSwapCallbacks} from "./callbacks/ConveyorSwapCallbacks.sol"; import {IConveyorRouterV1} from "./interfaces/IConveyorRouterV1.sol"; -import "../test/utils/Console.sol"; interface IConveyorMulticall { function executeMulticall(ConveyorRouterV1.SwapAggregatorMulticall calldata multicall) external; @@ -129,7 +128,6 @@ contract ConveyorRouterV1 is IConveyorRouterV1 { IConveyorMulticall(CONVEYOR_MULTICALL).executeMulticall(genericMulticall); uint256 balanceAfter = IERC20(swapData.tokenOut).balanceOf(msg.sender); - console.log("balanceAfter", balanceAfter); ///@notice Check if tokenOut balance of msg.sender is sufficient. if (balanceAfter < tokenOutAmountRequired) { revert InsufficientOutputAmount(tokenOutAmountRequired - balanceAfter, swapData.amountOutMin); diff --git a/src/callbacks/ConveyorSwapCallbacks.sol b/src/callbacks/ConveyorSwapCallbacks.sol index a66697d7..225c70af 100644 --- a/src/callbacks/ConveyorSwapCallbacks.sol +++ b/src/callbacks/ConveyorSwapCallbacks.sol @@ -5,24 +5,14 @@ import {PancakeV2Callback} from "./PancakeV2Callback.sol"; import {PancakeV3Callback} from "./PancakeV3Callback.sol"; import {UniswapV2Callback} from "./UniswapV2Callback.sol"; import {UniswapV3Callback} from "./UniswapV3Callback.sol"; -import {ConvergenceXCallback} from "./ConvergenceXCallback.sol"; -import {UniFiCallback} from "./UniFiCallback.sol"; -import {VerseCallback} from "./VerseCallback.sol"; import {ApeSwapCallback} from "./ApeSwapCallback.sol"; -import {LinkSwapCallback} from "./LinkSwapCallback.sol"; -import {SakeSwapCallback} from "./SakeSwapCallback.sol"; -import {DefiSwapCallback} from "./DefiSwapCallback.sol"; +import {AlgebraCallback} from "./AlgebraCallback.sol"; contract ConveyorSwapCallbacks is PancakeV2Callback, PancakeV3Callback, UniswapV2Callback, UniswapV3Callback, - ConvergenceXCallback, - UniFiCallback, - VerseCallback, ApeSwapCallback, - LinkSwapCallback, - SakeSwapCallback, - DefiSwapCallback + AlgebraCallback {} diff --git a/src/callbacks/UniswapV3Callback.sol b/src/callbacks/UniswapV3Callback.sol index 451ca6e0..e921fb38 100644 --- a/src/callbacks/UniswapV3Callback.sol +++ b/src/callbacks/UniswapV3Callback.sol @@ -10,7 +10,7 @@ contract UniswapV3Callback { ///@param data - The data packed into the swap. function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes calldata data) external { assembly { - let tokenIn :=calldataload(data.offset) + let tokenIn := calldataload(data.offset) // Start at fmp let freeMemoryPointer := mload(0x40) let token := calldataload(data.offset)