dForce

QuantstampFiles named in the report

Quantstamp reviewed dForce on 15 Dec 2020: 12 findings, 0 critical; 1 marked fixed, 11 acknowledged.

No open critical findings
Open the reportOpen dForce’s security record

Report hosted on certificate.quantstamp.com.

Trustblock does not review code.

Findings12

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

SeverityOpenAcknowledgedFixed
Critical000
High000
Medium031
Low080
MediumFee Recipient UpdateAcknowledged

When updating the interest provider in `USR.updateInterestProvider` the inherited fee recipient from `Chargeable` is not updated. (The address might be the same, however, nothing guarantees it.) Please note that in `USR.initialize` the fee recipient address it taken from `IInterestProvider(_interestProvider).funds()` which is not done inside `updateInterestProvider` when updating the provider.

MediumPool MigrationAcknowledged

The check in lines 203-206 implemented in `migrateOldPool()` assumes the new contract does not hold any token balance, when tokens can be sent to the contract. The usage of such strict equality can deny access to that specific function.

MediumTokens that add rewards or take fees may lead to DoSAcknowledged

Some functions make implicit assumptions that tokens remain constant in their supply during transactions. There exist tokens that add rewards or add fees, and hence their supply does not have to stay constant. We identified the following problematic pieces of code: * In `DFCollateral.sol`: line 18, * In `DFFunds.sol`: line 18, * In `DFPool.sol`: lines 23, 35, 47, 59, * In `DFPoolV2.sol`: lines 29, 41, 59, 77, 187, 203, * In `DFEngineV2.sol`: functions `deposit()` and `withdraw()`. Also the function `checkUSDXTotalAndColTotal()` in line 329; consequently all other operations that rely on it would fail.

LowAllowance Double-Spend ExploitAcknowledged

As it presently is constructed, the contract is vulnerable to the [allowance double-spend exploit](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/b4f87bb8fc25fb07f73099701e39e167a3d36465/contracts/token/ERC20/ERC20.sol#L71-L78), as with other ERC20 tokens. It applies to the following: * `approve()`/`transferFrom()` in `Collaterals_t.sol`, and * `approve()`/`transferFrom()` in `DSTokenBase.sol`.

LowClone-and-OwnAcknowledged

The clone-and-own approach involves copying and adjusting open source code at one's own discretion. From the development perspective, it is initially beneficial as it reduces the amount of effort. However, from the security perspective, it involves some risks as the code may not follow the best practices, may contain a security vulnerability, or may include intentionally or unintentionally modified upstream libraries.

LowGas Usage / `for` Loop ConcernsAcknowledged

Gas usage is a main concern for smart contract developers and users, since high gas costs may prevent users from wanting to use the smart contract. Even worse, some gas usage issues may prevent the contract from providing services entirely. For example, if a `for` loop requires too much gas to exit, then it may prevent the contract from functioning correctly entirely. It is best to break such loops into individual functions as possible.

LowLack of input validationAcknowledged

There are no non-zero checks for arguments of type address in the following: * `DFPool.constructor()`, * `DFPoolV2.constructor()`, `DFPoolV2.initialize()`, `DFPoolV2.migrateOldPool()`, * `Collaterals_t.constructor()`, * `DSWrappedToken.constructor()`, * `DFSetting.constructor()`, * `DFProtocolView.constructor()`, * `DFEngine.constructor()`, * `InterestProvider.initialize()`, * `Chargeable.initialize()`, * `USR.initialize()`. Furthermore, `DFStore._setSection()` does not check that `_wrappedTokens` is a list of unique tokens.

LowMalicious tokens may cause a DoSAcknowledged

The function `_setSection()` adds tokens. Malicious token may lead to a DoS attack. Similar observation applies to the function `withdrawInterest()`.

LowPrivileged Roles and OwnershipAcknowledged

Smart contracts will often have `owner` variables to designate the person with special privileges to make modifications to the smart contract.

LowToo large value of `minimalBurnAmount` may prevent users from redeeming tokensAcknowledged

If the value of `minimalBurnAmount` is too large, it will prevent users from redeeming tokens.

Show 1 more
LowUnlocked PragmaAcknowledged

Every Solidity file specifies in the header a version number of the format `pragma solidity (^)0.4.*`. The caret (`^`) before the version number implies an unlocked pragma, meaning that the compiler will use the specified version _and above_, hence the term "unlocked".

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

  • contracts/storage/DFCollateral.sol
  • contracts/storage/interfaces/IDFPool.sol
  • contracts/oracle/PriceFeed.sol
  • contracts/utility/Utils.sol
  • contracts/mock/DTokenController.sol
  • contracts/converter/DFProtocol.sol
  • contracts/storage/interfaces/IDFStore.sol
  • Funds.sol
  • contracts/token/ERC20SafeTransfer.sol
  • USR.sol
  • contracts/utility/DSValue.sol
  • contracts/utility/DSThing.sol
  • contracts/token/interfaces/IDSToken.sol
  • Chargeable.sol
  • Pausable.sol
  • Migrations.sol
  • ERC20Pausable.sol
  • contracts/converter/interfaces/IDFEngine.sol
  • InterestProvider.sol
  • DSAuth.sol
  • USRProxy.sol
  • contracts/storage/interfaces/IDFCollateral.sol
  • contracts/token/interfaces/IDSWrappedToken.sol
  • contracts/utility/DSNote.sol
  • contracts/converter/interfaces/IDFProtocol.sol
  • contracts/token/DSToken.sol
  • contracts/oracle/UniswapOracle.sol
  • contracts/utility/DSMath.sol
  • contracts/token/Collaterals_t.sol
  • contracts/storage/DFFunds.sol
  • contracts/storage/interfaces/IDToken.sol
  • contracts/storage/interfaces/IDTokenController.sol
  • contracts/oracle/Medianizer.sol
  • contracts/storage/DFStore.sol
  • contracts/utility/ReentrancyGuard.sol
  • contracts/storage/DFPool.sol
  • contracts/token/interfaces/IERC20Token.sol
  • contracts/token/DSWrappedToken.sol
  • contracts/oracle/interfaces/IMedianizer.sol
  • contracts/storage/DFPoolV2.sol
  • DSGuard.sol
  • contracts/converter/DFEngine.sol
  • contracts/helpers/Migrations.sol
  • contracts/mock/DToken.sol
  • contracts/utility/DFProxy.sol
  • contracts/update/DFUpgrader.sol
  • contracts/storage/interfaces/IDFFunds.sol
  • contracts/utility/DSGuard.sol
  • IInterestProvider.sol
  • contracts/storage/interfaces/IDFPoolV2.sol
  • contracts/token/interfaces/IERC20.sol
  • SafeRatioMath.sol
  • contracts/converter/DFProtocolView.sol
  • contracts/converter/DFEngineV2.sol
  • contracts/converter/DFSetting.sol
  • contracts/utility/DSAuth.sol
  • USDx.sol

Part of dForce’s security record

dForce
Audits2 audits by 2 firmsLast audit Mar 2021, by Consensys.
Critical findingsNo open critical findingsAcross 2 reports.
IncidentIncident 9 Feb 2023Source: De.Fi incident database.
Open dForce’s security record

Security firm

Quantstamp

236 projects reviewed · 332 reports · latest Oct 2026

See Quantstamp’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