Skip to main content
Track storage state changes for smart contracts to monitor specific storage slots, analyze contract state evolution, or track ownership changes.

Use Case

State diff tracking enables you to:
  • Monitor specific storage slots (e.g., owner, balance mappings)
  • Track contract state evolution over time
  • Analyze state changes without replaying transactions
  • Build state-based analytics

Code Example

Try it yourself with the interactive query interface below:

Key Parameters

State diffs capture all storage changes that occurred in a block, providing a complete picture of contract state evolution.

Expected Output

Filter by Contract

Track state changes for a specific contract:

Understanding Change Types

The kind field indicates the type of state change:

Track Specific Storage Slots

Monitor a specific storage slot (e.g., owner variable):
For mappings, the storage key is computed as keccak256(abi.encode(mappingKey, slot)). You’ll need to compute this off-chain to track specific mapping entries.

Monitor Balance Changes

Track balance mapping changes for ERC-20 tokens:

Performance Tips

  1. Filter by contract: Always specify contract addresses to reduce data volume
  2. Post-filter keys: Filter specific storage keys in your application
  3. Understand data volume: State diffs can be very large for active contracts
  4. Combine with logs: Use event logs to identify interesting blocks, then query state diffs
State diffs can generate massive amounts of data, especially for busy contracts. Always filter by specific contract addresses.

Common Use Cases

Track Governance Changes

Monitor governance parameter changes:

Monitor Oracle Updates

Track price oracle state updates:

Audit Storage Access

Analyze which storage slots are frequently accessed:

Query Event Logs

Track smart contract events

Query Transactions

Monitor transaction activity

Query Traces

Analyze internal transactions

API Reference

View complete API docs