Omniscia Moby Audit

Code Style

Code Style

During the manual portion of the audit, we identified 82 optimizations that can be applied to the codebase that will decrease the operational cost associated with the execution of a particular function and generally ensure that the project complies with the latest best practices and standards in Solidity.

Additionally, this section of the audit contains any opinionated adjustments we believe the code should make to make it more legible as well as truer to its purpose.

These optimizations are enumerated below:

IDSeverityAddressedTitle
BPM-01CDeprecated Revert Pattern
BTN-01CIneffectual Usage of Safe Arithmetics
BTN-02CInefficient mapping Lookups
BTN-03CLoop Iterator Optimizations
CTX-01CPotentially Redundant Contract Implementation
CUE-01CPotentially Redundant Contract Implementation
CRE-01CInefficient Iterator Type
CRE-02CLoop Iterator Optimizations
CRE-03CRedundant Conditional Evaluation
CRE-04CRepetitive Value Literal
ERC-01CInexistent Error Message
ERC-02CVariable Mutability Specifier (Immutable)
EST-01CPotentially Inefficient Shift Operation
FPF-01CInexistent Usage of Existing Calculation
FPF-02CLoop Iterator Optimizations
FPF-03CRedundant Validation of Literal
FDR-01CLoop Iterator Optimization
FDR-02CRepetitive Value Literal
MHT-01CSuboptimal Implementation of Math::mulDiv
OMR-01CDeprecated Revert Pattern
OMR-02CIneffectual Usage of Safe Arithmetics
OMR-03CLoop Iterator Optimizations
OMR-04CRedundant Code Repetition
OMR-05CRedundant Parenthesis Statements
OMT-01CInefficient mapping Lookups
OMT-02CLoop Iterator Optimizations
OMT-03CRedundant Parenthesis Statement
OTN-01CInefficient Iterator Type
OTN-02CLoop Iterator Optimization
PMR-01CImproper Operation Location
PMR-02CIneffectual Usage of Safe Arithmetics
PMR-03CRedundant Code Repetition
PMR-04CSuboptimal Struct Declaration Styles
PMR-05CTest Code
PVF-01CGeneric Typographic Mistake
PVF-02CLoop Iterator Optimizations
RRV-01CRedundant Code Repetitions
RTR-01CDeprecated Revert Pattern
RTR-02CIneffectual Usage of Safe Arithmetics
RTR-03CInefficient mapping Lookups
RTR-04CLoop Iterator Optimization
SER-01CRedundant Parenthesis Statement
SPD-01CLoop Iterator Optimization
SPD-02CPotentially Inefficient Storage Relation
SPF-01CIneffectual Usage of Safe Arithmetics
SPF-02CLoop Iterator Optimization
SPF-03CRedundant Parenthesis Statements
SPF-04CRedundant Reservation of Memory
TUP-01CInexistent Error Messages
USL-01CInefficient Extraction of Option Entry
USL-02CInefficient Iterator Types
USL-03CInefficient Loop Iteration
USL-04CInefficient Validation of Strike Prices
USL-05CLoop Iterator Optimizations
USL-06COptimization of Condition Evaluation
USL-07CRedundant Bitwise Clear Operations
USL-08CRedundant Reservation of Memory
USL-09CSimplification of Strategy Conditions
USL-10CSuboptimal Bit Flipping Mechanism
USL-11CSuboptimal Opposite Strategy Evaluation
USL-12CUnutilized Contract Level Constant
VTL-01CDeprecated Revert Pattern
VTL-02CIneffectual Usage of Safe Arithmetics
VTL-03CRepetitive Value Literal
VTL-04CUnused Contract Member
VPF-01CDeprecated Revert Pattern
VPF-02CIneffectual Usage of Safe Arithmetics
VPF-03CLoop Iterator Optimization
VPF-04CRedundant Parenthesis Statements
VUS-01CIneffectual Usage of Safe Arithmetics
VUS-02CInefficient Array Copy
VUS-03CInefficient Array Shifts
VUS-04CInefficient mapping Lookups
VUS-05CLoop Iterator Optimizations
VUS-06CRedundant Code Repetition
VUS-07CRedundant Parenthesis Statements
VAR-01CIneffectual Usage of Safe Arithmetics
VAR-02CLoop Iterator Optimization
VAR-03CSuboptimal Struct Declaration Styles
YTN-01CIneffectual Usage of Safe Arithmetics
YTN-02CInefficient mapping Lookups
YTN-03CLoop Iterator Optimizations