diff --git a/foundry.toml b/foundry.toml index f6ca959..d9ebc5d 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 3b1dfdb..e05fe58 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 a66697d..225c70a 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 e3f165a..e921fb3 100644 --- a/src/callbacks/UniswapV3Callback.sol +++ b/src/callbacks/UniswapV3Callback.sol @@ -10,6 +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) // Start at fmp let freeMemoryPointer := mload(0x40) let token := calldataload(data.offset) diff --git a/src/deploy/DeployBaseAggregator.s.sol b/src/deploy/DeployBaseAggregator.s.sol new file mode 100644 index 0000000..59b6623 --- /dev/null +++ b/src/deploy/DeployBaseAggregator.s.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: MIT +pragma solidity =0.8.21; + +import {Script} from "../../lib/forge-std/src/Script.sol"; +import {ConveyorRouterV1} from "../ConveyorRouterV1.sol"; +import {ICREATE3Factory} from "../../lib/create3-factory/src/ICREATE3Factory.sol"; + +contract Deploy is Script { + ///@dev Base Constructor Constants + address constant WETH = 0x4200000000000000000000000000000000000006; + + function run() public returns (address conveyorRouterV1) { + bytes32 salt = bytes32("0x8fbb158"); + bytes memory creationCode = abi.encodePacked(type(ConveyorRouterV1).creationCode, abi.encode(WETH)); + + vm.startBroadcast(); + conveyorRouterV1 = ICREATE3Factory(0x93FEC2C00BfE902F733B57c5a6CeeD7CD1384AE1).deploy(salt, creationCode); + vm.stopBroadcast(); + } +}