DEFED

CertiKFiles named in the report

CertiK reviewed DEFED on 18 Oct 2022: 22 findings, 0 critical; 7 marked fixed, 5 acknowledged, 10 open.

No open critical findings
Open the reportOpen DEFED’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
High021
Medium031
Low1005
LowAccounts Management in `AssetManagement`Open

The account information is not recorded in the contract `AssetManagement`, we assume that the project might query events and maintain the accounts in their own server. This part is not public to the users.

LowApprove after transfer in function `transferFrom(Open

The function `_approve()` is after the function `_transfer()`. It's recommended to move the function `_approve()` in front of the `_transfer` step to check early and revert in time to save gas when the allowance is not enough.

LowFunds Flow ControlOpen

The part of logic is hidden in the interactions with third-party protocols or centralized manipulation. For example, function `transferToEthereum()` has no permission control, we assume that there is no `vToken` stuck in the contract. So if the user wants to transfer to Ethereum, he/she needs to transfer `vToken` to the contract first. And how will the remainder of the cross-chain transfer be completed. If no `vToken` can be left in the contract, each external call must spend all of the minted tokens. The team should ensure that the control process is reliable and complete.

LowImproper Usage of `public` and `external` TypeOpen

`public` functions that are never called by the contract could be declared as `external`. `external` functions are more efficient than `public` functions.

LowIncompatibility With Deflationary TokensOpen

The amount recorded in the events of the functions may be inconsistent with the actual amount. The contract `AssetManagement` does not support deflationary tokens. And adapting deflationary coins with non-deflationary `vToken` may be problematic.

LowSimilar FunctionsOpen

The function `deposit()` and `depositForRepay()` are totally the same, except the event and error message. We would like to confirm with the client whether there is need to distinguish the two functions and if the functions can be merged. The same case exists between function `depositETHForRepay()` and `depositETH()`.

LowState Variable Should Be Declared ConstantOpen

State variables that never change should be declared as `constant` to save gas. ```solidity=43 uint256 public lastTokenId; ``` - `lastTokenId` should be declared `constant`.

LowThird Party DependenciesOpen

The contracts are serving as the underlying entity to interact with third-party `BANKCARDNFT`, `bridgeFeeController`, `lendingPool`, `virtualDefedToken`, `FlashSwapCallee`, `IVeDEFE` protocols. The scope of the audit treats 3rd party entities as black boxes and assumes their functional correctness. However, in the real world, 3rd parties can be compromised and this may lead to lost or stolen assets. In addition, upgrades of 3rd parties can possibly create severe impacts, such as increasing fees of 3rd parties, migrating to new LP pools, etc.

LowUnused Return ValueOpen

The return value of an external call is not stored in a local or state variable. ```solidity=85 IERC20(vToken).approve(lendingPool,amount); ``` --- ```solidity=101 IERC20(vToken).approve(lendingPool,amount); ``` --- ```solidity=102 ILendingPool(lendingPool).repay(vToken, amount,rateMode,proxyAddr); ``` --- ```solidity=137 IERC20(virtualDefedToken).approve(veDEFE,amount); ``` --- ```solidity=61 ILendingPool(params.lendingPool).withdraw(vToken,amount,params.bridgeControl); ``` --- ```solidity=101 IERC20(vToken).approve(params.lendingPool,targetAmount); ``` --- ```solidity=118 ILendingPool(params.lendingPool).withdraw(vToken,fee,networkFeeVault); ``` --- ```solidity=135 ILendingPool(params.lendingPool).withdraw(vToken,amount,params.bridgeControl); ``` --- ```solidity=160 IERC20(vToken).approve(params.lendingPool,targetAmount); ``` --- ```solidity=192 ILendingPool(params.lendingPool).withdraw(vToken,amount,address(this)); ``` --- ```solidity=199 ILendingPool(params.lendingPool).repay(vToken, targetAmount,rateMode,address(this)); ```

LowVariables That Could Be Declared as ImmutableOpen

The linked variables assigned in the constructor can be declared as `immutable`. Immutable state variables can be assigned during contract creation but will remain constant throughout the lifetime of a deployed contract. A big advantage of immutable variables is that reading them is significantly cheaper than reading from regular state variables since they will not be stored in storage.

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/Defed/interfaces/IVToken.sol
  • contracts/Defed/interfaces/IVTokenFactory.sol
  • contracts/Defed/VToken.sol
  • contracts/Defed/interfaces/IUserProxyFactory.sol
  • contracts/Defed/interfaces/IBridgeFeeController.sol
  • contracts/Defed/interfaces/IFlashSwapCallee.sol
  • contracts/Defed/UserProxy.sol
  • contracts/Defed/AssetManagement.sol
  • contracts/Defed/DefeToken.sol
  • contracts/Defed/interfaces/IERC20.sol
  • contracts/Defed/interfaces/INetworkFeeController.sol
  • contracts/Defed/VTokenFactory.sol
  • contracts/Defed/interfaces/IUserProxy.sol
  • contracts/Defed/interfaces/ITokenController.sol
  • contracts/Defed/interfaces/IIncentivesController.sol
  • contracts/Defed/interfaces/ILendingPool.sol
  • contracts/Defed/BridgeControl.sol
  • contracts/Defed/TokenController.sol
  • contracts/Defed/UserProxyFactory.sol
  • contracts/Defed/interfaces/IBridgeControl.sol

Part of DEFED’s security record

DEFED
Audits1 audit by 1 firmLast audit Oct 2022, by CertiK.
Critical findingsNo open critical findingsIn 1 report.
Open DEFED’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