UniBot (Diamond Protocol)

QuantstampFiles named in the report

Quantstamp reviewed UnibotX (UniBot (Diamond Protocol)) on 13 Nov 2022: 34 findings, 0 critical; 25 marked fixed, 7 acknowledged, 2 open.

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

Report hosted on certificate.quantstamp.com.

Trustblock does not review code.

Findings34

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

SeverityOpenAcknowledgedFixed
Critical000
High002
Medium108
Low1715
MediumUpdates of Important Variables Are Not Always Checked and/or LoggedOpen

At several locations, it is possible to set or update important state variables with dedicated functions. However, a check is not always made to make sure that the new value is correct, meaning between a minimum and a maximum value to prevent any disruption of the core functions of the protocol. In addition, an event is not always emitted. For example: - `LendingPoolV3.setPerformanceFee()` should validate `_performanceFee` to be lower than BPS. - `DiamondFactoryController.constructor()` does not validate any input. - `DiamondFactoryController.setLiquidationBonus()` does not limit the liquidation bonus. - `DiamondFactoryController.setMaxPositionNumber()` does not limit the `_maxPositionNumber`. - `DiamondFactoryController.setPerformanceFee()` does not limit the `_performanceFee`. - `DiamondFactoryController.setBalanceVaultAddress()` does not validate the `_balanceVault` address. - `DiamondFactoryController.setHelperAddress()` does not validate the `_helper` address. - `DiamondFactoryController.setFeeRecipient()` does not validate the `_feeRecipient`. - `DiamondFactoryV3.init()` does not validate any of the inputs. - `DiamondFactoryV3.setLiquidationThreshold()` does not set boundaries to the new liquidation threshold value. - `DiamondFactoryV3.setBorrowRatioMax()` does not limit the max borrow rate in case of invalid input which represent a high risk. - `DiamondFactoryV3.setReserveRatioMax()` does not validate if the reserve ratio is less than `BPS`. - `DiamondFactoryV3.setStopLossFee()` does not limit the maximum fee amount. - `DiamondFactoryV3.setController()` does not validate the controller address. - `DiamondFactoryV3.setSlippage()` does not limit the slippage value. - `DiamondFactoryHelper.getPositionTokenAmount()` does not validate if the pool address and the pool want token match. - `DiamondFactoryController.addContractWhiteList()` has to validate that the input address is a contract address. - `InterestModel.setNewInterest()` does not validate `_newThreshold`, `_newSlope1` and `_newSlope2`. The severity is assessed as [Medium]: - the impact is High. A wrong value could impact the core functions of the protocol, but it could generally be updated. However, logging such updates would allow the detection of any issue through off-chain monitoring. - the likelihood is Low as these operations can only be initiated by the contract owner, and we can expect that double-checks are performed.

LowMissing Integrity Checks when Updating Min and Max LimitsOpen

For three couples of variables, the fact that the max limit is greater than the min limit (and vice versa) is not checked in the functions `init()`, `_checkOpenPositionParams()`, and in the underlying setter functions. It is also the case in the function `update()` of the library `Positions`. The couples are: - `stopLossLowerPriceTick` and `stopLossUpperPriceTick`; - `openPositionMinimumAmount` and `openPositionMaximumAmount`; - `borrowRatioMin` and `borrowRatioMax`; Such inconsistencies could block the core mechanisms of the protocol.

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

  • contracts/v3/interfaces/IDiamondFactoryHelper.sol
  • contracts/v3/contracts/BalanceVaultV3.sol
  • contracts/v3/contracts/InterestModel.sol
  • contracts/v3/contracts/LendingPoolV3.sol
  • contracts/v3/contracts/DiamondFactoryController.sol
  • contracts/v3/interfaces/IInterestModel.sol
  • contracts/v3/interfaces/ILendingPoolV2.sol
  • contracts/v3/interfaces/IDiamondFactoryController.sol
  • contracts/v3/contracts/DiamondFactoryV3.sol
  • contracts/v3/interfaces/IBalanceVaultV3.sol
  • contracts/v3/interfaces/IDiamondFactoryV3.sol
  • contracts/v3/libraries/Positions.sol
  • contracts/v3/helpers/DiamondFactoryHelper.sol
  • contracts/v3/storage/DiamondFactoryStorageV3.sol
  • contracts/v3/storage/LendingPoolV2Storage.sol

Part of UnibotX’s security record

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