chore: cleanup
This commit is contained in:
@@ -2,8 +2,6 @@
|
|||||||
pragma solidity ^0.8.26;
|
pragma solidity ^0.8.26;
|
||||||
|
|
||||||
interface ICallback {
|
interface ICallback {
|
||||||
error UnauthorizedCaller(string exchange, address sender);
|
|
||||||
|
|
||||||
function handleCallback(
|
function handleCallback(
|
||||||
bytes calldata data
|
bytes calldata data
|
||||||
) external returns (bytes memory result);
|
) external returns (bytes memory result);
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ pragma solidity ^0.8.26;
|
|||||||
|
|
||||||
import "@interfaces/IExecutor.sol";
|
import "@interfaces/IExecutor.sol";
|
||||||
import "@interfaces/ICallback.sol";
|
import "@interfaces/ICallback.sol";
|
||||||
import "forge-std/console.sol";
|
|
||||||
|
|
||||||
error Dispatcher__UnapprovedExecutor();
|
error Dispatcher__UnapprovedExecutor();
|
||||||
error Dispatcher__NonContractExecutor();
|
error Dispatcher__NonContractExecutor();
|
||||||
@@ -83,7 +82,7 @@ contract Dispatcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _handleCallback(bytes4 selector, bytes memory data) internal {
|
function _handleCallback(bytes4 selector, bytes memory data) internal {
|
||||||
// Access the last 20 bytes of the bytes memory data using assembly
|
// Using assembly to access the last 20 bytes of the bytes memory data
|
||||||
address executor;
|
address executor;
|
||||||
// slither-disable-next-line assembly
|
// slither-disable-next-line assembly
|
||||||
assembly {
|
assembly {
|
||||||
|
|||||||
@@ -227,10 +227,10 @@ contract TychoRouter is
|
|||||||
* This function will static call a verifier contract and should revert if the
|
* This function will static call a verifier contract and should revert if the
|
||||||
* caller is not a pool.
|
* caller is not a pool.
|
||||||
*/
|
*/
|
||||||
// fallback() external {
|
fallback() external {
|
||||||
// bytes4 selector = bytes4(msg.data[:4]);
|
bytes4 selector = bytes4(msg.data[:4]);
|
||||||
// _handleCallback(selector, msg.data[4:]);
|
_handleCallback(selector, msg.data[4:]);
|
||||||
// }
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev Pauses the contract
|
* @dev Pauses the contract
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|||||||
import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";
|
import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";
|
||||||
import "@uniswap/v3-updated/CallbackValidationV2.sol";
|
import "@uniswap/v3-updated/CallbackValidationV2.sol";
|
||||||
import "@interfaces/ICallback.sol";
|
import "@interfaces/ICallback.sol";
|
||||||
import "forge-std/console.sol";
|
|
||||||
|
|
||||||
error UniswapV3Executor__InvalidDataLength();
|
error UniswapV3Executor__InvalidDataLength();
|
||||||
error UniswapV3Executor__InvalidFactory();
|
error UniswapV3Executor__InvalidFactory();
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ contract Constants is Test {
|
|||||||
address USDC_WBTC_POOL = 0x004375Dff511095CC5A197A54140a24eFEF3A416;
|
address USDC_WBTC_POOL = 0x004375Dff511095CC5A197A54140a24eFEF3A416;
|
||||||
|
|
||||||
// uniswap v3
|
// uniswap v3
|
||||||
|
address USV3_FACTORY = 0x1F98431c8aD98523631AE4a59f267346ea31F984;
|
||||||
address DAI_WETH_USV3 = 0xC2e9F25Be6257c210d7Adf0D4Cd6E3E881ba25f8;
|
address DAI_WETH_USV3 = 0xC2e9F25Be6257c210d7Adf0D4Cd6E3E881ba25f8;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ contract TychoRouterTestSetup is Test, Constants {
|
|||||||
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
|
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
|
||||||
|
|
||||||
vm.startPrank(ADMIN);
|
vm.startPrank(ADMIN);
|
||||||
address factoryV3 = address(0x1F98431c8aD98523631AE4a59f267346ea31F984);
|
address factoryV3 = USV3_FACTORY;
|
||||||
address poolManagerAddress = 0x000000000004444c5dc75cB358380D2e3dE08A90;
|
address poolManagerAddress = 0x000000000004444c5dc75cB358380D2e3dE08A90;
|
||||||
IPoolManager poolManager = IPoolManager(poolManagerAddress);
|
IPoolManager poolManager = IPoolManager(poolManagerAddress);
|
||||||
tychoRouter =
|
tychoRouter =
|
||||||
|
|||||||
@@ -30,13 +30,12 @@ contract UniswapV3ExecutorTest is Test, Constants {
|
|||||||
UniswapV3ExecutorExposed uniswapV3Exposed;
|
UniswapV3ExecutorExposed uniswapV3Exposed;
|
||||||
IERC20 WETH = IERC20(WETH_ADDR);
|
IERC20 WETH = IERC20(WETH_ADDR);
|
||||||
IERC20 DAI = IERC20(DAI_ADDR);
|
IERC20 DAI = IERC20(DAI_ADDR);
|
||||||
address factory = 0x1F98431c8aD98523631AE4a59f267346ea31F984;
|
|
||||||
|
|
||||||
function setUp() public {
|
function setUp() public {
|
||||||
uint256 forkBlock = 17323404;
|
uint256 forkBlock = 17323404;
|
||||||
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
|
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
|
||||||
|
|
||||||
uniswapV3Exposed = new UniswapV3ExecutorExposed(factory);
|
uniswapV3Exposed = new UniswapV3ExecutorExposed(USV3_FACTORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
function testDecodeParams() public view {
|
function testDecodeParams() public view {
|
||||||
|
|||||||
Reference in New Issue
Block a user