background
logo

Security Audit Report for HertzFlow's Perp Contracts

개요

The target of this audit is the private code repository of Perp Contracts of HertzFlow. The Perp Contracts of HertzFlow is a perpetual exchange forked from GMX Synthetics v2.3-branch. It implements the Zero Funding Position (i.e., ZFP) feature, enabling ultra high leverage trading (e.g., 75x to 555x). Unlike normal positions that charge position fees, ZFP positions replace fees with a kink model profit extraction mechanism where the protocol takes a portion of profits based on ROI tiers, with higher ROI yielding more favorable user keep ratios. To support the ZFP feature safely, the project introduces several mechanisms. Specifically, a collateral range check (i.e., willBeSufficient and willBeTooMuch) is implemented for all ZFP positions to ensure their validity after the corresponding operations (e.g., position decrease). Additionally, an Early Force Liquidation (i.e., EFL) feature is implemented to forcibly close positions with excessive profits to protect liquidity providers.

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 3 high-risk issues that require prompt attention. In addition, we have identified other non-critical issues as well as recommendations and notes that should be considered. The Perp Contracts 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.

주요 발견 사항

스마트 컨트랙트에서 잠재적인 문제 5건을 발견했습니다. 권고 사항 2건과 참고 사항 7건도 함께 정리했습니다.

높은 위험도 3건
중간 위험도 2건
낮은 위험도 0건
권고 사항 2건
참고 사항 7건
ID Severity Description Status
1 High ZFP position fee circumvention due to the ROI manipulation Fixed
2 High Insufficient collateral checks for ZFP positions in the IncreasePositionUtils contract Fixed
3 High Lack of availability checks for ZFPrelated orders during order executions Fixed
4 Medium Incorrect ZFP position-size checks in the function decreaseZFPPosition() Fixed
5 Medium Ineffective validations for ZFP-specific configurations in the validateRange() function Fixed
6 - Revise the insufficient range checks in the function validateRange() Confirmed
7 - Revise the market token symbol Fixed
8 - Proper position size delta configuration when applying ADL operations to ZFP positions -
9 - Proper priority between EFL and ADL operations -
10 - Risks for supporting RWA and commodity markets -
11 - Potential HLV price inflation due to EFL operations -
12 - Ensure gasless order creation entry points are disabled -
13 - Potential centralization risks -
14 - Deprecated modules and logic -

자세한 내용은 감사 보고서에서 확인할 수 있습니다.

더 안전한 프로토콜을 위한 첫걸음

출시 전에 프로토콜 보안을 강화하세요. BlockSec의 전문 코드 감사팀에 문의하시면 됩니다.

Security Audit Report for HertzFlow's Perp Contracts - BlockSec