Venus - Native Token Gateway

CertiKFiles named in the report

Audit

Part of CertiK’s series

CertiK reviewed Venus Protocol (Venus - Native Token Gateway) on 26 Feb 2024: 8 findings, 0 critical; 7 marked fixed, 1 open.

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

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings8

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

SeverityOpenAcknowledgedFixed
Critical000
High100
Medium002
Low005
MediumExtra Approval Will Be Given For Those That HaveFixed

Users that have already approved a delegate in the Core Pool have done so under the assumption that they will only be able to borrow on their behalf. When upgrading to this implementation, those delegates will then have the ability to redeem on their behalf.

MediumLack Of Input ValidationFixed

The following functions do not ensure that the input `vToken` is the Venus Wrapped Native Token: - `wrapAndSupply()` - `redeemUnderlyingAndUnwrap()` - `borrowAndUnwrap()` - `wrapAndRepay()` This can lead to any tokens that are left in the contract to be stolen or replaced by tokens of lower value by the attacker. Considering the contract is not designed to hold tokens we give this a medium severity.

Low`approve` return value not checkedFixed

Not all `IERC20` implementations `revert` when there's a failure in `approve`. The function signature has a `boolean` return value and they indicate errors that way instead. By not checking the return value, operations that should have marked as failed, may potentially go through without actually approving anything. However, `WETH` and `WBNB` would revert when there is a failure in `approve()`.

LowInconsistent Handling Of Wrapped Native FunctionaFixed

In some functions the contract assumes that `wrappedNativeToken.withdraw()` will always give the same amount of `nativeToken` as the input value. Similarly functions assume that `wrappedNativeToken.deposit()` will always give the same amount of `wrappedNativeToken` as the `msg.value`. However, other functions check the before and after balances and do not make this assumption.

LowRemoval Of `fallback()` Assumes `wNativeToken.witFixed

The `fallback()` function was removed, which could cause potential issues if `wNativeToken.withdraw()` sends native tokens with non-empty `msg.data`. While current implementations send native tokens with empty `msg.data`, this must be checked anytime a new wrapped native token is to be used.

LowTypos and InconsistenciesFixed

### Core Pool ComptrollerStorage The comments for `approvedDelegates` do not reflect the added functionality allowing the delegate to redeem. ### Core Pool MarketFacet The comments and inputs for `updateDelegate()` do not reflect the added functionality allowing the delegate to redeem. ### Core Pool VToken The notice for `redeemInternal()` does not reflect the added ability to specify the redeemer and receiver. The notice for `redeemUnderlyingInternal()` does not reflect the added ability to specify the redeemer and receiver. ### IsolatedPools VToken The comments above `_redeemFresh()` do not reflect that users or their delegates can redeem vTokens in exchange for the underlying asset. ### Isolated Pools Comptroller The comments above `updateDelegate()` do not reflect the added functionality allowing the delegate to redeem. ### NativeTokenGateway - The comments above `wrappedNativeToken` use "ether" instead of "native". - The comments above the `constructor()` use "ether" instead of "native". - The comments above `wrapAndSupply()`use "vWETH" instead of "vWNative". - The comments above `redeemUnderlyingAndUnwrap()` use "vWETH" and "ETH" instead of "vWNative" or "native". - The comments above `sweepNative()` and `sweepToken()` use "Controller" instead of "Controlled". - The function name `_safeTransferETH()` does not reflect that it is transferring native tokens. ### INativeTokenGateway - The comment for the event `sweepToken` uses "WETH" instead of "WNative". - The comments for `wrapAndSupply()`, `redeemUnderlyingAndUnwrap()`, `borrowAndUnwrap()`, `wrapAndRepay()`, `sweepToken()`, and `sweepNative()` reference "ETH", "WETH", and "vWETH".

LowUnnecessary `payable` CastingFixed

The function `sweepNative()` is designed to be called by the owner in order to transfer any native token balance of the contract to the owner. As such, it does not need to receive native tokens.

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

  • contracts/Tokens/VTokens/VToken.sol
  • contracts/Gateway/Interfaces/IVtoken.sol
  • contracts/ComptrollerStorage.sol
  • contracts/Tokens/VTokens/VBep20.sol
  • contracts/VTokenInterfaces.sol
  • contracts/Gateway/INativeTokenGateway.sol
  • contracts/Comptroller.sol
  • contracts/Gateway/NativeTokenGateway.sol
  • contracts/Gateway/Interfaces/IWrappedNative.sol
  • contracts/VToken.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