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:

IDSeverityAddressedTitle
NDD-01MMediumYesIncorrect Deterministic Calculation
NDD-02MMinorYesInexistent Reversal of Authority
PFS-01MMediumNoImproper Chainlink Integration
REE-01MMinorYesIncorrect Execution Path
REE-02MMinorYesIncorrect Initializer Pattern
REE-03MMinorYesInexistent Reversal of Authority
SDE-01MMinorYesInexistent Reversal of Authority
SDE-02MMinorYesUnused Contract Member
SMV-01MMajorYesIneffectual Stake Check
SMV-02MMinorYesInexistent Value Sanitization
SMV-03MMinorYesPotentially Undesired Functionality
TVL-01MMinorYesBeta Functionality
TPL-01MMinorYesInexistent Reversal of Authority