Omniscia Altura Trade Audit

NavOracle Code Style Findings

NavOracle Code Style Findings

NOE-01C: Ineffectual Usage of Safe Arithmetics

TypeSeverityLocation
Language SpecificNavOracle.sol:
I-1: L93
I-2: L98

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/NavOracle.sol
98uint256 diff = prev > pps1e18 ? prev - pps1e18 : pps1e18 - prev;

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:

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