Venus - Oracle Update

CertiKFiles named in the report

Audit

Part of CertiK’s series

CertiK reviewed Venus Protocol (Venus - Oracle Update) on 17 Jul 2023: 9 findings, 0 critical; 7 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.

Findings9

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

SeverityOpenAcknowledgedFixed
Critical000
High200
Medium000
Low007
Low`fallbackPrice` Is Tested Against `mainPrice`Fixed

In the function `_getPrice()`, if the validation of the `mainOraclePrice` vs. `pivotPrice` and `fallbackOraclePrice` vs. `pivotPrice` fails. Then the `fallbackPrice` is tested against the `mainPrice` and if the validation passes, then the `mainPrice` is returned. However, if the `mainPrice` is being returned then it should be the price that is tested.

Low`WBNB` Can Be Made A ConstantFixed

A public variable `WBNB` was added to `BinanceOracle`, to store the address of `wBNB`. As the contract address is known it can be set as a constant to save gas. In addition, if `WBNB` does not need to be initialized, then `initialize()` does not need to be called again if the same `_sidRegistryAddress` and `_accessControlManager` are to be used. If this is the case, then the `initialize()` function can be adjusted to remain consistent with the previous version as it does not need to be called.

LowInefficient `memory` & `storage` ManagementFixed

In the function `getPrice()`, the location specifier `storage` is used for `overrideSymbol`. However, it is only ever used to read from storage and instead the value can be stored in `memory` to reduce gas costs by reading from memory as opposed to storage.

LowMissing Zero Address ValidationFixed

Addresses are not validated before assignment or external calls, potentially allowing the use of zero addresses and leading to unexpected behavior or vulnerabilities. ```solidity=66 sidRegistryAddress = _sidRegistryAddress; ``` - `_sidRegistryAddress` is not zero-checked before being used. --- ```solidity=67 WBNB = _WBNB; ``` - `_WBNB` is not zero-checked before being used.

LowTypos and InconsistenciesFixed

In the contract `BinanceOracle`, the comment above the function `getPrice()` states: "asset Address of the address". However, this should say this is the address of the asset. --- In the contract `ChainlinkOracle`, the comment above the `constructor()` states: "Sets immutable variables". However, it no longer sets any immutable variables. In the contract `ChainlinkOracle`, the comments above `getPrice()` and `_getPriceInternal()` do not reflect that the price that is returned could also be the manually set price. In the contract `ChainlinkOracle`, the comment above the function `getPrice()` states: "asset Address of the address". However, this should say this is the address of the asset. In the contract `ChainlinkOracle`, `PythOracle`, and `ResilientOracle`, "underlying" is used often, when it has been changed to be for any asset, not just the asset underlying a `vToken`. In particular, above the function `_getChainlinkPrice()` it states: "Get the Chainlink price for the underlying asset of a given vToken". --- In the contract `PythOracle`, the comment above the function `getPrice()` states: "asset Address of the address". However, this should say this is the address of the asset. In the contract `PythOracle`, the comment above `setTokenConfig()` mentions `vToken` when it could be any asset. --- In the contract `ResilientOracle`, the comment above the function `_getFallbackOraclePrice()` states: "This function won't revert when the price is 0 because getUnderlyingPrice checks if price is > 0". However, it is more accurate to say that _getPrice checks if price is > 0. In the contract `ResilientOracle`, the comment above the function `updateAssetPrice()` states: "This function should always be called before calling getUnderlyingPrice". However, it is more accurate to say that it should be called before calling getPrice. In the contract `ResilientOracle`, the comment above the function `getOracle()` states: "Gets oracle and enabled status by vToken address". However, it gets it by asset address. In the contract `ResilientOracle`, the comment above the modifier `checkTokenConfigExistence` uses `vToken`, when it can be used for any asset.

LowUnchecked Blocks Can Optimize ContractFixed

In the contract `BinanceOracle`, the function `_getPrice()` checks that `block.timestamp < updatedAt` and then makes the calculation `block.timestamp - updatedAt`. The check prevents the possibility of underflow, so that `deltaTime` can be declared and then inside an unchecked block assigned to be `block.timestamp - updatedAt`.

LowUnused FunctionFixed

The function `compare()` is no longer used in the contract `BinanceOracle`.

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

  • contracts/oracles/BinanceOracle.sol
  • contracts/oracles/ChainlinkOracle.sol
  • contracts/ResilientOracle.sol
  • contracts/oracles/PythOracle.sol
  • contracts/interfaces/FeedRegistryInterface.sol
  • contracts/interfaces/OracleInterface.sol
  • contracts/oracles/BoundValidator.sol
  • contracts/oracles/TwapOracle.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