Omniscia Myso Finance Audit
UniV3Looping Code Style Findings
UniV3Looping Code Style Findings
UVL-01C: Multiple Top-Level Declarations
Type | Severity | Location |
---|---|---|
Code Style | UniV3Looping.sol:L10, L66 |
Description:
The referenced file contains multiple top-level declarations that decrease the legibility of the codebase.
Example:
contracts/peer-to-peer/callbacks/UniV3Looping.sol
10interface ISwapRouter {11 struct ExactInputSingleParams {12 address tokenIn;13 address tokenOut;14 uint24 fee;15 address recipient;16 uint256 deadline;17 uint256 amountIn;18 uint256 amountOutMinimum;19 uint160 sqrtPriceLimitX96;20 }21
22 struct ExactInputParams {23 bytes path;24 address recipient;25 uint256 deadline;26 uint256 amountIn;27 uint256 amountOutMinimum;28 }29
30 struct ExactOutputSingleParams {31 address tokenIn;32 address tokenOut;33 uint24 fee;34 address recipient;35 uint256 deadline;36 uint256 amountOut;37 uint256 amountInMaximum;38 uint160 sqrtPriceLimitX96;39 }40
41 struct ExactOutputParams {42 bytes path;43 address recipient;44 uint256 deadline;45 uint256 amountOut;46 uint256 amountInMaximum;47 }48
49 function exactInputSingle(50 ExactInputSingleParams calldata params51 ) external payable returns (uint256 amountOut);52
53 function exactInput(54 ExactInputParams calldata params55 ) external payable returns (uint256 amountOut);56
57 function exactOutputSingle(58 ExactOutputSingleParams calldata params59 ) external payable returns (uint256 amountIn);60
61 function exactOutput(62 ExactOutputParams calldata params63 ) external payable returns (uint256 amountIn);64}65
66contract UniV3Looping is IVaultCallback {
Recommendation:
We advise all highlighted top-level declarations to be split into their respective code files, avoiding unnecessary imports as well as increasing the legibility of the codebase.
Alleviation (c740f7c6b5ebd365618fd2d7ea77370599e1ca11):
The referenced declaration that differs from the file's name has been relocated to its dedicated file and is imported by the UniV3Looping
contract as advised.