Venus Income Allocation

QuantstampRepository at commit 2e0f5f6

Audit

Part of Quantstamp’s series

Quantstamp reviewed Venus Protocol (Venus Income Allocation) on 12 Oct 2023: 12 findings, 0 critical; 2 marked fixed, 10 acknowledged; 2 more marked mitigated.

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

Report hosted on certificate.quantstamp.com.

Trustblock does not review code.

Findings19

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

SeverityOpenAcknowledgedFixedMitigated
Critical0000
High0000
Medium0200
Low0822
MediumDoS of `_releaseFund()` if Incorrect Address Is SetAcknowledged

During the `_releaseFund()` function call, `DistributionConfig`s are iterated over, and the funds are divided between the provided addresses via an ERC20 transfer. After the ERC20 token transfer, the `updateAssetsState()` method of `IIncomeDestination` is invoked, so that the tokens are accounted for correctly. The issue arises from the fact that the method is called on an arbitrary contract at the address `_config.destination`, which is added to the array. Therefore, if an address is added that does not have the `updateAssetsState()` method implemented, this call will revert; hence, every call to `_releaseFund()` will revert, and the contract will not be usable, as it is not possible to remove items from the distribution array.

MediumNon-Standard Tokens Will Cause the Accounting System to BreakAcknowledged

`updateAssetsState()` function is usually called when a transfer of ERC20 assets has been made to the contract. It can also be called by any user of the platform. The idea behind this function is to account for newly transferred ERC20 tokens by taking the difference between the current balance of the contract and the accounted balance of the contract. It is assumed that there should be no case where the `currentBalance` will be less than the already accounted `assetReserve`. This is not strictly the case, as if the asset is a rebasing token such as Ampelforth, the number of tokens in the contract balance will vary depending on the current market conditions and the underlying peg-keeping algorithm. These types of balance changes are also common in other types of non-standard tokens. When `releaseFunds()` is called with the correct parameters, the income of such rebasing token would be distributed based on the last `updateAssetsState()` balance, which might not be the same as the current contract balance and could be potentially lower than the `schemaBalances` accounted balance. Leading to an issue where the last transfer will fail due to insufficient funds in the contract.

LowDoS Possible if Incorrect `protocolShareReserve` Address Is UsedAcknowledged

The contract has a function with `setProtocolShareReserve()` functionality that allows to set a new address for the `protocolShareReserve` contract. There are similar implementations of setters in the contract, but the main difference is that the new address is verified by a call to a `is<ExpectedContract>()` call, where Expected Contract is, for example, Comptroller. This is not the case for the `protocolShareReserve` contract. Hence, it is possible for the new address not to be the expected contract and not to have an `updateAssetsState()` method implemented. This would lead to `_reduceReservesFresh()` failing on every call in the `VToken` context and hence the DoS of the usability of the contract, as the method would not exist and revert. In the context of `vBNBAdmin`, the function failing would be `reduceReserves()`. This issue affects both the `VToken` contract implementations and the `vBNBAdmin` contract.

LowERC-20 Dust Left in the Contract After `_releaseFund()`Acknowledged

During the `_releaseFund()` call, the correct distribution patterns are applied to the collected ERC20 Income. The income is divided as a percentage between previously allocated addresses. The `transferAmount` is calculated via the following formula: ``` uint256 transferAmount = (schemaBalances[uint256(_config.schema)] * _config.percentage) / MAX_PERCENT ``` The division operator could lead to rounding errors, and hence, it is possible that the total transfer amount might not add up to the exactly expected `totalBalance`. These leftover ERC20 tokens will be returned to the `assetsReserves` and reallocated at the next round, but potentially under a different allocation scheme. Hence, the users entitled to them might not receive them in the next allocation.

LowNative Token Transfer Is Still PossibleAcknowledged

The idea of the `ProtocolShareReserve` contract is to accumulate income from ERC20 tokens and distribute it in the expected patterns between different addresses. It is not expected for the contract to receive native tokens, hence the absence of `payable` functions or the `receive()` method. The EVM currently still supports the `SELFDESTRUCT` opcode. It is used to terminate a contract, remove the bytecode from the blockchain, and send any contract funds to a specified address. This transfer cannot be rejected, so if another contract self-destructs and points to `ProtocolShareReserve` as the recipient, then the contract will be funded from an unexpected source. This issue is also applicable to the `vBNBAdmin` contract, as the specifications of the contract state that BNB tokens should only be received from the associated `vBNB` contract. Currently, the `receive()` function is protected with a required statement that only accepts funds from the `vBNB` contract. But with the issue described above, it is still possible to receive native tokens not from the expected source.

LowOne Can Add Zero Percentage Destinations to Waste GasAcknowledged

During the `addOrUpdateDistributionConfigs()` function, it is possible to add a distribution config with a zero percentage. This would mean that no funds would be sent to that address, but the address would still be iterated over, hence wasting gas.

LowSome Loops Do Not Use the `_ensureMaxLoops()` CheckAcknowledged

The `_ensureMaxLoops()` check is only used once in `addOrUpdateDistributionConfigs()` to limit the number of iterations through the distribution targets. It is not used to check other loops in the contract, such as the number of configs being added or updated, the number of assets used in `releaseFunds()`, the number of markets in `_accrueAndReleaseFundsToPrime()` and `_accruePrimeInterest()`, and the number of schemas or distribution targets in `_releaseFund()`. The absence of these checks could lead to a potential gas issue and the transaction failing.

LowState Variables Not Set Upon InitializationAcknowledged

In both `VToken` contracts, the values for `reduceReservesBlockDelta` and `protocolShareReserve` are not set during initialization. This could cause unintended behavior at the time of deployment.

LowUnhandled Error Code from `_reduceReservesFresh()` in `VToken`Acknowledged

The core pool's `VToken._reduceReservesFresh()` function can return a non-zero error code to indicate any failures during its execution. However, in the `accrueInterest()` function, when `_reduceReservesFresh()` is called, the returned error code is unhandled. Therefore, even though an error occurs during the execution of `reduceReservesFresh()`, the `accrueInterest()` function continues to execute, returning a `uint(Error.NO_ERROR)` to indicate that no errors have occurred. External contracts may incorrectly assume that `_reduceReservesFresh()` has executed successfully based on the `Error.NO_ERROR` return value.

LowUpgradabilityAcknowledged

Some of the contracts audited are upgradeable, and their functionality may be changed by privileged roles in the future.

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

  • https://github.com/VenusProtocol/venus-protocol/contracts/Tokens/VTokens/VTokenInterfaces.sol at commit 2e0f5f64f49aba3150e49c7a7e34a28826726f20
  • https://github.com/VenusProtocol/venus-protocol/contracts/Tokens/VTokens/VToken.sol at commit 2e0f5f64f49aba3150e49c7a7e34a28826726f20
  • https://github.com/VenusProtocol/venus-protocol/contracts/Utils/ErrorReporter.sol at commit 2e0f5f64f49aba3150e49c7a7e34a28826726f20

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

Quantstamp

240 projects reviewed · 338 reports · latest Nov 2026

See Quantstamp’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