CertiK reviewed Derify protocol (Derify protocol Ⅱ) on 16 Sep 2022: 22 findings, 0 critical; 11 marked fixed, 8 acknowledged, 3 open.
Report hosted on skynet.certik.com.
Trustblock does not review code.
Statuses are the security firm’s own, from its report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 0 |
| High | 0 | 8 | 0 |
| Medium | 1 | 0 | 1 |
| Low | 2 | 0 | 10 |
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.
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.
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.
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.
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.
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.  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. 
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.  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.
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.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (19)
1,044 projects reviewed · 1,375 reports · latest May 2025
See CertiK’s auditsSomething 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