Vistapex

Vistapex runs perpetual futures on Avalanche, settling in pooled USDC and posting SP1 proofs of its trading state on-chain. Both contracts behind that, the deposit pool and the state verifier, were in scope.
report id
0988
category
DeFi & Yield
language
Solidity
final report
August 21, 2026
lines of code
484
Content

View Audit Report

1

Executive Summary

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 TypeSecurity Review
Initial ReportAugust 21, 2026
Final ReportAugust 21, 2026
Initial Commitc22dd9cbd1c
Final Commit9da7c5ffca
Documentation AssessmentMedium
Test Suite AssessmentHigh
Total findings
5
Fixed
5
Acknowledged
0
Mitigated
0
Unresolved
0

Findings by severity

  • Critical0
  • High0
  • Medium0
  • Low0
  • Undetermined0
  • Informational4
  • Best Practices1

2

Audited Files

#ContractLoCCommentsRatioBlankTotal
1PerpsStateVerifier.sol232273117.7%54559
2DepositPool.sol25221384.5%67532
Total484486100.4%1211091

4

System Overview

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.

4.1 DepositPool

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.

4.2 PerpsStateVerifier

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.

4.3 Administrative Controls and Trust Assumptions

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.

5

Risk Rating Methodology

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:

  1. High: the issue is trivial to exploit and has no specific conditions that need to be met;
  2. Medium: the issue is moderately complex and may have some conditions that need to be met;
  3. Low: the issue is very complex and requires very specific conditions to be met.

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:

  1. High: the issue can cause significant damage, such as loss of funds or the protocol entering an unrecoverable state;
  2. Medium: the issue can cause moderate damage, such as impacts that only affect a small group of users or only a particular part of the protocol;
  3. Low: the issue can cause little to no damage, such as bugs that are easily recoverable or cause unexpected interactions that cause minor inconveniences.

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 / LikelihoodLowMediumHigh
HighMediumHighCritical
MediumLowMediumHigh
LowInfo / Best PracticesLowMedium
UndeterminedUndeterminedUndeterminedUndetermined

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.

  1. Informational findings do not pose any risk to the application, but they carry some information that the audit team intends to pass to the client formally;
  2. Best Practice findings are used when some piece of code does not conform with smart contract development best practices;
  3. Undetermined findings are used when we cannot predict the impact or likelihood of the issue.

6

Issues

6.1 Calling pause(...) and unpause(...) without checking current state leads to redundant event emissions

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.

6.2 Defensive balance-check pattern in deposit() is unnecessary for standard USDC

FileFix commitTypeStatus
src/DepositPool.sol9da7c5fInfoFixed

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.

6.3 Ownership transfer does not revoke pending operational-role nominations across both contracts

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.

6.4 Role rotation functions do not check that the new address differs from the current one

FileFix commitTypeStatus
src/DepositPool.sol9da7c5fInfoFixed

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.

6.5 Missing enforcement of distinct addresses between owner and operator/authorizer roles

FileFix commitTypeStatus
src/DepositPool.sol
src/PrepsStateVerifier.sol
9da7c5fBest PracticesFixed

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.

7

Documentation Evaluation

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:

  • Technical whitepaper: A technical whitepaper is a comprehensive document describing the smart contract’s design and technical details. It includes information about the purpose of the contract, its architecture, its components, and how they interact with each other;
  • User manual: A user manual is a document that provides information about how to use the smart contract. It includes step-by-step instructions on how to perform various tasks and explains the different features and functionalities of the contract;
  • Code documentation: Code documentation is a document that provides details about the code of the smart contract. It includes information about the functions, variables, and classes used in the code, as well as explanations of how they work;
  • API documentation: API documentation is a document that provides information about the API (Application Programming Interface) of the smart contract. It includes details about the methods, parameters, and responses that can be used to interact with the contract;
  • Testing documentation: Testing documentation is a document that provides information about how the smart contract was tested. It includes details about the test cases that were used, the results of the tests, and any issues that were identified during testing;
  • Audit documentation: Audit documentation includes reports, notes, and other materials related to the security audit of the smart contract. This type of documentation is critical in ensuring that the smart contract is secure and free from vulnerabilities.

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.

8

Remarks & Test Suite

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.

Test suite
153Tests passed0Failed

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.