Skip to main content

Contract reads

Read-only contract calls are the most direct way to inspect current PressChain state. They require no signer and are suitable for public pages, backend verification, server rendering and indexer reconciliation.

Evidence reads

A minimal ABI can include only the functions a feature needs:
These functions are present in CapsuleEvidenceRegistryV3.

Contributor reads

These functions are useful both for presentation and for transaction preflight.

Read with ethers

Load EVIDENCE_ADDRESS from the approved deployment manifest for the current environment. Do not copy an address from an old script or archived configuration.

Pin a block for consistent exports

If several related reads must represent exactly one chain state, first resolve a block and execute all reads against that block tag. This is useful for audit exports or reproducible reports. For ordinary interactive pages, latest is usually appropriate.

Decode reverts

View calls can revert for missing or invalid records. When the ABI includes custom errors, decode them. The evidence registry defines errors such as EvidenceMissing(uint256) and CapsuleMissing(bytes32). A missing record should render as a domain-specific not-found state rather than a generic “RPC unavailable” message.

Cache based on mutability

Immutable historical data can be cached aggressively. Current active flags, open tallies and role state require shorter caching or event-driven invalidation. Do not cache a tally forever just because the underlying evidence artifact is immutable.