> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tori.finance/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Pages whose paths begin with /zh-Hans/, /ja/, /ko/, /vi/, /id/, /hi/, /pt-BR/ or /es/ are machine translations of the English pages, provided for convenience only. They may contain errors or omissions and have no legal effect, and where one differs from the English page, the English page prevails. For anything that will be relied on, read and cite the English page at the same path without the language prefix.

# Formal Verification

> 87 security properties of Tori's contracts are proven by symbolic execution on every code change. What is proven, under which bounds, what is not, and what the work found.

An audit is a review at one point in time. Formal verification is a different kind of check: a
property of the code, such as "only the minter can increase the trUSD supply", is stated precisely
and a tool then searches for any input that breaks it. If none exists within the stated bounds, the
property is proven. This is stronger than a test, which tries the inputs somebody thought of, and
stronger than fuzzing, which tries many random ones.

Tori's contracts carry 87 such properties. They are checked with
[Halmos](https://github.com/a16z/halmos), a symbolic execution tool for Solidity, and they run again
on every change to the contracts. The properties and the workflow that runs them are public in the
[contracts repository](https://github.com/Tori-Finance/tori-contracts/tree/main/test/halmos).

## What is covered

| Contracts | Properties | What they are about |
| - | - | - |
| trUSD | 11 | Who can mint, who can move a balance, who can upgrade |
| strUSD vault | 21 | Cooldown limits, the blacklist, reward vesting, the daily loss cap, access control, the minimum share supply |
| Minting and redemption | 19 | Per-block caps, order signatures, nonces, recipients, custody routing, the kill switch |
| Timelock | 10 | The delay and its bounds, the split of roles, who can schedule, cancel and execute |
| PendleYTLock | 13 | Paused withdrawals, backing of principal and yield, the mode without yield, access control |
| Silo and rewards distributor | 7 | Who can move funds, coverage of open unstake requests |
| Bridged strUSD | 6 | Supply control and the blacklist on the bridged token |

## Examples of what is proven

Each line below holds for every caller and every argument, within the bounds in the next section.

**trUSD**

* Nobody but the minter can increase the total supply.
* A balance goes down only by a call from its holder or from an address the holder approved.
* Only the timelock can upgrade the contract. The admin cannot take the timelock's role or change the minter.

**strUSD**

* A reward does not change the share price in the block it arrives, so it cannot be captured by depositing just before it.
* The cooldown can never be set above 90 days, and no unstake request can end more than 90 days out.
* An unstake request cannot be claimed before its cooldown ends.
* The silo always holds at least the sum of every open unstake request.
* A blacklisted address cannot send or receive shares.
* A loss report above 5% of the vault's assets is refused, and so is a second report within 24 hours.

**Minting and redemption**

* Two mints in the same block never exceed the global cap or the per-asset cap. The same holds for redemptions.
* An order executes only with the sender's signature over exactly that order. Changing any field, or the chain, changes what must be signed.
* A used nonce can never be used again.
* trUSD and collateral go only to the sender or to a recipient the sender approved on-chain. Collateral from a mint goes only to registered custodians.
* After the gatekeeper's kill switch, no mint or redemption succeeds. The gatekeeper can remove powers and never grant them.

**Timelock**

* No operation executes earlier than the delay after it was scheduled.
* The delay always stays between 1 and 30 days, whatever governance executes.
* A custodian can be added to minting only by an operation that waited out the delay.

**PendleYTLock**

* While withdrawals are paused, nobody can withdraw or redeem.
* The locked YT always covers the lock's total assets.
* A lock set up without yield distribution cannot have it turned on later, and every yield function reverts on it.

**Bridged tokens**

* Only a granted minter, which is the bridge's token pool, can increase the supply of bridged strUSD, and never above its maximum supply.
* A blacklisted balance on a bridged chain can be moved only by the owner.

## How to read "proven"

A proof holds within bounds, and the bounds matter as much as the result.

| Bound | What it means |
| - | - |
| One call per property | Each property is checked across any single call. Sequences are covered where they matter: two mints in one block, schedule then execute, deposit then harvest. |
| Lists of up to two elements | Batch functions are covered for zero, one or two entries. Loops are followed three times. |
| Signatures | The tool cannot reason about elliptic curve signatures. The properties prove that an order needs the sender's signature over exactly its own hash, and that the hash covers every field. That a signature cannot be forged is the standard ECDSA assumption. |
| Arithmetic | Multiplying and dividing two unknown 256-bit numbers is beyond the solvers. Where a property depends on such arithmetic, one side comes from a fixed set of values, and the property is marked as bounded. |
| Minting prices | Order properties are proven for orders priced at par. Caps, nonces, signatures and recipients do not depend on the price. |

Of the 87 properties, most hold for all inputs within the first three bounds. The rest carry one
extra bound of the kind in the last two rows.

## What is not proven

Formal verification does not replace the other layers. These properties are outside the suite today
and are covered by invariant and fuzz tests instead:

* Rounding in the strUSD vault: that conversions round in the vault's favour and that a deposit followed by a redemption never profits.
* The share price inside the 8-hour vesting window, and a loss reported while rewards are still vesting.
* Minting and redemption at a price other than par.
* The yield reserve of PendleYTLock after an arbitrary call. The deposit path is proven.

The suite checks the contracts' own logic. It does not cover Chainlink's CCIP token pools, Pendle,
or any other third-party contract, and it says nothing about the off-chain systems.

## Versions

The suite runs against the source of the deployed versions: strUSD 1.1.0, PendleYTLock 4.0.0 (the locks that mature in February 2027) and the current timelock. The two locks that mature on 26 November 2026 run earlier versions of PendleYTLock and are not covered.

## What it found

Writing the properties surfaced two issues. Neither can be used by an outside party.

| Finding | Severity | Status |
| - | - | - |
| The strUSD owner can put itself on the blacklist through the generic role function, although the dedicated blacklist functions refuse it. Only the owner can do this, and it is undone in one transaction. | Low | Noted |
| A timelock role holder could renounce its own role. Because the timelock has no admin, a renounced role can never be granted again, which would stop every operation behind the timelock. It needs a transaction from the proposer Safe or the executor itself. | Medium | Fixed. The timelock was replaced by a version that refuses the call, and the roles were moved to it. |

## Continuous checking

Every property runs on each change to the contracts, before the change can be merged. A
counterexample fails the run. So does a solver timeout, or a property whose paths all revert, so a
property cannot pass by proving nothing.

Each property was also run against a deliberately broken copy of the code, with a guard removed or
a bound changed, and had to fail there. A property that still passes on broken code is not checking
what it claims to.

Formal verification sits alongside the [audits and the bug bounty](https://docs.tori.finance/security/audits.md), not in place
of them.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.