Omniscia Tokemak Network Audit

L2 Protocol Security Audit

Audit Overview

We were tasked with performing a full audit of the Tokemak protocol and in particular the latest version which includes layer-2 integration with the Polygon state bridge transmitter.

Over the course of the audit, we focused on identifying potential L2 misbehaviours that the system can introduce due to improper integration with the Polygon standard as well as general logic and arithmetic bugs that could result in a compromisation of the system.

We noted several L2 adjustments that should be made to ensure more seamless interaction between the bridged layers as well as certain state transitions that we believe should be prohibited at the code level, including a major vulnerability in the delegation system that can cause delegated units to be lost.

Additionally, we were able to pinpoint several gas optimizations that we strongly advise the Tokemak team to consider and potentially alleviate along with any vulnerabilities identified within the report.

Post-Audit Conclusion

The Tokemak team considered all the exhibits outlined in the report and provided an alleviation for all that were deemed valid whilst also supplying our team with additional documentation and guidance as to why certain of the findings identified in the report were in fact acceptable behaviour of the protocol.

We proceeded to adjust the report's finding severity categorization based on the new feedback and re-assessed the codebase with the latest instructions as to its operation provided to us by Tokemak in mind.

As the Tokemak team alleviated all findings identified in the report the codebase can be considered to be of a high security standard.

Contracts Assessed

Files in ScopeRepositoryCommit(s)
AirdropPush.sol (APH)tokemak-smart-contracts5d48c0c755,
3d52339366
AddressRegistry.sol (ARY)tokemak-smart-contracts5d48c0c755,
3d52339366
BalanceTracker.sol (BTR)tokemak-smart-contracts5d48c0c755,
3d52339366
BaseController.sol (BCR)tokemak-smart-contracts5d48c0c755,
3d52339366
BalancerController.sol (BCE)tokemak-smart-contracts5d48c0c755,
3d52339366
CoreEvent.sol (CET)tokemak-smart-contracts5d48c0c755,
3d52339366
DefiRound.sol (DRD)tokemak-smart-contracts5d48c0c755,
3d52339366
DelegateFunction.sol (DFN)tokemak-smart-contracts5d48c0c755,
3d52339366
EthPool.sol (EPL)tokemak-smart-contracts5d48c0c755,
3d52339366
EventProxy.sol (EPY)tokemak-smart-contracts5d48c0c755,
3d52339366
Imports.sol (IMP)tokemak-smart-contracts5d48c0c755,
3d52339366
IFxStateSender.sol (IFS)tokemak-smart-contracts5d48c0c755,
3d52339366
IStateReceiver.sol (ISR)tokemak-smart-contracts5d48c0c755,
3d52339366
IFxMessageProcessor.sol (IFM)tokemak-smart-contracts5d48c0c755,
3d52339366
Manager.sol (MAN)tokemak-smart-contracts5d48c0c755,
3d52339366
OnChainVoteL1.sol (OCV)tokemak-smart-contracts5d48c0c755,
3d52339366
Pool.sol (POO)tokemak-smart-contracts5d48c0c755,
3d52339366
PreToke.sol (PTE)tokemak-smart-contracts5d48c0c755,
3d52339366
Redeem.sol (RED)tokemak-smart-contracts5d48c0c755,
3d52339366
Rewards.sol (REW)tokemak-smart-contracts5d48c0c755,
3d52339366
RewardHash.sol (RHH)tokemak-smart-contracts5d48c0c755,
3d52339366
RewardsManager.sol (RMR)tokemak-smart-contracts5d48c0c755,
3d52339366
Staking.sol (STA)tokemak-smart-contracts5d48c0c755,
3d52339366
SushiSwapControllerV2.sol (SSC)tokemak-smart-contracts5d48c0c755,
3d52339366
SushiswapControllerV1.sol (SCV)tokemak-smart-contracts5d48c0c755,
3d52339366
Toke.sol (TOK)tokemak-smart-contracts5d48c0c755,
3d52339366
TokeVotePool.sol (TVP)tokemak-smart-contracts5d48c0c755,
3d52339366
TokeMigrationPool.sol (TMP)tokemak-smart-contracts5d48c0c755,
3d52339366
TransferController.sol (TCR)tokemak-smart-contracts5d48c0c755,
3d52339366
UniswapController.sol (UCR)tokemak-smart-contracts5d48c0c755,
3d52339366
VoteTracker.sol (VTR)tokemak-smart-contracts5d48c0c755,
3d52339366
ZeroExController.sol (ZEC)tokemak-smart-contracts5d48c0c755,
3d52339366
ZeroExTradeWallet.sol (ZET)tokemak-smart-contracts5d48c0c755,
3d52339366

Audit Synopsis

SeverityIdentifiedAlleviatedPartially AlleviatedAcknowledged
Major1100
Medium2200
Minor131201
Informational231805

During the audit, we filtered and validated a total of 3 findings utilizing static analysis tools as well as identified a total of 36 findings during the manual review of the codebase. We strongly recommend that any minor severity or higher findings are dealt with promptly prior to the project's launch as they introduce potential misbehaviours of the system as well as exploits.

pie title Total Issues "Informational" : 23 "Minor" : 13 "Medium" : 2 "Major" : 1

The list below covers each segment of the audit in depth and links to the respective chapter of the report: