# MCI30 V3 implementation and review status

5 October 2026. Compiled review candidate. Not independently audited or activated.

## Code added

- Mixed legacy SPL and Token-2022 reserve custody. Only plain tokens, metadata pointer/token metadata and transfer-fee configuration are accepted. Mint/freeze authorities, hooks and other extensions remain blocked.
- Checked transfers to canonical token accounts for the actual token program. The contract measures both the source debit and spendable destination credit. Withheld fees never count as backing.
- A separate V3 request account and instruction family. Existing V2 request encodings are preserved. No funded V2-to-V3 state migration is provided.
- Deposits gross up the current epoch fee to deliver the exact required backing, subject to a stored holder-signed debit limit. Both current and scheduled entry fees must be at most 5%.
- Refunds return only the recorded spendable contribution and can incur another transfer fee. Withdrawals reserve the gross entitlement and enforce signed minimum net receipts. Only the request owner, or the recorded controller authority for fee requests, can amend withdrawal minima.
- Higher issuer fees do not impose the entry ceiling on exits. A holder can explicitly accept a lower receipt; an arbitrary caller cannot lower it.
- Fee-adjusted replacement, weight-trade and creator-fee reserve-order instructions. Ratios and order quantities represent net delivery into the fund. The keeper signs its maximum incoming debit and minimum outgoing receipt.
- TypeScript fee arithmetic, epoch selection, quote helpers and V3 transaction builders. Four reserve transfers per funding chunk; withdrawal chunks with account creation are tested at two assets per transaction.
- A deterministic weight-drift planner using two agreeing prices, bounded turnover and one proposed trade at a time.
- A durable reconstitution driver for an explicitly approved monthly plan. It simulates by default, journals before broadcast, reconciles exact signatures, waits for finality and obeys the notice period. It never buys its own incoming inventory.

## What is verified

Application tests cover fee rounding/caps, inverse amounts, epoch changes, u64 boundaries, mint review, exact account/program bindings, request decoding, transaction size, bounded drift and ambiguous-send recovery. See `custody-v3-verification.json` for the exact results.

The approved private build completed with Rust 1.99.0, cargo-build-sbf 4.4.0 and platform-tools v1.57. Five Rust unit tests, 20 native runtime tests and all 22 compiled-SBF runtime tests passed. Two loader initialization tests intentionally run only against SBF; neither is skipped in the compiled suite.

Coverage includes all 30 mixed reserves, net-backed controller share creation, underfunded chunk rollback, concurrent deposits, refund losses, fee increases and owner-only amendments, extension/program rejection, net fee-order delivery and payment replay, weight exchanges, V3 initialization, and rejection of a legacy replacement path that could otherwise bypass the V3 execution window. The original legacy instruction is now limited to V2 vaults.

`contract-verification-2026-10-05-v3.json` records the compiler, test results, exact contract-source digest and binary hash. The 1,130,704-byte binary used the local test ID and SBPF v0, with solana-program-test 2.3.7. This establishes local execution, not compatibility with every currently activated mainnet feature. A production build must use the actual program ID and the SBPF/toolchain version accepted by the target cluster. Do not register this test hash as a production release.

The fund API/UI now selects V2 or V3 from the verified vault, derives accounts with each mint’s actual token program, excludes withheld fees from backing, and reviews gross debit/net credit. Movement quotes are checked again before transaction preparation. Withdrawals can be explicitly repriced by their owner after fee changes. Both legacy and mixed-token Worker integration runs pass against synthetic RPC and wallet fixtures; no real assets were moved.

Run the reproducible verification command in a Rust/Solana build environment:

```sh
node scripts/protocol/verify-contracts.mjs /absolute/private/verification-output
```

The command requires Rust, cargo-build-sbf and the locked dependencies; it does not install them. It runs native tests, removes any old local test binary, builds SBF with the lockfile, fingerprints the resulting binary, and runs the compiled program with all runtime tests. A failed step produces a failed report, not a release attestation. No mainnet transaction is sent.

## Work before V3 can serve users

1. Complete independent review of the exact source and production binary, including broader adversarial/fuzz coverage for account extensions, epochs, overflow, governance and liability isolation. This agent’s fixes and tests are not an independent audit.
2. Verify Token-2022 swap routes. The guarded automatic purchase path remains legacy-only. V3 custody and fee-order support do not authorize arbitrary routing transactions.
3. Connect the drift planner to a reviewed recurring weight-trade service. Monthly membership execution is implemented separately; it does not automatically align all portfolio weights.
4. Complete V3 deployment readiness/rent estimates and a full dry run of the operator against the intended deployment. The owner setup’s default compatibility/rent inspection remains V2-oriented; it must not be used to price a mixed-token launch.
5. Resolve the 11 supply findings and free-float exclusions. Do not replace absent circulating supply with minted supply or FDV.
6. After production review and a funding plan, deploy and initialize the real program, verify the registered fingerprint, fund a limited staged portfolio, and exercise recovery/monitoring before public use.

## Operator integration

`prepare-vault.mjs` accepts `vaultVersion: 3` for a new V3 vault, and reads the version from existing vaults. It prepares correct token accounts, gross deposit limits, net redemption/refund amounts and explicit withdrawal amendments. It never signs or broadcasts.

The reward operator now reads V3 fee flows, uses spendable inventory after transfer fees to calculate affordable shares, resumes deposits/refunds and issues backed MCI rewards. `purchaseMode: "inventory-only"` settles already-delivered inventory and leaves SOL purchase budgets unspent. The default `guarded-swaps` path still rejects Token-2022 purchases. The script’s integration has not been exercised with a funded live operator. These modes are not installed or running.

Candidate discovery accepts `--vault-version 3`, or the version read from a supplied deployed vault. A fresh exact-mint V3 review can satisfy the transfer-restriction check only; all identity, supply, liquidity, risk, concentration and price checks still apply. This does not change website membership.

## Supply evidence

`supply-evidence-2026-10-05-v3.json` contains checks for all 30 constituents and finalized mint observations at slot 453705864, observed 21:55 UTC. Nineteen pass the supply reconciliation. CATE and e/acc have no usable circulating-supply value in that response. The same-ID FARTBOY display-symbol difference (`$fartboy`) is reconciled without accepting arbitrary ticker aliases. Nine other estimates exceed finalized minted supply beyond the existing rounding tolerance. Those discrepancies remain open; the website's constituent selection was not silently changed.

Circulating estimates are still provider proxies, not an independent free-float audit. PONKE's set mint-authority field remains blocked. The companion `audit-supply.mjs` command repeats the reconciliation without changing membership or signing transactions.

## Operating the reconstitution driver

Start with the existing request fields (`programId`, `programSha256`, `programBytes`, `wallet`, `planPath`, `candidateReportPath`, `maximumValueLossBps`) and add `approvedPlanHash`, an absolute private `stateDirectory`, and, only for execution, `keypairPath` and `maximumNetworkFeeLamports` (5,000–1,000,000 lamports). Set the authenticated RPC through the private environment.

```sh
node --experimental-strip-types scripts/protocol/run-reconstitution.mjs /absolute/private/approved-run.json
```

Default execution only prepares and simulates. The optional `--execute` mode signs one step after all checks. A timer can repeat it; the supplied service remains preparation-only and is not installed. A failed/expired receipt or stale price stops the run. Expired proposals must be cancelled and replaced with freshly approved terms. The execution adapter now handles V2 and V3. V3 preparation verifies actual token accounts, maximum gross operator debit, minimum net receipt, current incoming-token controls and the one-hour execution window. Client tests cover these checks. No incoming inventory is purchased by this driver.

## Build environment

After the owner explicitly approved the private source transfer, only the 12-file contract/test/lockfile package was uploaded to the temporary private Vercel build environment. No signing keys or application credentials were included. The build environment was stopped after verification. The compact report and reproducible source are saved; the temporary local-ID binary is not offered as a deployable production artifact.

## Independent review

`security-review-scope.md` defines the reviewer brief. This package is not an independent report. No external reviewer has been hired or contacted, and no review cost has been incurred. Live monitoring, funding, reserve trading and mainnet deployment remain inactive.
