background
logo

Security Audit Report for Morph Emerald upgrade

專案簡介

The target of this audit is the code repositories ([1], [2]) of Morph Emerald upgrade.

The Morph Emerald upgrade introduces alternative fee transactions (i.e., AltFeeTx), enabling native multi-token gas payments on the Morph L2 chain. This upgrade allows users to pay gas fees using registered ERC-20 tokens. Specifically, this feature is enabled through the introduction of the L2TokenRegistry contract and corresponding modifications to the Geth codebase. The L2TokenRegistry contract allows managers to register fee tokens and update their associated parameters (e.g., token scale and exchange rate). On the Geth side, the project defines the AltFeeTx transaction type with two key parameters (i.e., FeeTokenID and FeeLimit) and implements the corresponding handling logic, including transaction creation, fee calculation, and fee transfer. Notably, the token information used during transaction processing is fetched directly from the L2TokenRegistry contract. In addition, the Emerald upgrade synchronizes recent Ethereum mainnet updates by introducing new precompiles and opcodes (e.g., CLZ).

Please refer to the report for the detailed audit scope.

Our audit methodology employs automated vulnerability scans, manual verification, and business logic analysis to uncover potential security issues coupled with gas and code quality optimization recommendations.

In summary, we have found that the codebase contains 1 high-risk issues that require prompt attention. In addition, we have identified other non-critical issues as well as security suggestions that should be considered. The Morph Emerald upgrade team has addressed these issues promptly. It is important to note that our audit covers only the final reported versions of the codebase. Any subsequent updates would require a re-evaluation.

關鍵發現

我們在該智能合約中共發現 4 個潛在問題,另有 7 條建議與 4 條說明,明細如下:

高風險:1
中風險:1
低風險:2
建議:7
說明:4
ID Severity Description Status
1 High Incorrect access control logic in the modifier onlyAllowed Fixed
2 Medium Inconsistent updates of the price ratio and token scale Fixed
3 Low Lack of the value assignment for FeeLimit in the CallArgs construction Fixed
4 Low The misleading return value of the function getTokenInfo() Fixed
5 - Revise the unused function Filter() Confirmed
6 - Remove redundant code Fixed
7 - Add non-zero checks Fixed
8 - Revise the improper error in the function calculateTokenAmount() Fixed
9 - Revise typos and improper annotations Fixed
10 - Unify the existence checks for the balance slot Fixed
11 - Use different custom errors for different revert conditions Fixed
12 - Ensure the correctness of fee tokens -
13 - Potential centralization risks -
14 - Openzeppelin upgrade migration risks -
15 - Correct handling of the fee tokens in the contract L2TxFeeVault -

更多細節見審計報告

邁出走向安全的第一步

立即聯絡我們,獲取 BlockSec 的專業程式碼審計服務,在協議上線之前把安全性提上來!

Security Audit Report for Morph Emerald upgrade - BlockSec