Omniscia DAFI Audit
Manual Review
Manual Review
A thorough line-by-line review was conducted on the codebase to identify potential malfunctions and vulnerabilities in the novel staking implementation by DAFI.
As the project at hand implements a new staking method, 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.
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 discrepancies within the system some of which could have had severe ramifications to its overall operation, however, they were conveyed ahead of time to the DAFI 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 accumulation of pool metrics.
In the latest commit of the codebase, a DIAPriceFeed
contract was introduced that is meant to replace the PriceFeeds
implementation. Although not part of the original scope, we inspected the codebase of the implementation as well as the oracle it interfaces to and we identified that firstly, it accepts stale values as valid since no validation of the timestamp
is performed and lastly, it taps into a centralized price implementation that a single external party controls and manually sets.
A total of 33 findings were identified over the course of the manual review of which 13 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:
ID | Severity | Addressed | Title |
---|---|---|---|
NDD-01M | Medium | Yes | Incorrect Deterministic Calculation |
NDD-02M | Minor | Yes | Inexistent Reversal of Authority |
PFS-01M | Medium | No | Improper Chainlink Integration |
REE-01M | Minor | Yes | Incorrect Execution Path |
REE-02M | Minor | Yes | Incorrect Initializer Pattern |
REE-03M | Minor | Yes | Inexistent Reversal of Authority |
SDE-01M | Minor | Yes | Inexistent Reversal of Authority |
SDE-02M | Minor | Yes | Unused Contract Member |
SMV-01M | Major | Yes | Ineffectual Stake Check |
SMV-02M | Minor | Yes | Inexistent Value Sanitization |
SMV-03M | Minor | Yes | Potentially Undesired Functionality |
TVL-01M | Minor | Yes | Beta Functionality |
TPL-01M | Minor | Yes | Inexistent Reversal of Authority |