Documentation Index
Fetch the complete documentation index at: https://docs.phylax.systems/llms.txt
Use this file to discover all available pages before exploring further.
When to Use This Pattern
Enforces a critical ERC4626 vault invariant: total shares must never exceed total assets converted to shares, preventing share price manipulation and fund loss. Critical for yield aggregators, lending protocols implementing ERC4626, liquidity pools using ERC4626 for LP tokens, and staking protocols with ERC4626 vaults. Any violation could allow unauthorized share minting that dilutes existing holders or enables withdrawal of more assets than deposited, potentially leading to protocol insolvency.What This Pattern Checks
Verifies the fundamental ERC4626 share-to-asset relationship using a basic approach:registerTxEndTrigger(): Trigger when total supply storage slot changes- Verify total assets are sufficient to back all outstanding shares
- Ensure share value is preserved and users can withdraw their assets
Assertion Pattern
Full examples and mock protocol code are available in credible-std.
Related Patterns
- ERC4626 Deposit and Withdraw Share Price: deposit and withdraw share-price checks

