We express our gratitude to the Muhdo Hub team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
Muhdo is AI-driven health ecosystem empowers you to stake, earn, and access tailored wellness products based on your unique genetic makeup.
Document
Review Scope
The system users should acknowledge all the risks summed up in the risks section of the report
Functional requirements are not provided.
Technical description is not provided.
The code contains some gas-inefficient usages.
The development environment is not configured.
Code coverage of the project is 0% (branch coverage) as no tests were provided.
Mundi Hub is an ERC20 token contract with the following contracts:
muhdo-token — DNA contract that is a custom ERC20 implementation that provides a token named "Muhdo Hub" with the symbol "DNA". It includes standard ERC20 functionalities alongside additional features for liquidity management, transaction taxes, and trading restrictions.
Transaction Tax Mechanism:
A buy tax and sell tax, both initially set to 5%, are applied to transactions involving the Uniswap pair:
Buy tax: Applies when tokens are bought via the Uniswap pool.
Sell tax: Applies when tokens are sold back to the Uniswap pool.
Tax proceeds are stored in the contract itself and can be swapped for ETH via the function swapTokensForEth
.
Liquidity Management:
Liquidity Addition: The owner can enable trading by calling enableTrading
, which:
Sets up the Uniswap pair for the token and WETH.
Adds liquidity to the Uniswap pool using the owner’s tokens and ETH provided in the transaction.
Liquidity Removal: The owner can remove ETH from the contract using removeETH
.
Trading Restrictions:
Includes limits on transactions and wallet balances:
_maxTxn
: Limits the maximum amount that can be transferred in a single transaction (1% of the total supply initially).
_maxWallet
: Limits the maximum token balance a wallet can hold (1% of the total supply initially).
The owner of the muhdo-token contract can:
remove the _maxTxn
and _maxWallet
limits
update excluded addresses
reduce the taxes
enable trading
renounce ownership
transfer ownership
This contract is restricted to the Ethereum network due to the hardcoded address of the UniswapV2Router02
, limiting its functionality on other EVM-compatible chains.
If renounceOwnership()
is called accidentally, the contract will become ownerless. This creates a significant risk as the contract would no longer have any administrative oversight.
Code ― | Title | Status | Severity | |
---|---|---|---|---|
F-2024-7781 | Hardcoded Slippage Values(0) in Uniswap Swap Functions | Accepted | Medium | |
F-2024-7784 | Use Of transfer or send Instead Of call To Send Native Assets | Fixed | Low | |
F-2024-7782 | Interactions With AMMs Do Not Use Deadlines For Operations | Accepted | Low | |
F-2024-7797 | Replace Ownable with Ownable2Step for Safer Ownership Transfers | Accepted | Observation | |
F-2024-7788 | Custom Errors in Solidity for Gas Efficiency | Accepted | Observation | |
F-2024-7785 | Use increaseAllowance()/decreaseAllowance() Instead Of approve()/safeApprove() | Accepted | Observation | |
F-2024-7796 | Typographical Errors in Function and Event Names | Fixed | Observation | |
F-2024-7791 | Public Functions Not Called Internally Should Be Declared External | Fixed | Observation | |
F-2024-7790 | Unneeded Initializations Of Integer Variable To 0. | Accepted | Observation | |
F-2024-7789 | Unnecessary Initialization of Boolean Variables to false | Fixed | Observation |
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
Severity
Description
Severity
Description
Severity
Description
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.
The scope of the project includes the following smart contracts from the provided repository:
Scope Details
muhdo-token.sol
During the audit of Muhdo Hub, 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, 3 invariants were tested over 50,000 runs. This thorough testing ensured that the system works correctly even with unexpected or unusual inputs.
Invariant
Test Result
Run Count
Invariant
Test Result
Run Count
Invariant
Test Result
Run Count
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.