Skip to main content
A price can leave its allowed range and return before transaction end. Comparing only transaction endpoints misses that excursion.

Policy and scope

OracleSnapshotsAssertion below compares slot zero after every covered updatePrice(uint256) call with its pre-transaction value. It permits an absolute difference of at most start / 10, using integer rounding. A zero starting price therefore permits only zero. The 10% band illustrates behavior; it is not a recommended market threshold.

Tested example

The complete fixture and tests are in examples/docs in the documentation repository. The three assertions were exercised with PCL 1.9.0, Solidity 0.8.29, and credible-std fe49de6dcddb8ea1f77ea2828a0c9d7d5f923db0 on Linux ARM64 (November 17, 2026): 14 tests pass, including four fuzz tests with 256 runs each. This establishes local behavior, not production dispatch or historical exploit prevention.

Scenarios

Adaptation requirements

The fixture has one price slot and one update path. A real lending policy must inspect the value consumed by the borrow or liquidation, including external oracle calls, scaling, freshness, replacement, and reverted calls. An external update that never touches the adopter requires separate trigger coverage. See Call Frame Context.

Legacy source

The pinned upstream ass28 constructs fork identifiers without using them in its direct getter reads. It is retained in the import inventory for provenance, but is no longer displayed as the working example. The replacement passes the observation point into loadStateAt explicitly.