Derify protocol Ⅱ

CertiKFiles named in the report

CertiK reviewed Derify protocol (Derify protocol Ⅱ) on 16 Sep 2022: 22 findings, 0 critical; 11 marked fixed, 8 acknowledged, 3 open.

No open critical findings
Open the reportOpen Derify protocol’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings22

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

SeverityOpenAcknowledgedFixed
Critical000
High080
Medium101
Low2010
High`gasFee` decided by parameter in function `updateAcknowledged

In the contract `DerifyBroker`, the owner can call function `updateDrfReward()` to release drf rewards to the brokers. At the same time, the gas fee will be taken from the brokers' accounts. However, the gas fee is decided by the parameter `gasFeeAmounts`, which means that the owner can decide how much usd will be withdrawn from the broker account to cover the gas fee. There is no limit to the process, if the owner makes a mistake or the account has been hacked, the broker can only endure the unfair result.

HighCentralization Related Risks in DerifyClearing.soAcknowledged

In the contract `DerifyClearing`, the role `owner` has authority over the following functions: - function updateParams(), to change params for the contract. The role `PAUSER_ROLE` has authority over the following functions: - function pause() and unpause(), to set pause status for the contract. The role `EXECUTOR_ROLE` has authority over the following functions: - function withdrawReward(), to claim rewards from the contract. - function operateOrderedPositions(), operateOrderedPositionsSinglePair() and to operate ordered positions. - function operateBothLiquidations(), operatePartialLiquidation() and operateLiquidation(), to operate liquidation. - function operateOrderedLimitPositionsSinglePair(), operateSideOrderedStopPositionsSinglePair(), to operate order limit positions and side ordered stop positions. The role can charge `estimateGasFee` which is decided by the parameter. AND In the contract `AccesscontrolEmuerable` which is the parent contract of the contract `DerifyClearing`, the role `role_admin` has authority over the following functions: - function grantRole() and revokeRole(), to grant roles to or revoke roles from the users. - Any compromise to the privileged accounts may allow a hacker to take advantage of this authority and bring unpredictable damages to the project.

HighCentralization Related Risks in DerifyDerivative.Acknowledged

In the contract `DerifyDerivative`, the role `DEFAULT_ADMIN_ROLE` has authority over the following functions: - function initialize(), to change many sensitive state variables at any time. The role `CALLER_ROLE` has authority over the following functions: - function openMarketPricePosition(), to open position for the user. - function orderLimitPricePosition(), to order limit price positions. - function closePositinoByTrader(), to close positions. - function closePositionByLiquidation(), to close position in the liquidation way. - function closeDerivativePositions(), to close positions. - function cancleDerivativeOrderedPositions(), to cancel limit price position orders. - function deleteOrderedLimitPositions(), to delete limit price positions. - function removeTrader(), to remove a trader's info. AND In the contract `AccesscontrolEmuerable` which is the parent contract of the contract `DerifyDerivative`, the role `role_admin` has authority over the following functions: - function grantRole() and revokeRole(), to grant roles to or revoke roles from the users. - Any compromise to the privileged accounts may allow a hacker to take advantage of this authority and bring unpredictable damages to the project.

HighCentralization Related Risks in DerifyExchange.soAcknowledged

In the contract `DerifyExchange`, the role `owner` has authority over the following functions: - function initialize(), to initialize the contract. The role `FEE_ROLE` has authority over the following functions: - function operateTraderBalance(), to operate the trader's balance. - function operateTradingFee(), to operate trading fee for the user. The role `REWARD_ROLE` has authority over the following functions: - function exchangeBondByInsurance(), to redeem usd with bond. The role `CLEARING_ROLE` has authority over the following functions: - function transferPoolFrom(), to process the pool balance. - function removeTrader(), to remove the trader. The role `BUYBACK_ROLE` has authority over the following functions: - function buyBackDrf(), to buy back drf with usd. The role `PAUSER_ROLE` has authority over the following functions: - function pause() and unpause(), to change the pause status for the contract. AND In the contract `AccesscontrolEmuerable` which is the parent contract of the contract `DerifyExchange`, the role `role_admin` has authority over the following functions: - function grantRole() and revokeRole(), to grant roles to or revoke roles from the users. - Any compromise to the privileged accounts may allow a hacker to take advantage of this authority and bring unpredictable damages to the project.

HighCentralization Related Risks in DerifyRewards.solAcknowledged

In the contract `DerifyRewards`, the role `owner` has authority over the following functions: - function initialize(), to initialize the contract. - function updateTradersPositionReward(), to update position rewards for the users. The role `PAUSER_ROLE` has authority over the following functions: - function pause() and unpause(), to set pause status for the contract. The role `EXCHANGE_ROLE` has authority over the following functions: - function payBond(), to add bond tokens for the users. AND In the contract `Accesscontrol` which is the parent contract of the contract `DerifyRewards`, the role `role_admin` has authority over the following functions: - function grantRole() and revokeRole(), to grant roles to or revoke roles from the users. Any compromise to the `[fixme]` account may allow a hacker to take advantage of this authority and bring unpredictable damages to the project.

HighCentralization Risks in bDRF.sol and eDRF.solAcknowledged

In the contract `eDRF` the role `_owner` has authority over the functions shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and bring unpredictable damages to the project. ![](https://accelerator-tasks-prod.acc.corp.certik.com/429e12c60d8b4ac89949be93e3cf7423/diagrams/centralization_eDRF__owner.svg) In the contract `bDRF` the role `_owner` has authority over the functions shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and bring unpredictable damages to the project. ![](https://accelerator-tasks-prod.acc.corp.certik.com/429e12c60d8b4ac89949be93e3cf7423/diagrams/centralization_bDRF__owner.svg)

HighCentralization Risks in DerifyBroker.solAcknowledged

In the contract `DerifyBroker` the role `_owner` has authority over the functions shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and bring unpredictable damages to the project. ![](https://accelerator-tasks-prod.acc.corp.certik.com/429e12c60d8b4ac89949be93e3cf7423/diagrams/centralization_DerifyBroker__owner.svg) The role `PAUSER_ROLE` has authority over following functions: - function pause() and unpause(), to change the pause status of the contract. The role `EXCHANGE_ROLE` has authority over following functions: - function addBrokerReward(), to add usd rewards for brokers. Any compromises to the `PAUSER_ROLE` and `EXCHANGE_ROLE` accounts may allow the hacker to take advantage of this authority and bring unpredictable damages to the project. In the parent contract `AccessControl`, the role `ADMIN_ROLE`(ROLES' admin roles) has authority over the following functions: - function grantRole() and revokeRole(), to grant roles to or revoke roles from the users. Any compromises to the `ADMIN_ROLE` accounts may allow the hacker to take advantage of this authority and bring unpredictable damages to the project.

HighestimateGasFee determined by parameterAcknowledged

The issue is similar to the situation where the owner updates brokers' rewards and takes fees. According to the white paper, the `clearing` role may be public to the users. We understand that the project needs to make the clearing public to users and allow them to arbitrage to trigger clearing and processing limit price positions. But if there is no way to limit the amount of the fee within the project, users' assets are also at risk of arbitrary charges.

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 (19)

  • contracts/libraries/DerifyMath.sol
  • contracts/DerifyRewards.sol
  • contracts/interfaces/IDerifyClearing.sol
  • contracts/DerifyDerivative.sol
  • contracts/DerifyClearing.sol
  • contracts/interfaces/IDerifyBroker.sol
  • contracts/tokens/eDRF.sol
  • contracts/DerifyBroker.sol
  • contracts/interfaces/IDerifyExchange.sol
  • contracts/libraries/DerifyHelper.sol
  • contracts/interfaces/IDerifyRewards.sol
  • contracts/tokens/bDRF.sol
  • contracts/interfaces/IDerifyFactory.sol
  • contracts/DerifyExchange.sol
  • contracts/interfaces/IDerifyDerivative.sol
  • contracts/DerifyFactory.sol
  • contracts/libraries/DerifyExchangeHelper.sol
  • contracts/interfaces/IDerifyERC20.sol
  • contracts/Migrations.sol

Part of Derify protocol’s security record

Derify protocol
Audits3 audits by 1 firmLast audit Dec 2023, by CertiK.
Critical findingsNo open critical findingsAcross 3 reports.
Open Derify protocol’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