Omniscia Morpho Labs Audit
UniswapV2Swapper Static Analysis Findings
UniswapV2Swapper Static Analysis Findings
UVS-01S: Inexistent Sanitization of Input Addresses
Type | Severity | Location |
---|---|---|
Input Sanitization | UniswapV2Swapper.sol:L26-L29 |
Description:
The linked function(s) accept address
arguments yet do not properly sanitize them.
Impact:
The presence of zero-value addresses, especially in constructor
implementations, can cause the contract to be permanently inoperable. These checks are advised as zero-value inputs are a common side-effect of off-chain software related bugs.
Example:
src/UniswapV2Swapper.sol
26constructor(address _swapRouter, address _wrappedNativeToken) {27 swapRouter = IUniswapV2Router02(_swapRouter);28 wrappedNativeToken = _wrappedNativeToken;29}
Recommendation:
We advise some basic sanitization to be put in place by ensuring that each address
specified is non-zero.
Alleviation:
Zero-address checks have been properly introduced for the relevant input arguments as advised.