Omniscia Xcaliswap Audit
SwapFactory Static Analysis Findings
SwapFactory Static Analysis Findings
SFY-01S: Redundant Variable Assignment
Type | Severity | Location |
---|---|---|
Gas Optimization | ![]() | SwapFactory.sol:L27 |
Description:
The linked variable is assigned to redundantly to the default value of the relevant data type (i.e. uint256
assigned to 0
, address
assigned to address(0)
etc.).
Example:
27isPaused = false;
Recommendation:
We advise the assignment to be safely omitted optimizing the codebase.
Alleviation:
The Xcaliswap team has removed the redundant variable assignment statement.
SFY-02S: Inexistent Sanitization of Input Address
Type | Severity | Location |
---|---|---|
Input Sanitization | ![]() | SwapFactory.sol:L25-L31 |
Description:
The linked function accepts an address
argument yet does not properly sanitize it.
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:
25constructor(address _feeCollector) {26 pauser = msg.sender;27 isPaused = false;28 fee[true] = 369; // 0.0369% for stable swaps (hundredth of a basis point / 369/1000000)29 fee[false] = 2700; // 0.27% for vaiable swaps (hundredth of a basis point / 2700/1000000)30 feeCollector = _feeCollector;31}
Recommendation:
We advise some basic sanitization to be put in place by ensuring that the address
specified is non-zero.
Alleviation:
The Xcaliswap team has introduced a require
check ensuring that the address specified is non-zero.