Omniscia Gravita Protocol Audit

Code Style

Code Style

During the manual portion of the audit, we identified 60 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
APL-01CInefficient Renunciation of Ownership
APL-02CInexplicable Ownable Pattern
APL-03CRedundant Initialization Paradigm
ACT-01CInefficient mapping Lookups
ACT-02CInexistent Error Message
ACT-03CLoop Iterator Optimizations
ACT-04CMisleading Variable Name
BOS-01CIneffectual Native Value Check
BOS-02CRedundant Native Value Check
BOS-03CSuboptimal Struct Declaration Styles
CSP-01CInefficient Renunciation of Ownership
CSP-02CInefficient mapping Lookups
CSP-03CInexplicable Ownable Pattern
CSP-04CRedundant Initialization Paradigm
DTN-01CVariable Mutability Specifier (Immutable)
DPL-01CInefficient Renunciation of Ownership
DPL-02CInefficient mapping Lookups
DPL-03CInexplicable Ownable Pattern
DPL-04CRedundant Initialization Paradigm
ERD-01CNon-Standard Interface Name
ERC-01CInefficient mapping Lookups
ERC-02CMultiple Top-Level Declarations
ERC-03CRedundant Low-Level Assembly Blocks
ERC-04CVariable Mutability Specifier (Immutable)
FCR-01CInefficient mapping Lookups
FCR-02CInexistent Error Messages
FCR-03CLeftover Test Code
FCR-04CLoop Iterator Optimization
FCR-05CRedundant Initialization Paradigm
GBE-01CUnused Function Declaration
GMH-01CIllegible Representation of Value Literal
GMH-02CRepetitive Value Literal
PBE-01CSignificantly Inefficient Merging of Pending Gains / Distributed Funds
PBE-02CUnused Error Declaration
PFD-01CInexistent Error Message
PFD-02CRedundant External Self-Calls
PFD-03CRedundant Function Implementation
PFD-04CRedundant Initialization Paradigm
PFD-05CSuboptimal Struct Declaration Styles
RGU-01CInefficient Reentrancy Guard Implementation
SVS-01CInefficient Renunciation of Ownership
SVS-02CInefficient mapping Lookups
SVS-03CInexplicable Ownable Pattern
SVS-04CRedundant Initialization Paradigm
SPL-01CInefficient Renunciation of Ownership
SPL-02CInefficient mapping Lookups
SPL-03CInexplicable Contract Member
SPL-04CInexplicable Ownable Pattern
SPL-05CLoop Iterator Optimizations
SPL-06CRedundant Initialization Paradigm
SPL-07CSuboptimal Struct Declaration Style
TKC-01CInefficient Application of Access Control
TKC-02CRedundant Function Implementation
VMR-01CInefficient mapping Lookups
VMR-02CRedundant Data Point
VMR-03CRedundant External Self-Call
VMR-04CRedundant Initialization Paradigm
VMO-01CLoop Iterator Optimizations
VMO-02CRedundant Initialization Paradigm
VMO-03CSuboptimal Struct Declaration Styles