Omniscia Steer Protocol Audit

LiquidityManagerVault Static Analysis Findings

LiquidityManagerVault Static Analysis Findings

LMV-01S: Redundant Variable Assignments

TypeSeverityLocation
Gas OptimizationLiquidityManagerVault.sol:
I-1: L677
I-2: L678

Description:

The linked variables are assigned to redundantly to the default value of each relevant data type (i.e. uint256 assigned to 0, address assigned to address(0) etc.).

Example:

src/LiquidityManagerVault.sol
677vars.principal0 = 0;

Recommendation:

We advise the assignments to be safely omitted optimizing the codebase.

Alleviation (121dc0b132):

The redundant zero-value assignments have been removed, however, empty declaration statements remain that are no-ops.

We advise the entire statements to be omitted, further optimizing the code's syntax.

Alleviation (2bab393ad0):

The empty statements that remained have been properly removed as well, addressing this exhibit in full.

LMV-02S: Deprecated Native Asset Transfers

TypeSeverityLocation
Language SpecificLiquidityManagerVault.sol:
I-1: L459
I-2: L479

Description:

The linked statements perform low-level native asset transfers via the transfer function exposed by the address payable data type.

Impact:

As new EIPs such as EIP-2930 are introduced to the blockchain, gas costs can change and the transfer instruction of Solidity specifies a fixed gas stipend that is prone to failure should such changes be integrated to the blockchain the contract is deployed in. A prime example of this behaviour are legacy versions of Gnosis were susceptible to this issue and would cause native transfers to fail if sent to a new address.

Example:

src/LiquidityManagerVault.sol
459if (refund > 0) payable(msg.sender).transfer(refund);

Recommendation:

We advise alternative ways of transferring assets to be utilized instead, such as OpenZeppelin's Address.sol library and in particular the sendValue method exposed by it. If re-entrancies are desired to be prevented based on gas costs, we instead advise a mechanism to be put in place that either credits an account with a native balance they can withdraw at a secondary transaction or that performs the native asset transfers at the end of the top-level transaction's execution.

Alleviation (121dc0b1329a48555f90bb92e58a95e8ff8a7c79):

The code has been revised to alleviate other issues identified within the report, no longer utilizing a fixed-gas native fund transfer and thus addressing this exhibit indirectly.