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:
ID | Severity | Addressed | Title |
---|---|---|---|
BTR-01M | Major | Yes | Improper Permitted Delegation |
BTR-02M | Informational | Yes | Inexplicable Function ID |
DFN-01M | Minor | Acknowledged | Contract-Based Nonce System Race Condition |
EPL-01M | Minor | Yes | Unsanitized State Transition |
MAN-01M | Minor | Yes | Unsanitized State Transition |
OCV-01M | Minor | Yes | Unsanitized State Transition |
POO-01M | Minor | Yes | Unsanitized State Transition |
STA-01M | Minor | Yes | Improper Slashing Error Handling |
STA-02M | Minor | Yes | Unsanitized State Transition |
STA-03M | Informational | Yes | Potentially Incorrect Initialization |
SSC-01M | Minor | Yes | Potentially Dangerous Approval Operation |
SCV-01M | Minor | Yes | Potentially Dangerous Approval Operation |
TMP-01M | Minor | Yes | Unsanitized State Transition |
TMP-02M | Informational | Yes | Deviation of Balance Layer 2 Relay |
TMP-03M | Informational | Yes | Potentially Improper Overriddance of Withdrawal State |
TVP-01M | Minor | Yes | Unsanitized State Transition |
TVP-02M | Informational | Yes | Incorrect Function Visibility |
VTR-01M | Medium | Yes | Inexistent Validation of Duplicates |
VTR-02M | Medium | Yes | Potential Vote Race Condition |