Omniscia rain protocol Audit

Manual Review

Manual Review

A thorough line-by-line review was conducted on the codebase to identify potential malfunctions and vulnerabilities in the complex multi-component Rain protocol.

As the project at hand implements a custom virtual machine as well as multiple asset-managing contracts, 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 the documentation of the novel virtual machine complies with the code that the contracts implement.

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 virtual machine's mathematical module which could have had severe ramifications to its overall operation, however, it was conveyed ahead of time to the Rain 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 an exemplary extent, however, we advise all documentation mistakes to be corrected and certain components to be further documented to ensure ease-of-maintenance as well as ease-of-integration.

A total of 48 findings were identified over the course of the manual review of which 23 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
CTR-01MPotential Sanitization of VM State Configuration
ERB-01MBalance Flash-Loan Susceptibility
ERC-01MPotential Function Misuse
ERC-02MMutability Documentation Discrepancy
ERR-01MPotentially Unfair Redemptions of Rebasing Assets
EER-01MPotential Sanitization of VM State Configuration
FAC-01MInexistent Validation of Existing Child
ITR-01MReport Encoding Discrepancy
MOS-01MInexistent Accumulation of Exponention
RVM-01MDocumentation Discrepancy of Opcode Consumption
RVM-02MDocumentation Discrepancy of Operators
RVM-03MDocumentation Discrepancy of Zipmap Operand Unpacking
RVM-04MInexplicable Limitation of Jump Instructions
RER-01MInexplicable Status Restriction
REE-01MDocumentation Discrepancy of Call Validity
TBC-01MCounter-Intuitive Tier Check
TOP-01MInsufficient Documentation of Stack Layout
TCE-01MPotential Nullification of Upcoming Tiers
TRU-01MDeprecated Usage of Safe Approval
TRU-02MDocumentation Discrepancies
VTR-01MInexistent Enforcement of Tier Value Validity
VER-01MIntroduction of Single Point of Failure
VER-02MPotentially Dangerous Race Condition