Omniscia Teahouse Finance Audit

Manual Review

Manual Review

A thorough line-by-line review was conducted on the codebase to identify potential malfunctions and vulnerabilities in Teahouse Finance's on-chain portfolio implementation.

As the project at hand implements a multi-asset on-chain portfolio that interacts with multiple DeFi components, 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 integrations have been securely performed to the extent they could be validated.

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 medium-severity vulnerabilities within the system which could have had moderate ramifications to its overall operation; we strongly advise the Teahouse Finance team to evaluate them and remediate them as necessary.

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 custom Uniswap V3 like protocol integration to be revisited.

A total of 56 findings were identified over the course of the manual review of which 22 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
AAT-01MInexistent Validation of Array Lengths
AOE-01MPotential Misconception of Asset Invariance
AOE-02MInexistent Protection of Multiplication Overflow
AOE-03MInexistent Validation of Array Lengths
SRE-01MPotentially Dangerous Low-Level Call
SRE-02MInsecure Arbitrary Interactions
TVP-01MExternal Security Requirements
TVP-02MInexistent Validation of Array Lengths
TVP-03MUnsafe Casting Operation
TVV-01MNon-Standard Gap Size Specification
TVV-02MDiscrepant Management of Fee Times
TVV-03MImproper Fee Acquisition Methodology
TVV-04MImproper Order of Performance Fee Evaluation
TVV-05MInsufficient Validation of Oracle Compatibility
TVV-06MImproper Assumptions of Asset Maintenance
TVV-07MPotential Hijack of High Water Mark Initialization
TVH-01MInexplicable Implementations of Uniswap V3 Interactions
TVH-02MDeprecated Approval Operation
TVH-03MInexistent Prevention of Default Vault Value
TVH-04MInsecure Uniswap V3 LP Provision
TVH-05MInsecure Uniswap V3 LP Withdrawal
UVP-01MInexistent Sorting of Tokens