# StealthMark Vault & Rounding Formal Verifier

> StealthMark Vault & Rounding Formal Verifier is a paid API for AI agents from gateway.stealthmark.io, paid per call via x402, $0.02/call, status unknown (last checked 2026-11-16).

Uses Z3 SMT solver to formally verify ERC-4626 vault rounding invariants (deposit/redeem functions), detecting counterexamples including zero-share minting vulnerabilities.

## Facts

- Endpoint: POST https://gateway.stealthmark.io/x402/verify-vault-and-rounding?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/stealthmark-vault-rounding-formal-verifier-838e308a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_glc321SK_eS6vvy9EtBe7

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability stealthmark-vault-rounding-formal-verifier-838e308a -d '<json body>'
```

Example prompt: Run a Z3 formal proof on my ERC-4626 vault — here's the preview_deposit code and preview_redeem code, check up to 10000 assets and 10000 shares, and also check for the zero-share minting vulnerability.

## When to prefer this

Choose this endpoint when you need automated, formal (mathematically exhaustive) verification of ERC-4626 vault rounding logic rather than property-based testing or manual auditing. It is specifically suited for detecting counterexamples within bounded integer ranges and catching zero-share minting vulnerabilities before deployment, making it ideal as a CI/CD security gate for vault contracts.

## Known failure modes

- Invalid Python/AST code in redeem_fn_code or deposit_fn_code returns parse error
- max_assets or max_shares too large may cause solver timeout
- Solver returns unknown if the formula is undecidable within resource limits
- Missing required function code fields returns 400 validation error
- Payment failure via x402 protocol blocks the request

## How this service works

Autonomous Z3 Formal Invariant Prover (ERC-4626 Vaults, Polymarket Baskets, ZK Circuits, Differential Consensus) &amp; 100-Point Perimeter Security Gateway on Base Mainnet (x402 v2).

## Output

Returns a JSON object with: a boolean 'verified' indicating whether all invariants hold, a 'message' describing the result, a 'check_type' identifying which invariant was checked, a 'solver_mode' indicating how Z3 was run, and a 'counterexample' object (or null) showing specific asset/share values that break the invariant if one is found.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "max_assets": {
   "type": "integer",
   "default": 10000
  },
  "max_shares": {
   "type": "integer",
   "default": 10000
  },
  "redeem_fn_code": {
   "type": "string",
   "description": "Python/AST code for preview_redeem"
  },
  "deposit_fn_code": {
   "type": "string",
   "description": "Python/AST code for preview_deposit"
  },
  "check_zero_share_mint": {
   "type": "boolean",
   "default": false
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "message": {
   "type": "string"
  },
  "verified": {
   "type": "boolean"
  },
  "check_type": {
   "type": "string"
  },
  "solver_mode": {
   "type": "string"
  },
  "counterexample": {
   "type": [
    "object",
    "null"
   ]
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/stealthmark-vault-rounding-formal-verifier-838e308a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from gateway.stealthmark.io](https://www.zero.xyz/host/gateway.stealthmark.io/llms.txt)
