From b3241804c6b5c72dd968fbcc4521912452fd1f7c Mon Sep 17 00:00:00 2001 From: Diana Carvalho Date: Fri, 24 Jan 2025 16:46:56 +0000 Subject: [PATCH] chore: Rename Uniswapv2SwapExecutor to UniswapV2Executor --- don't change below this line --- ENG-4033 Took 4 minutes --- ...wapv2SwapExecutor.sol => UniswapV2Executor.sol} | 4 ++-- .../{ISwapExecutor.sol => IExecutor.sol} | 4 ++-- ...2SwapExecutor.t.sol => UniswapV2Executor.t.sol} | 14 +++++--------- 3 files changed, 9 insertions(+), 13 deletions(-) rename foundry/src/executors/{Uniswapv2SwapExecutor.sol => UniswapV2Executor.sol} (95%) rename foundry/src/interfaces/{ISwapExecutor.sol => IExecutor.sol} (96%) rename foundry/test/executors/{UniswapV2SwapExecutor.t.sol => UniswapV2Executor.t.sol} (89%) diff --git a/foundry/src/executors/Uniswapv2SwapExecutor.sol b/foundry/src/executors/UniswapV2Executor.sol similarity index 95% rename from foundry/src/executors/Uniswapv2SwapExecutor.sol rename to foundry/src/executors/UniswapV2Executor.sol index c54e726..ebcde96 100644 --- a/foundry/src/executors/Uniswapv2SwapExecutor.sol +++ b/foundry/src/executors/UniswapV2Executor.sol @@ -3,11 +3,11 @@ pragma solidity ^0.8.28; import "@uniswap-v2/contracts/interfaces/IUniswapV2Pair.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; -import {ISwapExecutor} from "../interfaces/ISwapExecutor.sol"; +import {IExecutor} from "../interfaces/IExecutor.sol"; error UniswapV2Executor__InvalidDataLength(); -contract UniswapV2SwapExecutor is ISwapExecutor { +contract UniswapV2Executor is IExecutor { using SafeERC20 for IERC20; function swap(uint256 givenAmount, bytes calldata data) diff --git a/foundry/src/interfaces/ISwapExecutor.sol b/foundry/src/interfaces/IExecutor.sol similarity index 96% rename from foundry/src/interfaces/ISwapExecutor.sol rename to foundry/src/interfaces/IExecutor.sol index d8bf82c..560fd54 100644 --- a/foundry/src/interfaces/ISwapExecutor.sol +++ b/foundry/src/interfaces/IExecutor.sol @@ -5,7 +5,7 @@ import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; pragma abicoder v2; -interface ISwapExecutor { +interface IExecutor { /** * @notice Performs a swap on a liquidity pool. * @dev This method can either take the amount of the input token or the amount @@ -31,7 +31,7 @@ interface ISwapExecutor { returns (uint256 calculatedAmount); } -interface ISwapExecutorErrors { +interface IExecutorErrors { error InvalidParameterLength(uint256); error UnknownCurveType(uint8); } diff --git a/foundry/test/executors/UniswapV2SwapExecutor.t.sol b/foundry/test/executors/UniswapV2Executor.t.sol similarity index 89% rename from foundry/test/executors/UniswapV2SwapExecutor.t.sol rename to foundry/test/executors/UniswapV2Executor.t.sol index c2011f1..1598a6a 100644 --- a/foundry/test/executors/UniswapV2SwapExecutor.t.sol +++ b/foundry/test/executors/UniswapV2Executor.t.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.28; -import "@src/executors/Uniswapv2SwapExecutor.sol"; +import "@src/executors/UniswapV2Executor.sol"; import {Test} from "../../lib/forge-std/src/Test.sol"; import {Constants} from "../Constants.sol"; -contract UniswapV2SwapExecutorExposed is UniswapV2SwapExecutor { +contract UniswapV2ExecutorExposed is UniswapV2Executor { function decodeParams(bytes calldata data) external pure @@ -28,14 +28,10 @@ contract UniswapV2SwapExecutorExposed is UniswapV2SwapExecutor { } } -contract UniswapV2SwapExecutorTest is - UniswapV2SwapExecutorExposed, - Test, - Constants -{ +contract UniswapV2ExecutorTest is UniswapV2ExecutorExposed, Test, Constants { using SafeERC20 for IERC20; - UniswapV2SwapExecutorExposed uniswapV2Exposed; + UniswapV2ExecutorExposed uniswapV2Exposed; IERC20 WETH = IERC20(WETH_ADDR); IERC20 DAI = IERC20(DAI_ADDR); address WETH_DAI_POOL = 0xA478c2975Ab1Ea89e8196811F51A7B7Ade33eB11; @@ -43,7 +39,7 @@ contract UniswapV2SwapExecutorTest is function setUp() public { uint256 forkBlock = 17323404; vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock); - uniswapV2Exposed = new UniswapV2SwapExecutorExposed(); + uniswapV2Exposed = new UniswapV2ExecutorExposed(); } function testDecodeParams() public view {