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.
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 | 2 |
| Low | 0 | 0 | 5 |
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.
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.
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()`.
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.
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.
### 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".
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.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (10)
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