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

Audit name:

[SCA] Mesi | Mesi-Contracts | Aug2024

Date:

Sep 30, 2024

Table of Content

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

Want a comprehensive audit report like this?

Introduction

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

Mesi is a new kind of social expression app that inspires to create, express, interact, and earn while providing a deep sense of community and self-sovereignty. The audit includes, the Token, Governance, Vesting, and Presale platform parts.

Document

NameSmart Contract Code Review and Security Analysis Report for MESI
Audited ByStepan Chekhovskoi
Approved ByGrzegorz Trawinski
Websitehttps://www.mesi.app/→
Changelog20/08/2024 - Initial Report
30/09/2024 - Final Report
PlatformEthereum
LanguageSolidity
TagsERC-20, Governance, Vesting, Presale
Methodologyhttps://hackenio.cc/sc_methodology→
  • Document

    Name
    Smart Contract Code Review and Security Analysis Report for MESI
    Audited By
    Stepan Chekhovskoi
    Approved By
    Grzegorz Trawinski
    Changelog
    20/08/2024 - Initial Report
    30/09/2024 - Final Report
    Platform
    Ethereum
    Language
    Solidity
    Tags
    ERC-20, Governance, Vesting, Presale

Review Scope

Repositoryhttps://github.com/BoostyLabs/mesi-sc→
Initial Commitdc256bccd456b188d27829906b5ddfdaa2020a22
Final Commit10dfc32fb1f5a88ffd680e3226d9656108792a7b

Audit Summary

32Total Findings
31Resolved
0Accepted
1Mitigated

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

Documentation quality

  • The code is covered with NatSpecs.

  • Functional requirements are partially provided.

  • Technical description is presented.

Code quality

  • The code contains some duplications.

  • In general, the code is well-written and self descriptive.

  • The architecture is clean and transparent.

  • Development environment is set up.

Test coverage

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

  • Most of the usage scenarios are covered with tests.

System Overview

The system includes the following contracts.

  • MESI - the ERC-20 token contract with infinite mint ability. Name: MesiToken. Symbol: MESI.

  • Controller - the Governance contract allowing for admins voting on new admins add or remove. The contract also plays for a configuration purpose, the Treasury contract address is retrieved by other system parts from the Controller contract.

  • Treasury - the Treasury contract allowing Controller admins to create proposals of funds transfer (compatible with ERC-20 tokens). The contract is designed to receive funds earned during the presale and other funding activities.

  • Seller - the Presale contract allowing admin to specify Merkle Tree of users available for presale. Presale happens in two phases having different number of tokens allocated for presale and different prices. Presale amounts are limited at per user and per round basis.

  • Vesting - the Vesting contract allowing admin to specify Merkle Tree of users vesting the tokens. The vesting is performed linearly in several groups, groups may have different start dates but the same end date. The vesting length is limited to 260 weeks.

Privileged roles

  • The MESI contract owner is able to infinitely mint the token to arbitrary address.

  • The Controller contract admins are able to vote for the registered Treasury contract address update, new admins add or old admins removal.

  • The Controller contract admins are able to vote for funds transfer from the Treasury contract.

  • The Controller contract admins are able to update whitelisted purchasers, change purchase limits and prices in the Seller contract.

  • The Controller contract admins are able to create and modify vesting groups, execute pause or revoke with total funds withdrawal in the Vesting contract.

Risks

Centralized Control of Minting Process: The token contract’s design allows for centralized control over the minting process, posing a risk of unauthorized token issuance, potentially diluting the token value and undermining trust in the project's economic governance.

Lack of Vesting Funding Possibility: Merkle Tree is used in the Vesting contract to load all reward receivers data on-chain. While the functionality allows efficiently load significant amount of participants on-chain, it makes hard to validate if the contract is fully funded with the tokens and all vesters are able to claim their rewards.

Lack of Presale Funding Possibility: The Seller contract does not provide any guarantees on the funds allocated for presale are deposited to the contract.

Locked Vesting due to Merkle Tree Double Entry: The Vesting contract utilize Merkle Tree to specify vesters and their distribution amounts. Merkle Trees may contain same user several times what is not provided for by the contract. Users are able to withdraw only the biggest vesting registered in the Merkle Tree (vesting group).

Single Points of Failure and Control: The project is mostly centralized, introducing single points of failure and control. This centralization can lead to vulnerabilities in decision-making and operational processes, making the system more susceptible to targeted attacks or manipulation.

Flexibility and Risk in Contract Upgrades: The project's contracts are upgradable, allowing the administrator to update the contract logic at any time. While this provides flexibility in addressing issues and evolving the project, it also introduces risks if upgrade processes are not properly managed or secured, potentially allowing for unauthorized changes that could compromise the project's integrity and security.

Absence of Upgrade Window Constraints: The contract suite allows for immediate upgrades without a mandatory review or waiting period, increasing the risk of rapid deployment of malicious or flawed code, potentially compromising the system's integrity and user assets.

Findings

F-2024-5419Invalid Vesting Distributions due to Invalid Calculations
Status
fixed
Severity

High
F-2024-5398Treasury Funds Lock due to Lack of Safe ERC-20 Operation Success Validation
Status
fixed
Severity

High
F-2024-5395Unreliable Governance due to Lack of Request Expiration
Status
fixed
Severity

High
F-2024-5394Voting Bypass due to Lack of Grant Role Override
Status
fixed
Severity

High
F-2024-5435Distribution Amount Mismatch Bought Amount
Status
mitigated
Severity

Medium
F-2024-5455Misleading Overcomplicated Price Calculations
Status
fixed
Severity

Medium
F-2024-5418Unimplemented Action Point on Vote Rejection
Status
fixed
Severity

Medium
F-2024-5406Unexpected Request Rejection due to Lack of Validation
Status
fixed
Severity

Medium
F-2024-5390Unflexible Governance due to Immutable Number of Admin Confirmations
Status
fixed
Severity

Medium
F-2024-5412Insufficient Oracle Validation
Status
fixed
Severity

Low
Code
―
Title
Status
Severity
F-2024-5419Invalid Vesting Distributions due to Invalid Calculations
fixed

High
F-2024-5398Treasury Funds Lock due to Lack of Safe ERC-20 Operation Success Validation
fixed

High
F-2024-5395Unreliable Governance due to Lack of Request Expiration
fixed

High
F-2024-5394Voting Bypass due to Lack of Grant Role Override
fixed

High
F-2024-5435Distribution Amount Mismatch Bought Amount
mitigated

Medium
F-2024-5455Misleading Overcomplicated Price Calculations
fixed

Medium
F-2024-5418Unimplemented Action Point on Vote Rejection
fixed

Medium
F-2024-5406Unexpected Request Rejection due to Lack of Validation
fixed

Medium
F-2024-5390Unflexible Governance due to Immutable Number of Admin Confirmations
fixed

Medium
F-2024-5412Insufficient Oracle Validation
fixed

Low
1-10 of 32 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/BoostyLabs/mesi-sc→
Initial Commitdc256bccd456b188d27829906b5ddfdaa2020a22
Final Commit10dfc32fb1f5a88ffd680e3226d9656108792a7b
Whitepaperhttps://mesi-1.gitbook.io/whitepaper→
RequirementsNatSpec comments
Technical RequirementsREADME.md

Contracts in Scope

contracts
helpers
Errors.sol - contracts › helpers › Errors.sol
transparent
ProxyAdmin.sol - contracts › helpers › transparent › ProxyAdmin.sol
TransparentUpgradeableProxy.sol - contracts › helpers › transparent › TransparentUpgradeableProxy.sol
interfaces
IController.sol - contracts › interfaces › IController.sol
ISeller.sol - contracts › interfaces › ISeller.sol
ITreasury.sol - contracts › interfaces › ITreasury.sol
IVesting.sol - contracts › interfaces › IVesting.sol
Controller.sol - contracts › Controller.sol
MESI.sol - contracts › MESI.sol
Seller.sol - contracts › Seller.sol
Treasury.sol - contracts › Treasury.sol
Vesting.sol - contracts › Vesting.sol
Whitelist.sol - contracts › Whitelist.sol

Disclaimer