Q2 2026 Security & Compliance Report67 incidents, $764M in losses, 88% from operational failures.
Get the report →

Audit name:

[SCA] MetaTime | Layer 2 | Oct2023

Date:

Nov 7, 2023

Table of Content

→Introduction
→Audit Summary
→Document Information
→System Overview
→Executive Summary
→Risks
→Findings
→Appendix 1. Severity Definitions
→Appendix 2. Scope
→Disclaimer

Want a comprehensive audit report like this?

Introduction

We express our gratitude to the MetaTime team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.

By completely self-funding its technology development stages, Metatime aims to establish the world’s most comprehensive and transparent ecosystem. Metatime continues to innovate and develop a wide range of products such as MetaChain, MetaWallet, Metatime Coin, MetaExchange, and MetaNFT, placing user needs at the forefront and designing from the ground up.

titlecontent
PlatformEVM
LanguageSolidity
TagsLayer 2, Proof of Stake, Yield
Timeline20/10/2023 - 07/11/2023
Methodologyhttps://hackenio.cc/sc_methodology→

    Review Scope

    Repositoryhttps://github.com/Metatime-Technology-Inc/genesis-contracts→
    Commit8cd0c6667bd4c42f6554d2ae0aa8d4daa8ea998e

    Audit Summary

    Total10/10
    Security Score

    10/10

    Test Coverage

    100%

    Code Quality Score

    10/10

    Documentation Quality Score

    10/10

    23Total Findings
    23Resolved
    0Accepted
    0Mitigated

    The system users should acknowledge all the risks summed up in the risks section of the report

    Document Information

    This report may contain confidential information about IT systems and the intellectual property of the Customer, as well as information about potential vulnerabilities and methods of their exploitation.

    The report can be disclosed publicly after prior consent by another Party. Any subsequent publication of this report shall be without mandatory consent.

    Document

    NameSmart Contract Code Review and Security Analysis Report for MetaTime
    Audited ByAtaberk Yavuzer - Senior Solidity SC Auditor at Hacken OÜ
    Approved ByLuciano Ciattaglia - Head of Services
    Grzegorz Trawiński - Lead Solidity SC Auditor at Hacken OÜ
    Websitehttps://metatime.com/→
    Changelog26/10/2023 - Initial Review
    07/11/2023 - Second Review
    • Document

      Name
      Smart Contract Code Review and Security Analysis Report for MetaTime
      Audited By
      Ataberk Yavuzer - Senior Solidity SC Auditor at Hacken OÜ
      Approved By
      Luciano Ciattaglia - Head of Services
      Grzegorz Trawiński - Lead Solidity SC Auditor at Hacken OÜ
      Changelog
      26/10/2023 - Initial Review
      07/11/2023 - Second Review

    System Overview

    MetaTime is a Layer 1 protocol with the following contracts:

    • BlockValidator — a contract for validating and finalizing blocks.

    • Bridge — a smart contract for bridging tokens to another chain.

    • Macrominer — a contract for managing and voting on the status of macrominers which is one of the main types of nodes in the protocol.

    • Metaminer — a smart contract representing a Metaminer which is one of the main types of nodes, allowing users to stake and participate in block validation.

    • Microminer — a smart contract to manage Microminer nodes on the protocol which is another miner type to participate in votes.

    • MinerFormula — a smart contract for managing reward calculation formulas for miners.

    • MinerHealthCheck — a contract for checking and managing miner health status.

    • MinerList — a smart contract for managing a list of miners.

    • TxValidator — a contract for validating transactions and managing votes on transactions.

    • MinerPool — contract which manages the distribution of tokens to miners based on their activity. This contract interacts with MinerHealthCheck and TxValidator contracts for rewards.

    • RewardsPool — a smart contract for distributing tokens over a specified period of time for mining purposes. This contract interacts with the BlockValidator contract for rewards.

    Privileged roles

    • The protocol owner (OWNERROLE) can modify blacklist users and freeze Bridge contracts, enroll Metaminer_ nodes, extend their subscriptions, set share percentage information for miners, and change timeout for miner nodes.

    • Validators (VALIDATOR_ROLE) can add a block payload to the queue for a specific block.

    • Managers (MANAGERROLE) are responsible for making calls from other contracts in the protocol. The MANAGERROLE will be granted to smart contracts by protocol owners.

    Executive Summary

    Documentation quality

    The total Documentation quality score is 10 out of 10.

    • Functional requirements are provided.

    • Business logic is provided.

    • Use cases are provided very detailed.

    • Technical description is provided.

    Code quality

    The total Code quality score is 10 out of 10.

    • The development environment is configured.

    • The code follows the Solidity Style Guide.

    • The code is optimized from a gas consumption perspective.

    Test coverage

    Code coverage of the project is 100% (branch coverage).

    • Deployment and basic user interactions are covered with tests.

    • All protocol features and cases are covered with tests.

    Security score

    Upon auditing, the code was found to contain 3 critical, 3 high, 5 medium, and 6 low severity issues. Out of these, 17 issues have been addressed and resolved, leading to a Security score of 10 out of 10.

    All identified issues are detailed in the “Findings” section of this report.

    Summary

    The comprehensive audit of the customer's smart contract yields an overall score of 10. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.

    Risks

    Validators have full authority on block payloads. Therefore, they can craft malicious block payloads by setting high txRewards.

    If MANAGERROLE accidentally grants any EOA address by the owner, that user can drain all balance on MinerPool, RewardsPool, BlockValidator, MainnetBridge, Bridge, MainnetBridge_ contracts since these contracts have ether sending functions. Additionally, it is possible to mint unlimited MetaPoints with the same permission.

    Findings

    F-2023-0927Vote functionality in TxValidator is open to manipulation
    Status
    fixed
    Severity

    Critical
    F-2023-0926Over-rewarding users due to inconsistency on MinerFormulas
    Status
    fixed
    Severity

    Critical
    F-2023-0925Drain of funds by calling unsubscribe() function due to reentrancy
    Status
    fixed
    Severity

    Critical
    F-2023-0930Macrominers can cast unlimited votes to kick inactive miners
    Status
    fixed
    Severity

    High
    F-2023-0929Unpaid validators can getting paid and deny unsubscribe() right of paid validators
    Status
    fixed
    Severity

    High
    F-2023-0928Macrominer nodes can gain full authority over reward decisions in short period
    Status
    fixed
    Severity

    High
    F-2023-0935Share incomes may not be distributed due to incorrect allocation
    Status
    fixed
    Severity

    Medium
    F-2023-0934Macrominer nodes can gain full authority over kicking inactive nodes in short period
    Status
    fixed
    Severity

    Medium
    F-2023-0933Malicious validator can drain all Metaminer funds via Reentrancy on _shareIncome() function
    Status
    fixed
    Severity

    Medium
    F-2023-0932Shareholder incomes set by admin can be eliminated by paying ANNUAL_AMOUNT
    Status
    fixed
    Severity

    Medium
    Code
    ―
    Title
    Status
    Severity
    F-2023-0927Vote functionality in TxValidator is open to manipulation
    fixed

    Critical
    F-2023-0926Over-rewarding users due to inconsistency on MinerFormulas
    fixed

    Critical
    F-2023-0925Drain of funds by calling unsubscribe() function due to reentrancy
    fixed

    Critical
    F-2023-0930Macrominers can cast unlimited votes to kick inactive miners
    fixed

    High
    F-2023-0929Unpaid validators can getting paid and deny unsubscribe() right of paid validators
    fixed

    High
    F-2023-0928Macrominer nodes can gain full authority over reward decisions in short period
    fixed

    High
    F-2023-0935Share incomes may not be distributed due to incorrect allocation
    fixed

    Medium
    F-2023-0934Macrominer nodes can gain full authority over kicking inactive nodes in short period
    fixed

    Medium
    F-2023-0933Malicious validator can drain all Metaminer funds via Reentrancy on _shareIncome() function
    fixed

    Medium
    F-2023-0932Shareholder incomes set by admin can be eliminated by paying ANNUAL_AMOUNT
    fixed

    Medium
    1-10 of 23 findings

    Identify vulnerabilities in your smart contracts.

    Appendix 1. Severity Definitions

    When auditing smart contracts, Hacken is using a risk-based approach that considers Likelihood, Impact, Exploitability and Complexity metrics to evaluate findings and score severities.

    Reference on how risk scoring is done is available through the repository in our Github organization:

    Severity

    Description

    Critical
    Critical vulnerabilities are usually straightforward to exploit and can lead to the loss of user funds or contract state manipulation.

    High
    High vulnerabilities are usually harder to exploit, requiring specific conditions, or have a more limited scope, but can still lead to the loss of user funds or contract state manipulation.

    Medium
    Medium vulnerabilities are usually limited to state manipulations and, in most cases, cannot lead to asset loss. Contradictions and requirements violations. Major deviations from best practices are also in this category.

    Low
    Major deviations from best practices or major Gas inefficiency. These issues will not have a significant impact on code execution, do not affect security score but can affect code quality score.
    • Severity

      Critical

      Description

      Critical vulnerabilities are usually straightforward to exploit and can lead to the loss of user funds or contract state manipulation.

      Severity

      High

      Description

      High vulnerabilities are usually harder to exploit, requiring specific conditions, or have a more limited scope, but can still lead to the loss of user funds or contract state manipulation.

      Severity

      Medium

      Description

      Medium vulnerabilities are usually limited to state manipulations and, in most cases, cannot lead to asset loss. Contradictions and requirements violations. Major deviations from best practices are also in this category.

      Severity

      Low

      Description

      Major deviations from best practices or major Gas inefficiency. These issues will not have a significant impact on code execution, do not affect security score but can affect code quality score.

    Appendix 2. Scope

    The scope of the project includes the following smart contracts from the provided repository:

    Scope Details

    Repositoryhttps://github.com/Metatime-Technology-Inc/genesis-contracts→
    Commit8cd0c6667bd4c42f6554d2ae0aa8d4daa8ea998e
    WhitepaperProvided→
    RequirementsProvided
    Technical RequirementsProvided

    Contracts in Scope

    MinerPool.sol - MinerPool.sol
    RewardsPool.sol - RewardsPool.sol
    Blacklistable.sol - Blacklistable.sol
    Freezeable.sol - Freezeable.sol
    RolesHandler.sol - RolesHandler.sol
    MinerTypes.sol - MinerTypes.sol
    BlockValidator.sol - BlockValidator.sol
    Bridge.sol - Bridge.sol
    Macrominer.sol - Macrominer.sol
    MainnetBridge.sol - MainnetBridge.sol
    MetaPoints.sol - MetaPoints.sol
    Metaminer.sol - Metaminer.sol
    Microminer.sol - Microminer.sol
    MinerFormulas.sol - MinerFormulas.sol
    MinerHealthCheck.sol - MinerHealthCheck.sol
    MinerList.sol - MinerList.sol
    MultiSigWallet.sol - MultiSigWallet.sol
    Multicall3.sol - Multicall3.sol
    Roles.sol - Roles.sol
    TxValidator.sol - TxValidator.sol

    Disclaimer