Omniscia Tokemak Network Audit

Manual Review

Manual Review

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

As the project at hand implements a layer 2 integrating protocol, 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 layer 2 interactions are appropriately performed in accordnace to the specification of the layer 2 solution utilized, namely Polygon's state bridge.

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 identified a flaw in the delegated balance bookkeeping within the system which could have had severe ramifications to its overall operation, however, it was conveyed ahead of time to the Tokemak 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 layer 2 integration points.

A total of 36 findings were identified over the course of the manual review of which 19 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
BTR-01MMajorYesImproper Permitted Delegation
BTR-02MInformationalYesInexplicable Function ID
DFN-01MMinorAcknowledgedContract-Based Nonce System Race Condition
EPL-01MMinorYesUnsanitized State Transition
MAN-01MMinorYesUnsanitized State Transition
OCV-01MMinorYesUnsanitized State Transition
POO-01MMinorYesUnsanitized State Transition
STA-01MMinorYesImproper Slashing Error Handling
STA-02MMinorYesUnsanitized State Transition
STA-03MInformationalYesPotentially Incorrect Initialization
SSC-01MMinorYesPotentially Dangerous Approval Operation
SCV-01MMinorYesPotentially Dangerous Approval Operation
TMP-01MMinorYesUnsanitized State Transition
TMP-02MInformationalYesDeviation of Balance Layer 2 Relay
TMP-03MInformationalYesPotentially Improper Overriddance of Withdrawal State
TVP-01MMinorYesUnsanitized State Transition
TVP-02MInformationalYesIncorrect Function Visibility
VTR-01MMediumYesInexistent Validation of Duplicates
VTR-02MMediumYesPotential Vote Race Condition