Omniscia Beanstalk Audit

Manual Review

Manual Review

A thorough line-by-line review was conducted on the codebase to identify potential malfunctions and vulnerabilities in the Beanstalk stablecoin protocol.

As the project at hand implements a unique Uniswap-interfacing stablecoin protocol, intricate care was put into ensuring that the flow of funds within the system conforms to the specifications and restrictions laid forth within the protocol's specification and that all peg stability mechanisms outlined in the whitepaper perform as intended.

We validated that all state transitions of the system occur within sane criteria and that all rudimentary formulas within the system execute as expected. We pinpointed a significant vulnerability within the system which could have lead to total loss of a user's own assets in case of misuse, however, it was conveyed ahead of time to the Beanstalk team to be promptly remediated.

Additionally, the system was investigated for any other commonly present attack vectors such as re-entrancy attacks, mathematical truncations, logical flaws and ERC / EIP standard inconsistencies. The documentation of the project was satisfactory to a certain extent, however, we strongly recommend the documentation of the project to be expanded at certain complex points such as the lpToPeg mechanism within LibConvert.

A total of 68 findings were identified over the course of the manual review of which 25 findings concerned the behaviour and security of the system. The non-security related findings, such as optimizations, are included in the separate Code Style chapter.

The finding table below enumerates all these security / behavioural findings:

IDSeverityAddressedTitle
ASE-01MPotentially Incompatible Storage Layout
BIP-01MIneffectual Usage of SafeMath
BIP-02MIndeterminate BIP Status Edge Case
BIP-03MInexistent Sanitisation of Diamond Compliant Data
BIP-04MMismatching Calculation of White Paper
CSO-01MPotential Re-Entrancy Attack Vector
CSO-02MInconsistent Balance Check
DIB-01MUnsafe Down-Casting
DIB-02MRedundantly Preemptive Amount Evaluation
FFT-01MDangerous Self-Transfer
FFE-01MSubstantial Supply Increase
FFE-02MImproper Handling of Overfunding
LPS-01MInexplicable Conditional
LCT-01MInexistent Justification of Calculations
LIE-01MUndocumented Code
LIL-01MInexistent Function Implementation
OFT-01MIncorrect Price Evaluation
SEE-01MFlash-Loan Prone LP Evaluation
USO-01MPotential Truncation of Unclaimed Root Accounting
VBH-01MInconsistent Behaviour
WEA-01MSpot Reserve Season-of-Plenty Evaluation
WEA-02MUnsafe Down-Casting
WEA-03MPotentially Incorrect Edge Case
WEA-04MDynamic Evaluation of Supply
WEA-05MMisleading Type Casting