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.
Report hosted on skynet.certik.com.
Trustblock does not review code.
Statuses are the security firm’s own, from its report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 0 |
| High | 2 | 0 | 0 |
| Medium | 0 | 0 | 0 |
| Low | 0 | 0 | 7 |
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.
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.
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.
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.
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.
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`.
The function `compare()` is no longer used in the contract `BinanceOracle`.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (8)
1,045 projects reviewed · 1,376 reports · latest May 2025
See CertiK’s auditsSomething 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