Omniscia 0xPhase Audit

Manual Review

Manual Review

A thorough line-by-line review was conducted on the codebase to identify potential malfunctions and vulnerabilities in 0xPhase's stablecoin borrowing protocol.

As the project at hand implements a collateralized algorithmic stablecoin borrowing system, intricate care was put into ensuring that the flow of funds & assets within the system conforms to the specifications and restrictions laid forth within the protocol's specification.

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 multiple logical and language-specific vulnerabilities within the system which could have had severe ramifications to its overall operation.

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 it to be expanded at certain complex points such as how the Manager treats the higher-bit of a Manager::batchCall as a flag to signify whether native funds should be associated with the call.

A total of 76 findings were identified over the course of the manual review of which 39 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
ACB-01MInexistent Initialization of Access Control
AUP-01MIncorrect Implementation of Initialization
CLB-01MWeak Validation of Call Result
COE-01MInsecure Calculation of Share Amount
COV-01MImproper Integration of Chainlink Oracles
CAV-01MAbnormal Credit Account Behaviour
DBV-01MIncorrect Addition of Value
DBV-02MUnsafe Type Casting
DBV-03MDiscrepant Behaviour of NAND Operator
DBV-04MIncorrect Arithmetic Operator Methodology
DBV-05MIncorrect Logical Operator Methodology
DBV-06MIncorrect Removal of Value
DLI-01MInexistent Requirement of Code
ERP-01MSignificant Deviation of Standard
ERV-01MSignificant Deviation of Standard
FOE-01MImproper Implementation of Oracle
ICA-01MImproper Disable of Initializers
IPT-01MImproper Disable of Initializers
MRE-01MUnsafe Length Cast
OBE-01MInexistent Initialization of Ownership
PTV-01MInexistent Validation of Allowances
SPY-01MIncorrect Implementation of Initialization
SLB-01MImproper Checked Arithmetic
SUP-01MIncorrect Implementation of Initialization
TV1-01MInexistent Prevention of Accidental Transfers
TV1-02MIncorrect Order of Execution
TV1-03MIncorrect Setting Mechanism
VAF-01MImproper Relay of Message Value
VAF-02MNon-Standard Application of Fee
VAF-03MImproper Emergency Mode Checks
VBE-01MUnknown Integration Points
VBE-02MDangerous Order of Mathematical Operations
VBE-03MIncorrect Definition of Diamond Storage
VIR-01MImproper Initializer Definition
VLF-01MUnknown Integration Point
VLF-02MAccuracy-Loss Prone Convoluted Mathematical Operations
VLF-03MLoss of Arithmetic Accuracy
VLF-04MIncorrect Rebate Calculation Mechanism
VSF-01MInexistent Sanitization of Variables