Venus - Unlist Market & Borrow Cap

CertiKFiles named in the report

Audit

Part of CertiK’s series

CertiK reviewed Venus Protocol (Venus - Unlist Market & Borrow Cap) on 9 Apr 2024: 6 findings, 0 critical; 4 marked fixed, 2 open.

No open critical findings
Open the reportOpen Venus Protocol’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings6

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

SeverityOpenAcknowledgedFixed
Critical000
High100
Medium000
Low104
LowConsider Using Custom ErrorsFixed

From Solidity `v0.8.4`, there are more gas-efficient ways to explain to users why an operation failed than through strings. Using custom errors can significantly reduce the size of the deployed bytecode and reduce the gas cost when calls revert.

LowDiscrepancy Between Use of Borrow Cap in Core vs.Fixed

There is a difference in how the borrow cap is used between the Isolated Pools Comptroller and the Core pool Comptroller. In the Isolated Pools Comptroller, the function `preBorrowHook()` requires that `nextTotalBorrows` is less or equal to the `borrowCap`. Within the Core pool Comptroller, function `borrowAllowed()` requires that `nextTotalBorrows` is strictly less than the `borrowCap`.

LowMissing Checks When Unlisting MarketFixed

The possible actions to pause within a Comptroller are: ```solidity enum Action { MINT, REDEEM, BORROW, REPAY, SEIZE, LIQUIDATE, TRANSFER, ENTER_MARKET, EXIT_MARKET } ``` When a market is unlisted, it is only ensured that the actions of `BORROW`, `MINT`, `REDEEM`, `REPAY`, `ENTER_MARKET`, and `LIQUIDATE` have been paused. It is not checked that the actions of `SEIZE`, `TRANSFER`, or `EXIT_MARKET` have been paused, even though these actions should still be paused. As a consequence, these three actions will be available for continued use, right up until a market has been unlisted, even if all other actions have been paused. For example, a seizure may still be initiated by another listed market. Could you please provide more information on the decision to exclude these actions from being confirmed to be paused before unlisting the market? This allows such actions to never be set to paused, even after a market is unlisted, although the three actions would still be disabled from other checks made.

LowTypos And InconsistenciesFixed

### PR-429 MarketFacet - In the comments above `unlistMarket()` it has "Unlist an market" instead of "Unlist a market". ### PR-349 Comptroller - In the comments above `unlistMarket()` it has "Unlist an market" instead of "Unlist a market". - In the comments above `unlistMarket()` it has "@dev Pauses all actions, sets borrow/supply caps to 0 and sets collateral factor to 0." However, the function checks these and does not set them. ### PR4-39 ComptrollerStorage - The comments above `borrowCaps` states "Defaults to zero which corresponds to unlimited borrowing.", however, the functionality has changed so that zero corresponds to borrowing being disallowed.

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

  • contracts/Comptroller/Diamond/facets/MarketFacet.sol
  • contracts/Comptroller/Diamond/facets/PolicyFacet.sol
  • contracts/Comptroller/Diamond/facets/SetterFacet.sol
  • contracts/Comptroller.sol

Part of Venus Protocol’s security record

Venus Protocol
Audits67 audits by 7 firmsLast audit Sep 2025, by Quantstamp.
Critical findingsNo open critical findingsAcross the 67 reports, 4 critical findings were reported. Each is marked fixed by the firm that reported it.
IncidentIncident 12 May 2022Source: De.Fi incident database.
Open Venus Protocol’s security record

Security firm

CertiK

1,045 projects reviewed · 1,376 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