Mey Network Info
Mey Network is an integrated blockchain ecosystem designed to bridge the gap between physical assets and the digital world. By combining the power of Meychain—a dedicated Layer 1 blockchain for Real-World Assets (RWAs)—and MeyFi, our decentralized nance platform, Mey Network enables seamless tokenization, trading, and management of assets in a secure, scalable environment.
TrustNet Score
The TrustNet Score evaluates crypto projects based on audit results, security, KYC verification, and social media presence. This score offers a quick, transparent view of a project's credibility, helping users make informed decisions in the Web3 space.
Real-Time Threat Detection
Real-time threat detection, powered by Cyvers.io,
is currently not
activated
for this project.
This advanced feature provides continuous monitoring and instant alerts to safeguard your assets from potential security threats. Real-time detection enhances your project's security by proactively identifying and mitigating risks.
For more information, click here.
Security Assessments
Summary and Final Words
No crucial issues found
The contract does not contain issues of high or medium criticality. This means that no known vulnerabilities were found in the source code.
Contract owner cannot mint
It is not possible to mint new tokens.
Contract owner cannot blacklist addresses.
It is not possible to lock user funds by blacklisting addresses.
Contract owner cannot set high fees
The fees, if applicable, can be a maximum of 25% or lower. The contract can therefore not be locked. Please take a look in the comment section for more details.
Token transfer can be locked
Owner can lock user funds with owner functions.
Token cannot be burned
There is no burning within the contract without any allowances
Ownership is not renounced
The owner retains significant control, which could potentially be used to modify key contract parameters.
Contract is upgradeable
The contract uses a proxy pattern or similar mechanism, enabling future upgrades. This can introduce risks if the upgrade mechanism is not securely managed.
Scope of Work
This audit encompasses the evaluation of the files listed below, each verified with a SHA-1 Hash. The team referenced above has provided the necessary files for assessment.
The auditing process consists of the following systematic steps:
- Specification Review: Analyze the provided specifications, source code, and instructions to fully understand the smart contract's size, scope, and functionality.
- Manual Code Examination: Conduct a thorough line-by-line review of the source code to identify potential vulnerabilities and areas for improvement.
- Specification Alignment: Ensure that the code accurately implements the provided specifications and intended functionalities.
- Test Coverage Assessment: Evaluate the extent and effectiveness of test cases in covering the codebase, identifying any gaps in testing.
- Symbolic Execution: Analyze the smart contract to determine how various inputs affect execution paths, identifying potential edge cases and vulnerabilities.
- Best Practices Evaluation: Assess the smart contracts against established industry and academic best practices to enhance efficiency, maintainability, and security.
- Actionable Recommendations: Provide detailed, specific, and actionable steps to secure and optimize the smart contracts.
A file with a different Hash has been intentionally or otherwise modified after the security review. A different Hash may indicate a changed condition or potential vulnerability that was not within the scope of this review.
Final Words
The following provides a concise summary of the audit report, accompanied by insightful comments from the auditor. This overview captures the key findings and observations, offering valuable context and clarity.
Ownership Privileges
P2PLending.sol
- The owner can set the boosted APY for a specific tier.
- The owner can update the whitelistBoostAPY value in the contract.
- The owner can update any arbitrary value in the minimum holding period.
- The owner can withdraw tokens from the contract.
- The owner can withdraw ETH from the contract.
- The owner can update the funding cap and funding open time.
- The owner can update the start time and end time.
- The owner can update the base APY value.
- The owner can update the USDT and reward token contract. aaddress.
- The owner can update the boosted APY whitelist contract address.
- The owner can update the user contract mapping contract address.
- The owner can update the contract address for the staking tier manager.
Note—This Audit report consists of a security analysis of the Mey Network P2P Lending smart contract. This analysis did not include functional testing (or unit testing) of the contract’s logic. Moreover, we only audited one token contract for the Mey Network team. Our team did not audit other contracts associated with the project. We recommend investors do their own research before investing.
Files and details
Findings and Audit result
high Issues | 2 findings
Pending
#1 high Issue
No Protection Against Flash Loan Exploits
The fundLoan function is vulnerable to flash loan exploits, where attackers borrow large amounts of USDT, temporarily inflate metrics like totalLentAmount or totalLenders, claim rewards or bonuses, and repay the flash loan within the same transaction. This exploit leads to economic losses, manipulation of system metrics, and unfair advantage for the attacker, while legitimate lenders are deprived of rightful benefits. Key vulnerabilities include the lack of time constraints on funds, absence of verification for the origin of funds, and reliance on instantaneous metrics for reward calculations. To mitigate these risks, the contract can enforce a minimum lock-in period for funds, verify fund sources to prevent flash loan usage, and adjust reward mechanisms to rely on time-weighted metrics. Additional strategies include whitelisting deposits, imposing penalties for early withdrawals.
Acknowledged
#2 high Issue
No Validation Against Current operations
The function does not check whether _startTime or _endtime is consistent with the current state of the lending process. Changing startTime during an active funding phase could disrupt operations, creating confusion about when funding or rewards begin. Moreover, arbitrarily extending or shortening the end time can affect user rewards and the ability to withdraw funds. Allowing unrestricted mid-lending changes to startTime and endTime introduces risks of exploitation, operational disruptions, and user dissatisfaction. Adding validation, restrictions, and governance mechanisms can prevent misuse and maintain trust.
medium Issues | 12 findings
Acknowledged
#1 medium Issue
Lack of Validation for Input APY
There is no validation to ensure the _boostedAPY value is within a reasonable range. The _boostedAPY can be set to an excessively high value (e.g., 10^18 basis points), resulting in an unrealistic APY calculation. This would significantly inflate rewards and potentially drain the reward pool or lead to erroneous payouts. To mitigate this, Add a maximum cap for _boostedAPY to prevent excessively high values.
Acknowledged
#2 medium Issue
Missing limits for whitelistBoostAPY
The setWhitelistBoostAPY function lacks a limit on the whitelistBoostAPY value, which directly affects reward calculations in the calculateReward function. Without constraints, an excessively high whitelistBoostAPY can result in inflated rewards, potentially draining the reward pool or rendering the system economically unviable. For instance, if whitelistBoostAPY is set to an extreme value like 10^18, even small loans can yield unrealistically high rewards, disproportionately benefiting whitelisted users. Additionally, large APY values can cause arithmetic overflows in the reward calculation formula, leading to transaction reverts or undefined behavior. To address these issues, it’s essential to introduce a maximum cap for whitelistBoostAPY (e.g., 10%), validate inputs to ensure realistic values, and conduct thorough audits to prevent potential exploits. By implementing these safeguards, the system can maintain fairness, economic stability, and robust reward distribution without risking the reward pool’s integrity or creating imbalances.
Acknowledged
#3 medium Issue
Missing Allowance Check
The function directly calls usdtToken.transferFrom() without checking if the lender has approved sufficient USDT allowance to the contract. If the allowance is insufficient, transferFrom() will fail, reverting the entire transaction. While this won’t cause a security issue, it results in a poor user experience with no specific error message. Add an explicit check before the transfer that the contract has sufficient allowance.
Acknowledged
#4 medium Issue
Missing Non-reentrant check.
The contract contains the functionality in which the withdraw function makes an external call to transfer ERC20 tokens using the transfer function. Since the contract hasn't yet marked the claim as completed (i.e., updated the claimed variable), the attacker can exploit this to re-enter the claim function, repeatedly withdrawing tokens. The transfer happens first (interaction with an external contract) before the internal state is updated. The nonReentrant modifier ensures that any attempts to call the claim function again during execution are blocked, providing an additional safeguard. Therefore, It is recommended to do the check-effect-transaction method or use the non-reentrant modifier to prevent the code from this issue.
Acknowledged
#5 medium Issue
Unlimited Reward Calculation Potentially Drains Tokens
The withdrawByLender function faces a significant issue due to the absence of limits on APY values used for reward calculations. If the APY is set to excessively high levels through misconfiguration or intentional misuse (e.g., 10,000%), the calculated rewards can exponentially increase, potentially draining the rewardsToken supply. For instance, a 10,000% APY on a 1,000 USDT loan results in an equal reward, doubling the payout. This issue can deplete the token pool with multiple users or large loan amounts. Implementing APY caps, validating configurations, and enforcing maximum reward limits are critical to preventing this exploit and ensuring sustainability.
Acknowledged
#6 medium Issue
The owner can drain tokens.
The emergencyWithdrawERC20 function allows the owner to drain USDT and reward tokens from the contract, posing severe risks to users and the project. If misused, lenders may lose their loaned funds and rewards, leading to financial losses and breaches of trust. Token draining can crash the market value of reward tokens and trigger legal or regulatory actions due to perceived fraud. To mitigate this risk, the contract should restrict token types, enforce withdrawal limits, use multisig approval, and involve community governance for emergency actions, ensuring transparency and preventing misuse while maintaining user trust and the platform’s integrity.
Acknowledged
#7 medium Issue
Missing limits for funding cap.
The setFundingCap function lacks safeguards, allowing the funding cap to be set to zero or excessively high values, causing significant risks. A zero cap halts loan funding, frustrating users and halting platform operations. An extremely high cap risks locking excessive funds, creating reward allocation issues, and attracting exploitation attempts. Without limits, the platform may overpromise rewards or mismanage funds. To prevent these issues, enforce minimum and maximum funding caps, align the cap with the platform’s capacity, and require governance or multisig approval for updates. These measures ensure responsible funding cap adjustments and maintain platform stability and user trust.
Acknowledged
#8 medium Issue
Missing check for past Timestamp
The function allows the owner to set fundingOpenTime to a past timestamp. If set to a past time, the contract may enter an unintended state where funding appears to have started before users can interact with it, causing user confusion and potential functionality issues. Also, there are no checks to ensure the fundingOpenTime is before the funding period’s startTime. If fundingOpenTime is set after startTime, users cannot fund loans as the condition in fundLoan will fail. Adding timestamp checks and governance mechanisms will ensure responsible updates and maintain trust.
Acknowledged
#9 medium Issue
Missing limits for baseAPY
The unrestricted setBaseAPY function allows the owner to set zero or excessively high values, leading to significant issues. A zero baseAPY results in no rewards for lenders, causing dissatisfaction and platform abandonment. Conversely, an excessively high baseAPY inflates rewards unsustainably, draining token reserves, destabilizing tokenomics, and inviting exploitation. These scenarios undermine trust, disrupt economic balance, and jeopardize platform sustainability. Mitigations include setting reasonable limits on baseAPY, requiring governance or multisig approval for changes, and logging updates for transparency. These measures protect platform integrity, ensure fair rewards, and maintain user trust and long-term sustainability.
Acknowledged
#10 medium Issue
Missing 'isContract' check.
The contract lacks a validation check to ensure that specific parameters are contract addresses. Without this check, there is a risk that non-contract addresses (such as externally owned accounts, or EOAs) could be mistakenly set for parameters intended to reference other contracts. This could lead to failures in executing critical interactions within the contract, as EOAs do not support contract-specific functions. To mitigate this, Implement a validation check to ensure that parameters designated as contract addresses are verified as such. This can be done using Solidity’s Address library function isContract, which checks if an address has associated contract code.
Acknowledged
#11 medium Issue
Unrestricted Contract Address Updates During Lending Period
The ability to update critical contract addresses (e.g., usdtToken, rewardsToken, or external dependencies) mid-lending creates operational and security risks. Such changes can disrupt functionality, leading to failed transfers, incorrect reward distribution, or data inconsistencies. Malicious or incompatible contracts could be introduced, exposing the system to exploitation or manipulation, such as siphoning funds or altering APY calculations. Additionally, loan and reward mapping might break, invalidating ongoing operations and impacting user trust. To mitigate these risks, address updates should be restricted during active lending periods, require governance or multisig approval, and undergo strict validation to ensure platform stability and integrity.
Pending
#12 medium Issue
Missing threshold for minimum holding period
The minHoldingPeriod is implemented in the fundLoan function, but there is no proper enforcement of restrictions. The owner can also set the minimum holding period to any arbitrary value in the contract. There must be a restriction so that the max threshold for a minimum holding period must be present in the contract.
low Issues | 3 findings
Acknowledged
#1 low Issue
Floating pragma solidity version
Adding the constant version of solidity is recommended, as this prevents the unintentional deployment of a contract with an outdated compiler that contains unresolved bugs.
Acknowledged
#2 low Issue
Missing zero check for loan amount
It is recommended to check that the value should be greater than zero.
Acknowledged
#3 low Issue
Missing events arithmetic
It is recommended to emit critical parameter changes.