Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/PhEvm.sol
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ interface PhEvm {
bytes input;
}

/// @notice Identifies a read-only transaction snapshot.
/// @dev forkType: 0 = PreTx, 1 = PostTx, 2 = PreCall, 3 = PostCall
/// callIndex is used only for call-scoped snapshots.
struct ForkId {
uint8 forkType;
uint256 callIndex;
}
Comment thread
makemake-kbo marked this conversation as resolved.

/// @notice Fork to the state before the assertion-triggering transaction
/// @dev Allows inspection of pre-transaction state for comparison
function forkPreTx() external;
Expand All @@ -81,6 +89,22 @@ interface PhEvm {
/// @return data The value stored at the slot
function load(address target, bytes32 slot) external view returns (bytes32 data);

/// @notice Read a storage slot from the current assertion adopter at a snapshot.
/// @param slot The storage slot to read.
/// @param fork The snapshot fork to read from.
/// @return value The raw 32-byte value at the slot.
function loadStateAt(bytes32 slot, ForkId calldata fork) external view returns (bytes32 value);

/// @notice Read a storage slot from any account at a snapshot.
/// @param target The address to read storage from.
/// @param slot The storage slot to read.
/// @param fork The snapshot fork to read from.
/// @return value The raw 32-byte value at the slot.
function loadStateAt(address target, bytes32 slot, ForkId calldata fork)
external
view
returns (bytes32 value);

/// @notice Get all logs emitted during the transaction
/// @dev Returns logs in emission order
/// @return logs Array of Log structs containing all emitted events
Expand Down Expand Up @@ -136,4 +160,5 @@ interface PhEvm {
/// @dev Returns the transaction envelope data for the assertion-triggering tx
/// @return txObject The transaction data struct
function getTxObject() external view returns (TxObject memory txObject);

}
Loading