Purpose
PhEVM checks assertions against transaction state changes. See Execution Model for triggers and snapshots.Key Capabilities
State Access
PhEVM can access blockchain state at multiple points during transaction execution:- Pre-transaction state: The blockchain state before the transaction executes
- Post-transaction state: The blockchain state after the transaction executes
- Pre-call state: State before a specific internal call within the transaction
- Post-call state: State after a specific internal call within the transaction
Cheatcodes
PhEVM implements special precompiles called cheatcodes that provide capabilities beyond standard EVM operations:- Snapshot reads:
loadStateAtwith explicitForkIdvalues for pre-transaction, post-transaction, pre-call, and post-call state - Call introspection: Access to call inputs, call traces, and execution context
- State change tracking: Monitor storage slot modifications during execution
- Log access: Retrieve transaction logs for enforcement
credible-std library and documented in the Cheatcodes Reference.
Off-Chain Execution
PhEVM runs offchain with these execution properties:- Higher gas limits: Assertions can perform complex computations that would be prohibitively expensive on-chain
- Off-chain assertion gas: Assertion execution does not consume Ethereum block gas. Credible-block markers and on-chain guard checks have separate gas costs.
- Parallel execution: Multiple assertions can execute simultaneously

