Download audit report
This document presents the security review performed by Nethermind Security for the smart contracts of Vana to support VeVana tokens. In prior audit engagements, the functionality of the code had been reviewed, and this audit is only focused on integration of VeVana ERC20 tokens and their movement in the protocol.
Previously, the economic value of the protocol was only represented in Vana native tokens. With the new changes in the codebase, VeVana ERC20 tokens are integrated into the protocol. This provides the users with the flexibility to use VeVana ERC20 tokens along with Vana native tokens. VeVana token is a wrapper on top of the Vana native token that leverages additional features like voting to the protocol.
VeVana token is implemented as an upgradeable and pausable contract which gives additional control for the protocol owners to add new features to the tokens. On the other hand, it brings the risk of centralization and compromised token owner.
This security review focuses exclusively on the smart contracts listed in Section 2 (Audited Files) and scope for interactions with VeVana token contract.
The audited code comprises 1575 lines of code written in the Solidity language, and the audit was performed using (a) manual analysis of the code base and (b) creation of test cases.
| Audit assessment | |
| Audit Type | Security Review |
| Response from Client | Regular responses during audit engagement |
| Final Report | March 07, 2025 |
| Repository | Vana |
| Commit (Final) | a9fb959d84 |
| Documentation Assessment | Medium |
| Test Suite Assessment | Medium |
Findings by severity
| # | Contract | LoC | Comments | Ratio | Blank | Total |
| 1 | rootEpoch/DLPRootEpochImplementation.sol | 265 | 25 | 9.4% | 67 | 357 |
| 2 | root/DLPRootImplementation.sol | 455 | 60 | 13.2% | 124 | 639 |
| 3 | root/interfaces/IDLPRoot.sol | 82 | 5 | 6.1% | 10 | 97 |
| 4 | rootTreasury/DLPRootTreasuryImplementation.sol | 72 | 4 | 5.6% | 18 | 94 |
| 5 | rootTreasury/interfaces/IDLPRootTreasury.sol | 14 | 1 | 7.1% | 2 | 17 |
| 6 | rootTreasury/interfaces/DLPRootTreasuryStorageV1.sol | 7 | 6 | 85.7% | 2 | 15 |
| 7 | rootCore/DLPRootCoreImplementation.sol | 516 | 34 | 6.6% | 104 | 654 |
| 8 | rootCore/interfaces/IDLPRootCore.sol | 93 | 5 | 5.4% | 10 | 108 |
| 9 | veVANA/VeVANAProxy.sol | 5 | 1 | 20.0% | 2 | 8 |
| 10 | veVANA/VeVANAImplementation.sol | 55 | 6 | 10.9% | 15 | 76 |
| 11 | veVANA/interfaces/VeVANAStorageV1.sol | 4 | 6 | 150.0% | 2 | 12 |
| 12 | veVANA/interfaces/IVeVANA.sol | 7 | 1 | 14.3% | 4 | 12 |
| Total | 1575 | 154 | 9.8% | 360 | 2089 |
| # | Finding | Severity | Update |
| 1 | Staking on behalf should source VeVana tokens from the Stake owner's account | Info | Acknowledged |
| 2 | migrateStake function will not work as expected | Info | Acknowledged |
| 3 | Use Beacon Proxy pattern to keep Rewards and Stakes proxies in Sync | Best Practices | Acknowledged |
VeVana ERC20 tokens are added along with the native Vana tokens for users to perform staking. Users can now stake either native Vana tokens or VeVana ERC20 tokens. Likewise, DLP owners can register DLPs using either of the tokens.
Going forward, the staking rewards will be distributed using VeVana tokens.
VeVana tokens bear voting rights.

VeVana is an ERC20 wrapper on top of native Vana tokens. The contract is upgradeable using the UUPS proxy pattern. The token also supports voting functionality and pausing deposit, and withdrawal functions.
The DLP root contract is extended to support staking functionality using VeVana tokens alongside of Vana native tokens.
DLP root core contract is extended to allow DLP owners to register new DLP using VeVana tokens.
Epoch contract now distributes the rewards in VeVana tokens.
The root treasury contract is extended to support integration with VeVana tokens. The contract now allows for deposits in native Vana and VeVana tokens. The contract also withdrawal of value in either native Vana and VeVana tokens.
The risk rating methodology used by Nethermind Security follows the principles established by the OWASP Foundation. The severity of each finding is determined by two factors: Likelihood and Impact.
Likelihood measures how likely the finding is to be uncovered and exploited by an attacker. This factor will be one of the following values:
When defining the likelihood of a finding, other factors are also considered. These can include but are not limited to motive, opportunity, exploit accessibility, ease of discovery, and ease of exploit.
Impact is a measure of the damage that may be caused if an attacker exploits the finding. This factor will be one of the following values:
When defining the impact of a finding, other factors are also considered. These can include but are not limited to data and state integrity, loss of availability, financial loss, and reputation damage. After defining the likelihood and impact of an issue, the severity is determined according to the table below.
| Impact / Likelihood | Low | Medium | High |
| High | Medium | High | Critical |
| Medium | Low | Medium | High |
| Low | Info / Best Practices | Low | Medium |
| Undetermined | Undetermined | Undetermined | Undetermined |
To address issues that do not fit a High, Medium or Low severity, Nethermind Security also uses three more finding severities: Informational, Best Practices, and Undetermined.
| File | Fix commit | Type | Status |
DLPRootImplementation.sol | — | Info | Acknowledged |
VeVana tokens can be staked by anyone on behalf of another user. These VeVana tokens should be sourced from the stake owner's account and not from the caller of the staking function. In the below two functions, the caller is creating a stake on behalf of stakeOwner. Hence, the stake amount should be sourced from the stakeOwner's account.
function createStakeOnBehalf(
uint256 dlpId,
address stakeOwner
) external payable override nonReentrant whenNotPaused {
dlpRootEpoch.createEpochs();
_createStake(stakeOwner, dlpId, msg.value, block.number, false);//@audit
}
function createStakeOnBehalfWithVeVANA(
uint256 dlpId,
address stakeOwner,
uint256 amount
) external override nonReentrant whenNotPaused {
dlpRootEpoch.createEpochs();
_createStake(stakeOwner, dlpId, amount, block.number, false);//@audit
}While stakeOwner was passed as a parameter to _createStake function below, at the time of sourcing the VeVana tokens, the logic is actually sourcing the funds from _msgSender() account instead of the stakeOwner's account.
function _createStake(address stakerAddress, uint256 dlpId,
uint256 amount, uint256 startBlock,
bool isRestake) internal {
//...
if (!isRestake) {
if (msg.value > 0) {
dlpRootStakesTreasury.depositVana{value: msg.value}();//@audit
} else {
IVeVANA veVANA = dlpRootStakesTreasury.veVANA();//@audit
veVANA.safeTransferFrom(
==> _msgSender(),
address(dlpRootStakesTreasury),
amount
);
}
}
//...
}As a result, the tokens of the caller will get locked in the stake instead of the stake owner.
Recommendation
Take approval from stakeOwner to spend the tokens and pass stakeOwner in safeTransferFrom function. This will also prevent a case where the caller executes a staking on behalf and ends up locking his tokens while the stakeOwner did not deposit the amount into the caller's account.
Resolution
The intention of the function is to allow anyone to create a stake in favor of another user using the function caller's tokens. It is like gifting tokens to another user.
| File | Fix commit | Type | Status |
DLPRootImplementation.sol | — | Info | Acknowledged |
The migrateStake function of DLPRootImplementation allows the owner to migrate the staked amount from one DLP to another DLP. The process closes the current stake and creates a new stake with the new DLP specified as a parameter.
function migrateStake(
uint256 stakeId,
uint256 newDlpId,
uint256 newAmount
) external override nonReentrant whenNotPaused {
dlpRootEpoch.createEpochs();
Stake storage stake = _stakes[stakeId];
==> if (newDlpId != stake.dlpId) {
revert InvalidDlpId();
}
if (newAmount > stake.amount) {
revert InvalidStakeAmount();
}
stake.movedAmount = newAmount;
_closeStake(_msgSender(), stakeId);
_createStake(_msgSender(), newDlpId, newAmount, stake.startBlock, true);
emit StakeMigrated(stakeId, stakesCount, newDlpId, newAmount);
}However, the validation of newDlpId expects it to be the same as the stake’s dlpId, which defeats the purpose of passing newDlpId as a parameter.
As a result, in the current implementation, the migrateStake function will revert if newDlpId is not the same as the current stake's dlpId.
Recommendation
Review the condition for DlpId validation.
Resolution
Yes, it is for restaking to another Dlp. However, we block the restaking to a different Dlp currently and only allow restaking to the same Dlp (which is equivalent to partial unstaking).
| File | Fix commit | Type | Status |
DLPRootTreasuryImplementation.sol | — | Best Practices | Acknowledged |
DLPRootTreasuryImplementation is an implementation contract that is used by two proxies, one for Rewards and the other for Stakes. In the case of proxy patterns, proxy contracts are the owners of the storage data, and hence each proxy will have their storage.
abstract contract DLPRootTreasuryStorageV1 is IDLPRootTreasury {
IDLPRoot public override dlpRoot;
IVeVANA public override veVANA;//@audit
}Hence, every time veVana is updated with a new address, it should be updated for both instances of the proxies.
Recommendation
Beacon Proxy is a smart contract upgrade pattern where multiple proxies use the same implementation contract, and all the proxies can be upgraded in a single transaction.
Resolution
Will consider the recommendation.
Software documentation refers to the written or visual information that describes the functionality, architecture, design, and implementation of software. It provides a comprehensive overview of the software system and helps users, developers, and stakeholders understand how the software works, how to use it, and how to maintain it. Software documentation can take different forms, such as user manuals, system manuals, technical specifications, requirements documents, design documents, and code comments. Software documentation is critical in software development, enabling effective communication between developers, testers, users, and other stakeholders. It helps to ensure that everyone involved in the development process has a shared understanding of the software system and its functionality. Moreover, software documentation can improve software maintenance by providing a clear and complete understanding of the software system, making it easier for developers to maintain, modify, and update the software over time. Smart contracts can use various types of software documentation. Some of the most common types include:
These types of documentation are essential for smart contract development and maintenance. They help ensure that the contract is properly designed, implemented, and tested, and they provide a reference for developers who need to modify or maintain the contract in the future.
The documentation for the Vana Smart Contracts are contained in the README of the project’s Github. It is written for developers, presenting each core component of the protocol, including deployment, contracts, functions, and testing. The information is presented in a very concise and technical manner, with well-written explanations and references where necessary. It also features a section explaining development dependencies and instructions on how to build and test the code. Code comments are also of high quality, with explanations for every function describing the purpose, context, and situations where the function will be called. Other than functions, some comments exist in other areas of the code where extra information is necessary, allowing readers to understand the codebase at a faster pace.
All the relevant issues raised by Slither have been incorporated into the issues described in this report.
All the relevant issues raised by the AuditAgent have been incorporated into this report. The AuditAgent is an AI-powered smart contract auditing tool that analyses code, detects vulnerabilities, and provides actionable fixes. It accelerates the security analysis process, complementing human expertise with advanced AI models to deliver efficient and comprehensive smart contract audits. Available at https://app.auditagent.nethermind.io.
| 458Tests passed | 0Failed |
The complete test output is in the full report.
As auditors, we recommend that any changes or updates made to the audited codebase undergo a re-audit or security review to address potential vulnerabilities or risks introduced by the modifications. By conducting a re-audit or security review of the modified codebase, you can significantly enhance the overall security of your system and reduce the likelihood of exploitation. However, we do not possess the authority or right to impose obligations or restrictions on our clients regarding codebase updates, modifications, or subsequent audits. Accordingly, the decision to seek a re-audit or security review lies solely with you.
This report is based on the scope of materials and documentation provided by you to Nethermind in order that Nethermind could conduct the security review outlined in 1. Executive Summary and 2. Audited Files. The results set out in this report may not be complete nor inclusive of all vulnerabilities. Nethermind has provided the review and this report on an as-is, where-is, and as-available basis. You agree that your access and/or use, including but not limited to any associated services, products, protocols, platforms, content, and materials, will be at your sole risk. Blockchain technology remains under development and is subject to unknown risks and flaws. The review does not extend to the compiler layer, or any other areas beyond the programming language, or other programming aspects that could present security risks. This report does not indicate the endorsement of any particular project or team, nor guarantee its security. No third party should rely on this report in any way, including for the purpose of making any decisions to buy or sell a product, service or any other asset. To the fullest extent permitted by law, Nethermind disclaims any liability in connection with this report, its content, and any related services and products and your use thereof, including, without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement. Nethermind does not warrant, endorse, guarantee, or assume responsibility for any product or service advertised or offered by a third party through the product, any open source or third-party software, code, libraries, materials, or information linked to, called by, referenced by or accessible through the report, its content, and the related services and products, any hyperlinked websites, any websites or mobile applications appearing on any advertising, and Nethermind will not be a party to or in any way be responsible for monitoring any transaction between you and any third-party providers of products or services. As with the purchase or use of a product or service through any medium or in any environment, you should use your best judgment and exercise caution where appropriate. FOR AVOIDANCE OF DOUBT, THE REPORT, ITS CONTENT, ACCESS, AND/OR USAGE THEREOF, INCLUDING ANY ASSOCIATED SERVICES OR MATERIALS, SHALL NOT BE CONSIDERED OR RELIED UPON AS ANY FORM OF FINANCIAL, INVESTMENT, TAX, LEGAL, REGULATORY, OR OTHER ADVICE.
The Leading Engineers of Blockchain Infrastructure