Part of CertiK’s series
CertiK reviewed Venus Protocol (Venus - Correlated token oracles) on 12 Apr 2024: 12 findings, 0 critical; 9 marked fixed, 3 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 | 1 | 0 | 0 |
| Medium | 0 | 0 | 1 |
| Low | 2 | 0 | 8 |
In the contract `PendleOracle`, the cardinality of the observations is not checked to be able to handle the `TWAP_DURATION`. In addition, the oldest observation is not checked to have been at least the `TWAP_DURATION` in the past.
Many of the oracle contracts take the BNB address as an input. However, other contracts in the codebase use the constant address of 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB.
Function `getPrice()` within contract `CorrelatedTokenOracle` uses a string error message for the check that the input `asset` is `CORRELATED_TOKEN`.
In some of the oracle contracts, there are multiple methods to fetch the exchange rate. - In `WeETHOracle`, it gets the underlying amount via the call `IWeETH(CORRELATED_TOKEN).getEETHByWeETH(1 ether)`. However, this makes the external call `liquidityPool.amountForShare(_weETHAmount);` so that instead `amountForShare()` could be called directly on the `liquidityPool`. - In `WstETHOracle`, it gets the underlying amount via the call `IStETH(UNDERLYING_TOKEN).getPooledEthByShares(1 ether)`. However, this could also be obtained by calling `getStETHByWstETH()` in the `wstETH` contract, which then makes an external call `stETH.getPooledEthByShares()`.
The `OneJumpOracle` is designed to fetch the amount of underlying token for 1 correlated token via an intermediate oracle. For example, this could be used on Arbitrum to get the wstETH-ETH exchange rate via ChainLink assuming stETH is 1 to 1 with ETH. We would like to know the intended use cases so that they can be properly considered.
The usage of a leading underscore or not for input names is inconsistent.
The `constructor` of the `SFraxOracle` contract places input `_frax` as the first parameter and `_sFrax` as the second parameter, then swaps their order when used in the `constructor` of `CorrelatedTokenOracle`.
Function `getUnderlyingAmount` in contract `StkBNBOracle` is missing a check ensuring that `poolTokenSupply` is nonzero before using it in division. The expression `(exchangeRateData.totalWei * EXP_SCALE) / exchangeRateData.poolTokenSupply` may divide by zero.
### CorrelatedTokenOracle.sol - The comment above function `getPrice()` misspells “scaled” as “scalked.” - The comment within function `getPrice()` states that the return value is `underlyingAmount (for 1 liquid staked token) * underlyingUSDPrice / 1e18` however, the product is divided by `10**decimals` which may not be `1e18` in general. - Comments throughout both functions `getPrice()` and `getUnderlyingAmount()` refer to a “liquid staked token” when it is more accurate to refer to a “correlated token” since the correlated token may not be a liquid staked token in every case of use. ### PendleOracle.sol - The comment above the contract `PendleOracle` uses article “an” instead of article “a” in the notice: `This oracle fetches the price of an pendle token`
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (12)
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