Omniscia Optimex Audit

MorphoLiquidator Code Style Findings

MorphoLiquidator Code Style Findings

MLR-01C: Generic Typographic Mistake

Description:

The referenced line contains a typographical mistake (i.e. private variable without an underscore prefix, a non-snake_case module) or generic documentational error (i.e. copy-paste) that should be corrected.

Example:

contracts/MorphoLiquidator.sol
311/// Since `remainCollateral` may still be non-zero,

Recommendation:

We advise this to be done so to enhance the legibility of the codebase.

Alleviation (a1d9c0732dc53d7985d91eae79ca6868f3e7107a):

The Optimex team corrected the documentation to properly depict that the remainCollateral will be zero at that point, addressing this exhibit.

MLR-02C: Ineffectual Usage of Safe Arithmetics

Description:

The linked mathematical operation is guaranteed to be performed safely by logical inference, such as surrounding conditionals evaluated in require checks or if-else constructs.

Example:

contracts/MorphoLiquidator.sol
563result.surplus = amount - result.repaidDebt;

Recommendation:

Given that safe arithmetics are toggled on by default in pragma versions of 0.8.X, we advise the linked statement to be wrapped in an unchecked code block thereby optimizing its execution cost.

Alleviation (c11bae0aacaeb7f4e4b53c864f96917ca574182f):

The Optimex team evaluated this exhibit but opted to acknowledge it in the current iteration of the codebase.