Venus Multichain Support

QuantstampRepository at commit 5299454

Audit

Part of Quantstamp’s series

Quantstamp reviewed Venus Protocol (Venus Multichain Support) on 19 Dec 2023: 20 findings, 0 critical; 12 marked fixed, 8 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.

Findings30

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

SeverityOpenAcknowledgedFixedMitigated
Critical0000
High0000
Medium0130
Low0792
MediumChainlink Oracle Can Have Its Prices OverriddenAcknowledged

`setDirectPrice()` allows a user with sufficient access control to manually set a price for any asset in the `prices[]` mapping. `_getPriceInternal()` will return the `prices[]` mapping if it is non-zero, preferring it over the price returned by `_getChainlinkPrice()`. The comment specifies that the manually set price is "useful under extenuating conditions such as price feed failure". However, the price is currently used in preference of the price feed, even if it is successful. Additionally, the price never becomes stale. Even if the price is accurately set on initialization, it may not remain so and the protocol would continue operating under a false price.

LowBlock Time Differences Between Chains Could Affect the Vault’s RewardsAcknowledged

The XVS vault internal mapping `rewardTokenAmountsPerBlock`, as the name implies, stores the amount of rewards per block for each registered token. On chains with a fixed block time, since each block is created (approximately) periodically, this implies “per unit of time”. Therefore, as seen in the table below, special care needs to be taken when setting this value in the different chains (these values can and might change in the [future](https://etherscan.io/chart/blocktime)). A wrong value could result in unexpected rewards being provided to users. For chains with irregular block times, please refer to the other related issues. | Chain | Avg Blocktime [s] | |----------|:-----------------:| | Ethereum | 12 | | BSC | 3 | | Optimism | 2 | | opBNB | 1 | | Arbitrum | ~12 (L1), Irregular (L2) | | zkEVM | Irregular | <br> **References:** * [opBNB vs other Layer2 Networks | BNB Optimistic Rollup](https://docs.bnbchain.org/opbnb-docs/docs/core-concepts/difference-L2) * [Arbitrum Block Numbers and Time](https://docs.arbitrum.io/time)

LowNewly Managed Contracts Do Not Restrict Privileged Accounts with Function-Level AccessAcknowledged

The contract `AccessControlManager` allows the `DEFAULT_ADMIN_ROLE` to grant an account access to a specified function accross **all** managed contracts by passing the zero address when calling `AccessControlManager.giveCallPermission()`. While code comments indicate that this is the intended design, it is crucial to note that such a design *could* lead to uninteded access when a new contract is managed by the `AccessControlManager`, or when a currently managed contract is upgraded with new functions.

LowOracle Cannot Handle ERC-20 Tokens with More than 18 DecimalsAcknowledged

The `ChainlinkOracle.getPrice()` and `_getPriceInternal()` functions fetch the given ERC-20 token's `decimal` and multiply the asset price by `10 ** (18 - decimal)`. However, this approach cannot handle ERC-20 tokens with decimals larger than 18, as the subtraction will trigger an integer overflow.

LowPrivileged Roles and OwnershipAcknowledged

Smart contracts will often have `owner` variables to designate the person with special privileges to make modifications to the smart contract. In this protocol, access control is also granted on a per-function basis through `_checkAccessAllowed()`. **VTreasuryV8** The `VTreasuryV8.sol` contract contains the following privileged roles: 1. An owner (`owner`, `onlyOwner` modifier) as initialized during the constructor execution to `msg.sender`: 1. Transfer any amount of any token to any address by calling `withdrawTreasuryToken()`. 2. Transfer any amount of the native token to any address by calling `withdrawTreasuryNative()`. <br> **XVS Bridge & XVS** The `BaseXVSProxyOFT.sol` contract contains the following privileged roles: 1. An owner (`owner`, `onlyOwner` modifier) as initialized during the constructor execution to `msg.sender`: 1. `setOracle()`: Set the address of the `ResilientOracle` contract. 1. `setMaxSingleTransactionLimit()`: Sets the limit of a single transaction amount. 1. `setMaxDailyLimit()`: Sets the limit of daily (24-hour) transactions amount. 1. `setMaxSingleReceiveTransactionLimit()`: Sets the maximum limit for a single receive transaction. 1. `setMaxDailyReceiveLimit()`: Sets the maximum daily limit for receiving transactions. 1. `setWhitelist()`: Sets the whitelist address to skip checks on transaction limit. 2. `pause()`: Pauses the bridge. 3. `unpause()`: Unpauses the bridge. <br> The `XVSBridgeAdmin.sol` contract contains the following privileged roles: 1. An owner (`owner`, `onlyOwner` modifier) as initialized during the constructor execution to `msg.sender`: 1. Insert or modify the mapping between function signatures and names to allow specific roles to call the privileged functions on the bridges. <br> The `XVS.sol` contract contains the following privileged roles: 1. An Access Control Manager (`accessControlManager_`), as initialized during the constructor execution to `accessControlManager_`: 1. Control who is allowed to mint tokens by indirectly affecting `_ensureAllowed("mint(address,uint256)")`. 2. Control who is allowed to burn tokens by indirectly affecting `_ensureAllowed("burn(address,uint256)")`. <br> The following functions in this contract are protected through `_ensureAllowed()`: 1. `mint(address,uint256)`: Mints a capped `amount_` of tokens to a specified `account_`. 2. `burn(address,uint256)`: Burns any `amount_` of tokens from a specified `account_`. <br> **XVS Vault** The `XVSVault.sol` contract contains the following privileged roles: 1. An administrator (`admin`, `onlyAdmin()` modifier), as initialized during the constructor execution to `msg.sender`: 1. Change the XVS store contract address (`xvsStore`) that controls reward token transfers by calling `setXvsStore()`. 2. Change the access control manager implementation address (and thereby indirectly all `_checkAccessAllowed()`-controlled access checks) by calling `setAccessControl()`. <br> The following functions in this contract are protected through `_checkAccessAllowed()` with their corresponding function signatures: 1. `pause()`: Pause the contract (and thereby all calls to `deposit()`, `claim()`, `executeWithdrawal()`, `requestWithdrawal()`, `updatePool()`, `delegate()` and `delegateBySig()`) by calling `pause()`. 1. `resume()`: Resume the contract from a paused state by calling `resume()`. 1. `add(address,uint256,address,uint256,uint256)`: Add a new pool by calling `add()`. 1. Using an existing reward token, but a new pool token allows the caller to globally update the `rewardTokenAmountsPerBlock[]` variable for all pools using this reward token, **without explicitly calling `setRewardAmountPerBlock()`**. In extreme cases, this could either drain the reward token (by choosing a high reward value) or halt any future rewards (by choosing zero). 1. **Accidentally or with malicious intent the caller could add enough new pools to make calling `massUpdatePools()` prohibitively gas-expensive and thereby deny the service to the following functions**: 1. `add()` 1. `set()` 1. `setRewardAmountPerBlock()` 1. `set(address,uint256,uint256)`: Update the accumulated rewards per share for all pools and change the allocation point of a pool by calling `set()`. 1. `setRewardAmountPerBlock(address,uint256)`: Update the accumulated rewards per share for all pools and arbitrarily change the reward amount per block by calling `setRewardAmountPerBlock()`. 1. **By setting it to zero no additional rewards would be accumulated.** 1. **By setting it to an unusually high value the reward token could be drained.** 1. `setWithdrawalLockingPeriod(address,uint256,uint256)`: Change the lockup period for withdrawing deposited funds by calling `setWithdrawalLockingPeriod()`. <br> The `XVSStore.sol` contract contains the following privileged roles: 1. An administrator (`admin`, `onlyAdmin()` modifier), as initialized during the constructor execution to `

LowRenounceable Privileged RoleAcknowledged

In the contract `AccessControlManager`, the `DEFAULT_ADMIN_ROLE` is granted to the deployer, which can then grant and revoke privileged roles for access to restricted protocol functions. In the case where the deployer calls `AccessControlManager.renounceRole(DEFAULT_ADMIN_ROLE, deployerAddress)`, and no other addresses are granted the `DEFAULT_ADMIN_ROLE`, the `AccessControlManager` contract will no longer be able to grant or revoke roles. In certian cases, a renounced `DEFAULT_ADMIN_ROLE` could prevent a managed contract from accessing pausable functionality or other critical functionality.

LowRisks of Potential Operational Errors When Handling Failed Bridge TransfersAcknowledged

If a cross-chain transfer (from `XVSProxyOFTSrc` to `XVSProxyOFTDest`) fails on the destination chain, the `fallbackWithdraw()` function can be called on the source chain to reclaim the deposited tokens. However, there is no way of checking that there has ever been a failed transfer on a destination chain, and furthermore, there is no way of verifying the transfer amount. Therefore, it is possible to withdraw tokens on the source chain that were not ever "stuck" on a destination chain, which would prohibit users from bridging their tokens from a destination chain back to the source chain.

LowUsers Will Get Wrong Rewards Due to Arbitrum’s `block.number` IncompatibilityAcknowledged

According to Arbitrum’s [documentation](https://docs.arbitrum.io/time), its `block.number` is updated to sync with Ethereum’s `block.number` every minute. Therefore, any time calculations based on the block number would be inaccurate. The `XVSVault` relies on the `block.number` to update `pool.accRewardPerShare` in `_updatePool()` based on the duration since the last update. The pool is updated internally before every major action is taken in the contract, and there is also the external function `updatePool()` without any restrictions on the caller. If `_updatePool()` is called less frequently, this could cause inaccuracies in `accRewardPerShare` in the short term, leading to users receiving fewer rewards than expected. On the other hand, block numbers and timestamps on Arbitrum are generally reliable in the longer term, according to the documentation: > As a general rule, any timing assumptions a contract makes about block numbers and timestamps should be considered generally reliable in the longer term (i.e., on the order of at least several hours) but unreliable in the shorter term (minutes). (It so happens these are generally the same assumptions one should operate under when using block numbers directly on Ethereum!) If the rewards need to be accurate on the order of several hours, this issue is of less concern.

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

  • https://github.com/VenusProtocol/isolated-pools/contracts/Bridge/token/XVS.sol at commit 5299454
  • https://github.com/VenusProtocol/venus-protocol/contracts/XVSVault/XVSVaultProxy.sol at commit a158f8c
  • https://github.com/VenusProtocol/isolated-pools/contracts/Bridge/interfaces/IXVS.sol at commit 5299454
  • https://github.com/VenusProtocol/isolated-pools/contracts/Bridge/interfaces/IXVSProxyOFT.sol at commit 5299454
  • https://github.com/VenusProtocol/venus-protocol/contracts/XVSVault/XVSVaultErrorReporter.sol at commit a158f8c
  • https://github.com/VenusProtocol/isolated-pools/contracts/JumpRateModelV2.sol at commit 5e660bf
  • https://github.com/VenusProtocol/isolated-pools/contracts/Bridge/token/TokenController.sol at commit 5299454
  • https://github.com/VenusProtocol/venus-protocol/contracts/XVSVault/XVSVault.sol at commit a158f8c
  • https://github.com/VenusProtocol/governance-contracts/contracts/Governance/AccessControlManager.sol at commit 358bed4
  • https://github.com/VenusProtocol/isolated-pools/contracts/WhitePaperInterestRateModel.sol at commit 5e660bf
  • https://github.com/VenusProtocol/isolated-pools/contracts/Bridge/XVSBridgeAdmin.sol at commit 5299454
  • https://github.com/VenusProtocol/venus-protocol/contracts/Governance/VTreasuryV8.sol at commit 0a05857
  • https://github.com/VenusProtocol/venus-protocol/contracts/XVSVault/XVSVaultStorage.sol at commit a158f8c
  • https://github.com/VenusProtocol/isolated-pools/contracts/Bridge/BaseXVSProxyOFT.sol at commit 5299454
  • https://github.com/VenusProtocol/oracle/contracts/oracles/ChainlinkOracle.sol at commit a0a36bc
  • https://github.com/VenusProtocol/venus-protocol/contracts/XVSVault/XVSStore.sol at commit a158f8c
  • https://github.com/VenusProtocol/isolated-pools/contracts/Bridge/XVSProxyOFTSrc.sol at commit 5299454
  • https://github.com/VenusProtocol/isolated-pools/contracts/BaseJumpRateModelV2.sol at commit 5e660bf
  • https://github.com/VenusProtocol/oracle/contracts/ResilientOracle.sol at commit a0a36bc
  • https://github.com/VenusProtocol/isolated-pools/contracts/lib/constants.sol at commit 5e660bf
  • https://github.com/VenusProtocol/protocol-reserve/contracts/ProtocolReserve/ProtocolShareReserve.sol at commit e396119
  • https://github.com/VenusProtocol/isolated-pools/contracts/Bridge/XVSProxyOFTDest.sol at commit 5299454

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