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
Ensures protocols maintain proper security controls during emergency pause states, allowing existing users to withdraw funds while preventing new deposits. Critical for yield aggregators and vaults (Yearn, Beefy), lending protocols with pause mechanisms, DEXs with emergency circuit breakers, cross-chain bridges with pause functionality, and any protocol with emergency pause capabilities. Improper handling of pause states can lead to fund lockups, unauthorized access, or users being unable to exit during emergencies.What This Pattern Checks
Monitors protocol balance and pause state to ensure proper emergency behavior using a multi-layered approach:_preTx()/_postTx()with Reshiram snapshot reads: Capture protocol state before and after transactionph.loadStateAt(): Read the pause and balance slots at pre-transaction and post-transaction snapshotsregisterFnCallTrigger(): Monitor all function calls to the contract- Verify protocol balance can only decrease when paused (allowing withdrawals)
- Detect unauthorized modifications during pause periods
Note: In the future, this assertion could be optimized with a new trigger type that only fires when a specific storage slot has a specific value (e.g., when the pause flag is true). This would reduce unnecessary assertion checks and improve efficiency.For more information about cheatcodes, see the Cheatcodes Documentation.
Assertion Pattern
Full examples and mock protocol code are available in credible-std.

