View Audit Report
This document presents the results of the security review conducted by Nethermind Security for Vistapex smart contract.
The audit comprises 484 lines of Solidity code. The audit was performed using (a) manual analysis of the codebase, and (b) automated analysis tools.
| Audit assessment | |
| Audit Type | Security Review |
| Initial Report | August 21, 2026 |
| Final Report | August 21, 2026 |
| Initial Commit | c22dd9cbd1c |
| Final Commit | 9da7c5ffca |
| Documentation Assessment | Medium |
| Test Suite Assessment | High |
Findings by severity
| # | Contract | LoC | Comments | Ratio | Blank | Total |
| 1 | PerpsStateVerifier.sol | 232 | 273 | 117.7% | 54 | 559 |
| 2 | DepositPool.sol | 252 | 213 | 84.5% | 67 | 532 |
| Total | 484 | 486 | 100.4% | 121 | 1091 |
VistaPex is a perpetual futures system deployed on Avalanche. The in-scope onchain layer consists of two independent contracts. DepositPool provides pooled USDC custody and settlement, while PerpsStateVerifier records SP1-proven state commitments for transparency. The contracts do not call each other or share state. Offchain services are assumed to maintain trading accounts, authorize settlements, produce proofs, and consume contract events.
The DepositPool contract holds the protocol's USDC and exposes deposit and withdrawal settlement functions. The USDC address is immutable. The contract does not maintain user balances or a per-account ledger, so trading balances and account ownership are assumed to be maintained by the offchain system. Its onchain records consist primarily of custody balances, replay-protection mappings, configuration, and events.
4.1.1 Deposits
A user first approves the pool to spend USDC and then calls deposit with a non-zero trading account ID and amount. The contract measures its token balance before and after transferFrom and emits a Deposit event for the amount actually received. This prevents the offchain system from crediting more than reached the pool if the configured token has non-standard transfer behavior. An assumed chain watcher consumes the event after confirmation and credits the corresponding offchain account. As deposit is a public function, anyone can call this function directly on the smart contract. Any funds deposited with an invalid trading account ID will remain permanently locked in the contact.
4.1.2 Withdrawals
Withdrawals use separate authorizer and operator roles. The authorizer signs the settlement parameters offchain, while the operator is the only address allowed to submit withdraw. The signed message commits to the pool address, withdrawal ID, recipient, amount, nonce, deadline, and chain ID, which binds the authorization to one deployment and network.
The contract requires a non-zero amount and recipient, an unexpired deadline, an unused nonce, and an unsettled withdrawal ID. It also enforces the owner-configurable per-transaction withdrawal cap when the cap is non-zero. After recovering the configured authorizer from the signature, it consumes both replay identifiers before transferring USDC and emitting Withdrawal. The withdrawal ID prevents the same offchain request from being settled again with a new nonce, while the nonce prevents reuse of an authorization value.
The PerpsStateVerifier contract is a transparency component and has no authority over funds held by DepositPool. Its proof operator submits SP1 proof bytes together with nine ABI-encoded public values: the pre-state root, post-state root, batch ID, event count, oracle-prices hash, events hash, market-configurations hash, chain ID, and the PerpsStateVerifier deployment address.
The contract asks the configured SP1 verifier to validate the proof against the current program verification key. It then checks that the committed chain ID and verifier address match the current deployment, that the pre-state root equals the stored balanceStateRoot, and that the batch ID immediately follows lastProvenBatchId. A successful submission stores the post-state root and batch ID and emits BatchProven with the batch metadata commitments. External observers can read the latest proven state directly from the contract.
Both contracts use two-step ownership transfers. In DepositPool, operator and authorizer rotations require a proposal, a 48-hour delay, and acceptance by the nominated address. The owner can also configure the withdrawal cap. The owner, operator, or authorizer may pause deposits and withdrawals, but only the owner may unpause them. In PerpsStateVerifier, operator, program verification key, and SP1 verifier rotations require a proposal and a 48-hour delay. The nominated operator accepts its own rotation, while the owner accepts program-key and SP1-verifier rotations. The owner or proof operator may pause proof submission, while only the owner may unpause it.
The verifier's initial state root is supplied to the constructor and is not derived or authenticated onchain. The BatchProven event commits to hashes of prices, events, and market configurations. The contract also provides no escape hatch that lets users exit from the proven state without cooperation from the custody and offchain settlement system.
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 |
src/DepositPool.solsrc/PerpsStateVerifier.sol | 9da7c5f | Info | Fixed |
The pause(...) and unpause(...) functions in the DepositPool and PerpsStateVerifier contracts do not check whether the contract is already in the target state before updating storage and emitting state transition events.
As a result, authorized users can invoke pause(...) or unpause(...) repeatedly when the contract is already in that state, leading to duplicate Paused or Unpaused events still being emitted.
Recommendation
Consider adding state validation guards to both pause(...) and unpause(...) functions to verify that the contract is not already in the target state prior to performing storage modifications and emitting events.
| File | Fix commit | Type | Status |
src/DepositPool.sol | 9da7c5f | Info | Fixed |
The deposit() function measures the actual USDC received via a balanceOf before/after pattern rather than trusting the caller-declared amount. However, USDC on Avalanche is a standard, non-rebasing, non-fee-on-transfer token, meaning the amount received will always equal the amount under current conditions.
USDC has an upgradeable proxy architecture, and hence Circle could theoretically introduce a transfer fee via a contract upgrade at any time in the future.
Recommendation
Consider introducing an owner-configurable maximum acceptable fee threshold in basis points (e.g., maxDepositFeeBps). On each deposit, compute the fee as the amount received and revert if it exceeds the configured threshold. This gives the team explicit control over how much transfer-fee slippage is acceptable.
| File | Fix commit | Type | Status |
src/DepositPool.solsrc/PerpsStateVerifier.sol | 9da7c5f | Info | Fixed |
In both DepositPool and PerpsStateVerifier, acceptOwnership(...) updates only owner and clears pendingOwner, but does not invalidate any pending operational-role rotations that the previous owner may have proposed. These stale nominations remain executable by their nominees after the handover of ownership, without any authorization from the new owner.
When ownership changes, the contract must automatically clear all pending role nominations and reset their ETAs value to zero.
Recommendation
Clear all pending operational-role slots and their associated ETAs during ownership acceptance.
| File | Fix commit | Type | Status |
src/DepositPool.sol | 9da7c5f | Info | Fixed |
The DepositPool contract manages rotations of administrative roles for the owner, operator, and authorizer. Role changes follow a two-step pattern: the owner proposes a new address, and a timelock must elapse before the rotation can be finalized.
However, the proposeOperator(...), proposeAuthorizer(...), and transferOwnership(...) functions only validate that the proposed address is not address(0). They fail to verify whether the proposed address matches the current holder of the role.
Recommendation
Consider adding validation in proposeOperator(...), proposeAuthorizer(...), and transferOwnership(...) to ensure that the proposed address does not match the current holder.
| File | Fix commit | Type | Status |
src/DepositPool.solsrc/PrepsStateVerifier.sol | 9da7c5f | Best Practices | Fixed |
The DepositPool contract relies on a two-key custody separation model where the operator submits withdrawal transactions and the authorizer signs authorization payloads. Compromising either key alone should not be sufficient to drain funds.
The contract enforces that operator != authorizer cannot be the same address, but does not enforce the owner address to be distinct from operator or authorizer address.
As owner, operator, and authorizer are three distinct roles, it is recommended to keep them separate and not allow the roles to collapse into a single address.
A similar pattern exists in the PrepStateVerifier contract.
Recommendation
Consider adding explicit validation checks in the constructor(...) and all role assignment and acceptance functions, such as acceptOperator(...), acceptAuthorizer(...), and acceptOwnership(...), to ensure that the owner, operator, and authorizer variables strictly store unique addresses.
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 Vistapex team provided an overview of their Perpetuals system comprising of off-chain and on-chain components, with main focus on the on-chain smart contracts and their functionality. Additionally, the team addressed all questions and concerns raised by the Nethermind Security team, providing valuable insights and an in-depth understanding of the project's technical aspects.
| 153Tests 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