YFX-V3

CertiKFiles named in the report

CertiK reviewed YFX - (YFX-V3) on 7 Jul 2023: 46 findings, 0 critical; 36 marked fixed, 4 acknowledged, 6 open.

No open critical findings
Open the reportOpen YFX -’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings46

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High040
Medium007
Low6029
HighCentralization Related RisksAcknowledged

In the contract **FundingLogic**, the role **controller** has authority over the following functions: - function updateMaxFundingRate() - function updateMarketPriceFeed() Any compromise to the **controller** account may allow a hacker to take advantage of this authority and do the following(but not limited to). - Update max funding rate to any value and disrupt the funding rate calculation mechanism. - Update market price feed to a malicious contract and disrupt the funding rate calculation mechanism. --- In the contract **InterestLogic**, the role **controller** has authority over the following functions: - function updateRatePerHour() Any compromise to the **controller** account may allow a hacker to take advantage of this authority and do the following(but not limited to). - Update max hourly interest rate of any pool, and disrupt the borrow rate calculation mechanism. --- In the contract **InviteManager**, the role **controller** has authority over the following functions: - function setIsUTPPaused() - function setIsURPPaused() - function setTradeToken() - function setInviteToken() - function setTier() - function setReferrerTier() - function setCodeOwnerBySystem() Any compromise to the **controller** account may allow a hacker to take advantage of this authority and do the following(but not limited to). - Pause/Unpause the `UTP` mode, which controls whether or not to send `User Trading Proof Token` to traders. - Pause/Unpause the `URP` mode, which controls whether or not to send `User Referral Proof Token` to inviters. - Update the `User Trading Proof Token` to any new token. - Update the `User Referral Proof Token` to any new token. - Update the fee rebate and fee discount of an invitation level. - Update the invitation level of any inviter. A higher invitation level means a higher fee rebate for the inviter and a higher fee discount for the invitee. - Update the invitation code of an user. In the contract **InviteManager**, the role **router** has authority over the following functions: - function setTraderReferralCode() Under normal circumstances, the **router** should be the `Router` contract and this would not be a centralization issue. However, if the router is set up maliciously in `Manager` contract, this could lead to hackers being able to tamper with other trader's invitation relationships at will and profit from them. In the contract **InviteManager**, the role **market** has authority over the following functions: - function updateTradeValue() Under normal circumstances, the **market** should be the `Market` contract and this would not be a centralization issue. However, if the market is set up maliciously in `Manager` contract, this could lead to hackers being able to mint `TradeToken` and `InviteToken` at will and profit from them. --- In the contract **Manager**, the role **controller** has authority over the following functions: - function pause() - function unpause() - function modifyLiquidator() - function modifyTreasurer() - function modifyOrderNumLimit() - function modifyRouter() - function addSigner() - function removeSigner() - function modifyController() - function modifyRiskFunding() - function modifyInterestStatus() - function modifyFundingStatus() - function modifyVault() - function modifyExecuteOrderFee() - function modifyInviteManager() - function modifyCancelElapse() - function modifyCommunityExecuteOrderDelay() - function modifyTriggerOrderDuration() - function createPair() - function setMarketConfig() - function modifyMarketCreateOrderPaused() - function modifyMarketTPSLPricePaused() - function modifyMarketCreateTriggerOrderPaused() - function modifyMarketUpdateMarginPaused() Any compromise to the **controller** account may allow a hacker to take advantage of this authority and do the following(but not limited to). - Pause/Unpause the `YFX` protocol. - Update the liquidators who are entitled to liquidate. - Update the treasurers who are entitled to use the risk funds at will. If set up as a treasurer, the hacker can drain the risk funds. - Update the maximum number of orders. - Update the `Router` contract, which is a portal of all the user operations. - Add/Remove the signers who are entitled to provide the off-chain price and execute orders. If set up as a signer, the hacker can manipulate the price and get profits. - Update the controller who is the super admin of the `YFX` protocol. If set up as the controller, the hacker can do any thing mentioned in this section. - Update the `RiskFunding` contract, which is used to hold the risk funds. If set up as the risk funding contract, the hacker can receive the risk funds when liquidation happens. - Activate/Deactivate the interests module. - Activate/Deactivate the funding module. - Update the `Vault` contract, which is used to hold the market/pool assets. If set up as the vault contract, the hacker can steal the entire assets and ruin the `YFX` protocol. - Update the execute order fee, which is the gas f

HighMinting Centralization RiskAcknowledged

In the contract **TradeToken**, the role **inviteManager** has authority over the following function: - function mint() Under normal circumstances, the **inviteManager** should be the `InviteManager` contract and this would not be a centralization issue. However, if the `inviteManager` is set up maliciously in `Manager` contract, this could lead to hackers being able to mint `TradeToken` at will and profit from it.

HighPotential Trading Price Manipulation CentralizatiAcknowledged

The valuation of assets in the `YFX` market depends on two sources: firstly, the price of `ChainLink`, and secondly, the off-chain price. According to the logical framework of the `FastPriceFeed` and `MarketPriceFeed` contracts, it is understood that the final valuation of market assets is determined by selecting the maximum or minimum value between the `ChainLink` price and the off-chain price, based on the given scenario. The `ChainLink` price is obtained by accessing the `ChainLink` Price Feed contract, while the off-chain price is submitted as a function parameter value during the execution of orders by the `PriceProvider` role and during the liquidation process by the `Liquidator` role in the `FastPriceFeed` contract. In this situation, any compromise to the `Controller & PriceProvider`/ `Controller & Liquidator` accounts may provide an opportunity for a hacker to exploit this authority and engage in the following activities: - Invoking the `batchExecuteOrder()` function to execute opening/closing orders and submit forged market asset prices, thereby influencing the actual trade prices. - Invoking the `setPrices()` function will affect the trade prices. - Invoking the `liquidate()` function to initiate the liquidation process and submitting forged market asset prices, thereby affecting the liquidation price.

HighWithdrawal Centralization RiskAcknowledged

The `Vault` contracts stores all the deposits including liquidity pool assets and user position margins. Any compromise to the **controller** account may allow a hacker to take advantage of this authority and simply take all the deposits.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (20)

  • contracts/core/Vault.sol
  • contracts/core/Pool.sol
  • contracts/core/FundingLogic.sol
  • contracts/core/MarketStorage.sol
  • contracts/oracle/MarketPriceFeed.sol
  • contracts/oracle/PriceHelper.sol
  • contracts/libraries/MarketDataStructure.sol
  • contracts/token/TradeToken.sol
  • contracts/core/InterestLogic.sol
  • contracts/core/MarketLogic.sol
  • contracts/core/PoolStorage.sol
  • contracts/libraries/PoolDataStructure.sol
  • contracts/core/RiskFunding.sol
  • contracts/token/ERC20.sol
  • contracts/core/InviteManager.sol
  • contracts/core/Periphery.sol
  • contracts/core/Router.sol
  • contracts/oracle/FastPriceFeed.sol
  • contracts/core/Market.sol
  • contracts/core/Manager.sol

Part of YFX -’s security record

YFX -
Audits2 audits by 1 firmLast audit May 2024, by CertiK.
Critical findingsNo open critical findingsAcross 2 reports.
Open YFX -’s security record

Security firm

CertiK

1,044 projects reviewed · 1,375 reports · latest May 2025

See CertiK’s audits

Something wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.

Tell us