Omniscia Beanstalk Audit

Code Style

Code Style

During the manual portion of the audit, we identified 43 optimizations that can be applied to the codebase that will decrease the gas-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
BEA-01CDeprecated Representation Style
BDR-01CDeprecated Representation Style
BIP-01CInefficient Assignment of Array
BIP-02CInefficient Length Evaluation
PRO-01CInexplicable Value Literal
PRO-02CSuboptimal Code Legibility
CFE-01CRedundant Usage of SafeMath
CSO-01CInexistent Usage of Constant
CSO-02CRedundant Usage of SafeMath
DEC-01CReturn Value Optimization
DIB-01CCode Duplication
DIB-02CConditional Reorder Optimization
DIB-03CDeprecated Representation Style
FFT-01CRedundant Usage of SafeMath
FFE-01CRedundant Usage of SafeMath
GFT-01CCode Duplication
GFT-02CInefficient First Vote
IB0-01CInefficient Loop Data Type
IDD-01CDeprecated Representation Style
IEY-01CMisleading Comments
PRL-01CMislabelled Contract
LPS-01CInexistent Usage of Constant
LPS-02CRedundant Re-Calculation
LCT-01CRedundant Future Trade Timestamp
LCT-02CTernary Operator Optimization
LCT-03CVariable Typo
LDD-01CGas Optimization Deviation
LIL-01CInefficient Function Signature Computation
LMT-01CCode Duplication
LMT-02CRedundant Future Trade Timestamp
LMT-03CRedundant Usage of SafeMath
LIF-01CDeprecated Representation Style
LIF-02CRedundant Usage of SafeMath
OFT-01CRedundant Condition Evaluation
SIL-01CIneffectual Loop Iteration
SEE-01CInefficient Length Lookups
SEE-02CRedundant Usage of SafeMath
SEE-03CTernary Operator Optimization
SET-01CLock Cleanup Optimization
SET-02CRedundant Usage of SafeMath
USO-01CRedundant Conditional Evaluation
WEA-01CDeprecated Representation Style
WEA-02CRedundant Usage of SafeMath