Omniscia Native Audit
UniswapV2Pricer Code Style Findings
UniswapV2Pricer Code Style Findings
UVP-01C: Redundant Parenthesis Statements
Type | Severity | Location |
---|---|---|
Code Style | UniswapV2Pricer.sol:L15, L16, L26, L27, L28 |
Description:
The referenced statements are wrapped in parenthesis (()
) redundantly as they do not affect the order of operations.
Example:
contracts/UniswapV2Pricer.sol
8function getAmountOut(9 uint256 amountIn,10 uint256 reserveIn,11 uint256 reserveOut,12 uint256 fee13) public pure override returns (uint amountOut) {14 uint256 amountInWithFee = amountIn * (10000 - fee);15 uint256 numerator = amountInWithFee * (reserveOut);16 uint256 denominator = reserveIn * (10000) + (amountInWithFee);17 amountOut = numerator / denominator;18}
Recommendation:
We advise the parenthesis to be safely omitted, optimizing the legibility of the codebase.
Alleviation:
The redundant parenthesis have been removed from all referenced statements.