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

Audit name:

[SCA] MFEV | MFEV-NETWORK | Nov2024

Date:

Jan 8, 2025

Table of Content

→Introduction
→Audit Summary
→System Overview
→Potential Risks
→Findings
→Appendix 1. Definitions
→Appendix 2. Scope
→Appendix 3. Additional Valuables
→Disclaimer

Want a comprehensive audit report like this?

Introduction

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

MFEV Network is a decentralized blockchain-powered platform and technology stack whose goal is to enable genuine mass adoption of crypto payments and decentralized finance (DeFi).

Document

NameSmart Contract Code Review and Security Analysis Report for MFEV
Audited ByDavid Camps Novi, Nataliia Balashova
Approved ByAtaberk Yavuzer
Websitehttps://mfevscan.com/→
Changelog16/12/2024 - Preliminary Report; 08/01/2025 - Final Report
PlatformMFEV Network
LanguageSolidity
TagsStaking, Voting
Methodologyhttps://hackenio.cc/sc_methodology→
  • Document

    Name
    Smart Contract Code Review and Security Analysis Report for MFEV
    Audited By
    David Camps Novi, Nataliia Balashova
    Approved By
    Ataberk Yavuzer
    Changelog
    16/12/2024 - Preliminary Report; 08/01/2025 - Final Report
    Platform
    MFEV Network
    Language
    Solidity
    Tags
    Staking, Voting

Review Scope

Repositoryhttps://github.com/MFEVOfficial/MFEV-NETWORK→
Commit02d7a94

Audit Summary

12Total Findings
5Resolved
6Accepted
1Mitigated

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

Documentation quality

  • Functional requirements are limited

    • A general description of the protocol is provided, but no deeper description of the contracts and their functionality.

    • Smart contracts architecture is not provided.

  • Technical description is not provided

    • No run instructions

    • No technical specification.

Code quality

  • The development environment is not configured since it is required to manually configure bootnode in order to work with the system.

  • Outdated Solidity version.

  • Poor NatSpec quality.

Test coverage

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

  • Tests are not configured for a quick start (i.e. installation with a single command and run tests with a single command).

  • Critical issues (see findings section) do not allow for the necessary conditions to run the tests successfully.

System Overview

MFEV Network is a decentralized blockchain-powered platform and technology stack whose goal is to enable genuine mass adoption of crypto payments and decentralized finance (DeFi).

It consists of the following contracts, which are based on and inspired by Fuse Network's →:

  • RewardsDistributor: allows the owner (contract deployer) to add rewards for different addresses, which will be processed and sent during block reward execution. A reward that has been processed cannot be added again.

  • Voting: allows validators to create ballots and vote on them.

  • BlockReward: executes the whole reward mechanism, which is called by the system role to send out mining rewards to the miner as well as their delegators and the rewards receivers defined in the rewards distributor.

  • Consensus: entry point for users to stake or unstake tokens into the system in order to become future validators of the protocol.

  • ProxyStorage, EternalStorage, EternalStorageProxy: handle the storage of the system and the upgradability of contract addresses.

Privileged roles

  • Owner:

    • Initializes most contracts and manages some key parameters for the system to work correctly.

    • Adds users rewards that will be sent out during the execution of reward().

  • System Role:

    • Triggers the reward() function at every block,.

    • Calls finalizeChange() in order to update the validators of the system.

  • Validator:

    • Emits the events RewardedOnCycle and InitiateChange.

    • Updates the fee charged to their delegators.

    • Can drop/join the next cycle via maintenance and unJail().

    • May crate new ballots to be voted on.

Potential Risks

Any external address can vote on ballots created by validators via Voting::vote(). However, such votes will not be taken into account since only the validators' stake counts as voting power.

Every cycle of the system will reset the validators of the protocol. When doing so, the current validators will be overridden by the pending validators. Thus, the system managers should carefully make sure that those addresses to be kept in the system as validators will be included in the pending validators array.

The contracts fail to use the SafeMath library to avoid overflowing in the following cases: BlockReward: getUsersAndRewards(); ConsensusUtils: _incBlockCounter(), _incStrikeReset, _setCurrentCycle(), _setCurrentValidators(), _setJailRelease(); RewardsDistributor: calculateUserRewards(). Although the likelihood of reaching overflow is low, the development team should consider using SafeMath for such cases.

Findings

F-2024-7682Lack of Critical Variables Setup Result in Denial of Service
Status
mitigated
Severity

Critical
F-2024-7654Incorrect Calculation Results in Wrong Supply and Rewards
Status
fixed
Severity

Critical
F-2024-7684Validators can Effectively Take Over All Rewards from their Delegators
Status
fixed
Severity

Medium
F-2024-7701Use of Built-in Transfer Instead of Cal To Send Native Assets
Status
accepted
Severity

Low
F-2024-7678Insufficient Handling of Duplicate Entries in Arrays
Status
accepted
Severity

Low
F-2024-7704Cache Variable Array Length In For Loop
Status
fixed
Severity

Observation
F-2024-7702 Multiplication After Division may Result in Precision Loss
Status
accepted
Severity

Observation
F-2024-7688Missing Zero Address Check may Result in Loss of Funds
Status
fixed
Severity

Observation
F-2024-7685Lack of Error Messages decrease Code Quality and Troubleshooting
Status
accepted
Severity

Observation
F-2024-7683BlockReward is Setup at Epoch Years instead of System Years
Status
accepted
Severity

Observation
Code
―
Title
Status
Severity
F-2024-7682Lack of Critical Variables Setup Result in Denial of Service
mitigated

Critical
F-2024-7654Incorrect Calculation Results in Wrong Supply and Rewards
fixed

Critical
F-2024-7684Validators can Effectively Take Over All Rewards from their Delegators
fixed

Medium
F-2024-7701Use of Built-in Transfer Instead of Cal To Send Native Assets
accepted

Low
F-2024-7678Insufficient Handling of Duplicate Entries in Arrays
accepted

Low
F-2024-7704Cache Variable Array Length In For Loop
fixed

Observation
F-2024-7702 Multiplication After Division may Result in Precision Loss
accepted

Observation
F-2024-7688Missing Zero Address Check may Result in Loss of Funds
fixed

Observation
F-2024-7685Lack of Error Messages decrease Code Quality and Troubleshooting
accepted

Observation
F-2024-7683BlockReward is Setup at Epoch Years instead of System Years
accepted

Observation
1-10 of 12 findings

Identify vulnerabilities in your smart contracts.

Appendix 1. Definitions

Severities

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.
  • 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.

Potential Risks

The "Potential Risks" section identifies issues that are not direct security vulnerabilities but could still affect the project’s performance, reliability, or user trust. These risks arise from design choices, architectural decisions, or operational practices that, while not immediately exploitable, may lead to problems under certain conditions. Additionally, potential risks can impact the quality of the audit itself, as they may involve external factors or components beyond the scope of the audit, leading to incomplete assessments or oversight of key areas. This section aims to provide a broader perspective on factors that could affect the project's long-term security, functionality, and the comprehensiveness of the audit findings.

Appendix 2. Scope

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

Scope Details

Repositoryhttps://github.com/MFEVOfficial/MFEV-NETWORK→
Commit02d7a94
Whitepaperhttps://mfev.io/whitepaper.pdf→
Requirementshttps://mfev.gitbook.io/mfev-docs→
Technical RequirementsNot provided

Assets in Scope

abstracts
BlockRewardBase.sol - abstracts › BlockRewardBase.sol
ValidatorSet.sol - abstracts › ValidatorSet.sol
VotingBase.sol - abstracts › VotingBase.sol
BlockReward.sol - BlockReward.sol
Consensus.sol - Consensus.sol
ConsensusUtils.sol - ConsensusUtils.sol
eternal-storage
EternalStorage.sol - eternal-storage › EternalStorage.sol
EternalStorageProxy.sol - eternal-storage › EternalStorageProxy.sol
interfaces
IBlockReward.sol - interfaces › IBlockReward.sol
IConsensus.sol - interfaces › IConsensus.sol
IVoting.sol - interfaces › IVoting.sol
ProxyStorage.sol - ProxyStorage.sol
RewardsDistributor.sol - RewardsDistributor.sol
Voting.sol - Voting.sol
VotingUtils.sol - VotingUtils.sol

Appendix 3. Additional Valuables

Verification of System Invariants

During the audit of MFEV, Hacken followed its methodology by performing fuzz-testing on the project's main functions. Foundry →, a tool used for fuzz-testing, was employed to check how the protocol behaves under various inputs. Due to the complex and dynamic interactions within the protocol, unexpected edge cases might arise. Therefore, it was important to use fuzz-testing to ensure that several system invariants hold true in all situations.

Fuzz-testing allows the input of many random data points into the system, helping to identify issues that regular testing might miss. A specific Echidna fuzzing suite was prepared for this task, and throughout the assessment, 10 invariants were tested over 2610 runs. This thorough testing ensured that the system works correctly even with unexpected or unusual inputs.

Invariant

Test Result

Run Count

Total Supply After RewardPassed261
Delegated Amount of TokensPassed261
Withdrawn Amount of TokensPassed261
Voting AddressesPassed261
Number of Voting BallotsPassed261
Voting Ballots CyclesPassed261
Voting Ballots DurationPassed261
Addresses in Users RewardsPassed261
Rewards in Users RewardsPassed261
Users Rewards cannot be DuplicatedPassed261
  • Invariant

    Total Supply After Reward

    Test Result

    Passed

    Run Count

    261

    Invariant

    Delegated Amount of Tokens

    Test Result

    Passed

    Run Count

    261

    Invariant

    Withdrawn Amount of Tokens

    Test Result

    Passed

    Run Count

    261

    Invariant

    Voting Addresses

    Test Result

    Passed

    Run Count

    261

    Invariant

    Number of Voting Ballots

    Test Result

    Passed

    Run Count

    261

    Invariant

    Voting Ballots Cycles

    Test Result

    Passed

    Run Count

    261

    Invariant

    Voting Ballots Duration

    Test Result

    Passed

    Run Count

    261

    Invariant

    Addresses in Users Rewards

    Test Result

    Passed

    Run Count

    261

    Invariant

    Rewards in Users Rewards

    Test Result

    Passed

    Run Count

    261

    Invariant

    Users Rewards cannot be Duplicated

    Test Result

    Passed

    Run Count

    261

Additional Recommendations

The smart contracts in the scope of this audit could benefit from the introduction of automatic emergency actions for critical activities, such as unauthorized operations like ownership changes or proxy upgrades, as well as unexpected fund manipulations, including large withdrawals or minting events. Adding such mechanisms would enable the protocol to react automatically to unusual activity, ensuring that the contract remains secure and functions as intended.

To improve functionality, these emergency actions could be designed to trigger under specific conditions, such as:

  • Detecting changes to ownership or critical permissions.

  • Monitoring large or unexpected transactions and minting events.

  • Pausing operations when irregularities are identified.

These enhancements would provide an added layer of security, making the contract more robust and better equipped to handle unexpected situations while maintaining smooth operations.

Disclaimer