From b616e11354ee325dcbecff70caf4e7daf4d144d0 Mon Sep 17 00:00:00 2001 From: TAMARA LIPOWSKI Date: Thu, 23 Jan 2025 15:07:56 -0500 Subject: [PATCH] fix: Silence slither warnings - low level calls are fine, since we are checking for success, and we have already checked for contract existence when setting swap executors - dead-code is silenced - fix solidity version --- foundry/interfaces/ISwapExecutor.sol | 2 +- foundry/src/SwapExecutionDispatcher.sol | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/foundry/interfaces/ISwapExecutor.sol b/foundry/interfaces/ISwapExecutor.sol index e79a868..db71f1a 100644 --- a/foundry/interfaces/ISwapExecutor.sol +++ b/foundry/interfaces/ISwapExecutor.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.7.5; +pragma solidity ^0.8.28; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; diff --git a/foundry/src/SwapExecutionDispatcher.sol b/foundry/src/SwapExecutionDispatcher.sol index b688bac..20e7e28 100644 --- a/foundry/src/SwapExecutionDispatcher.sol +++ b/foundry/src/SwapExecutionDispatcher.sol @@ -24,6 +24,7 @@ contract SwapExecutionDispatcher { * @dev Calls an executor, assumes swap.protocolData contains * token addresses if required by the executor. */ + // slither-disable-next-line dead-code function _callSwapExecutor(uint256 amount, bytes calldata data) internal returns (uint256 calculatedAmount) @@ -43,6 +44,7 @@ contract SwapExecutionDispatcher { revert SwapExecutionDispatcher__UnapprovedExecutor(); } + // slither-disable-next-line low-level-calls (bool success, bytes memory result) = executor.delegatecall( abi.encodeWithSelector(selector, amount, protocolData) ); @@ -60,6 +62,7 @@ contract SwapExecutionDispatcher { calculatedAmount = abi.decode(result, (uint256)); } + // slither-disable-next-line dead-code function _decodeExecutorAndSelector(bytes calldata data) internal pure