StateChanges
Inherits: Credible
Title: StateChanges
Helper contract for converting state changes from bytes32 arrays to typed arrays
Inherits from Credible to access the PhEvm interface
Functions
getStateChangesUint
Converts state changes for a slot to uint256 array
function getStateChangesUint(address contractAddress, bytes32 slot) internal view returns (uint256[] memory);
Parameters
| Name | Type | Description |
|---|---|---|
contractAddress | address | The address of the contract to get state changes from |
slot | bytes32 | The storage slot to get state changes for |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256[] | Array of state changes as uint256 values |
getStateChangesAddress
Converts state changes for a slot to address array
function getStateChangesAddress(address contractAddress, bytes32 slot) internal view returns (address[] memory);
Parameters
| Name | Type | Description |
|---|---|---|
contractAddress | address | The address of the contract to get state changes from |
slot | bytes32 | The storage slot to get state changes for |
Returns
| Name | Type | Description |
|---|---|---|
<none> | address[] | Array of state changes as address values |
getStateChangesBool
Converts state changes for a slot to boolean array
function getStateChangesBool(address contractAddress, bytes32 slot) internal view returns (bool[] memory);
Parameters
| Name | Type | Description |
|---|---|---|
contractAddress | address | The address of the contract to get state changes from |
slot | bytes32 | The storage slot to get state changes for |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bool[] | Array of state changes as boolean values |
getStateChangesBytes32
Gets raw state changes as bytes32 array
function getStateChangesBytes32(address contractAddress, bytes32 slot) internal view returns (bytes32[] memory);
Parameters
| Name | Type | Description |
|---|---|---|
contractAddress | address | The address of the contract to get state changes from |
slot | bytes32 | The storage slot to get state changes for |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bytes32[] | Array of state changes as bytes32 values |
getSlotMapping
Calculates the storage slot for a mapping with a given key and offset
function getSlotMapping(bytes32 slot, uint256 key, uint256 offset) private pure returns (bytes32);
Parameters
| Name | Type | Description |
|---|---|---|
slot | bytes32 | The base storage slot of the mapping |
key | uint256 | The key in the mapping |
offset | uint256 | Additional offset to add to the calculated slot |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bytes32 | The storage slot for the mapping entry |
getStateChangesUint
Gets uint256 state changes for a mapping entry
function getStateChangesUint(address contractAddress, bytes32 slot, uint256 key)
internal
view
returns (uint256[] memory);
Parameters
| Name | Type | Description |
|---|---|---|
contractAddress | address | The contract address |
slot | bytes32 | The mapping's slot |
key | uint256 | The mapping key |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256[] | Array of state changes as uint256 values |
getStateChangesAddress
Gets address state changes for a mapping entry
function getStateChangesAddress(address contractAddress, bytes32 slot, uint256 key)
internal
view
returns (address[] memory);
Parameters
| Name | Type | Description |
|---|---|---|
contractAddress | address | The contract address |
slot | bytes32 | The mapping's slot |
key | uint256 | The mapping key |
Returns
| Name | Type | Description |
|---|---|---|
<none> | address[] | Array of state changes as address values |
getStateChangesBool
Gets boolean state changes for a mapping entry
function getStateChangesBool(address contractAddress, bytes32 slot, uint256 key)
internal
view
returns (bool[] memory);
Parameters
| Name | Type | Description |
|---|---|---|
contractAddress | address | The contract address |
slot | bytes32 | The mapping's slot |
key | uint256 | The mapping key |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bool[] | Array of state changes as boolean values |
getStateChangesBytes32
Gets bytes32 state changes for a mapping entry
function getStateChangesBytes32(address contractAddress, bytes32 slot, uint256 key)
internal
view
returns (bytes32[] memory);
Parameters
| Name | Type | Description |
|---|---|---|
contractAddress | address | The contract address |
slot | bytes32 | The mapping's slot |
key | uint256 | The mapping key |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bytes32[] | Array of state changes as bytes32 values |
getStateChangesUint
Gets uint256 state changes for a mapping entry with offset
function getStateChangesUint(address contractAddress, bytes32 slot, uint256 key, uint256 slotOffset)
internal
view
returns (uint256[] memory);
Parameters
| Name | Type | Description |
|---|---|---|
contractAddress | address | The contract address |
slot | bytes32 | The mapping's slot |
key | uint256 | The mapping key |
slotOffset | uint256 | Additional offset to add to the slot |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256[] | Array of state changes as uint256 values |
getStateChangesAddress
Gets address state changes for a mapping entry with offset
function getStateChangesAddress(address contractAddress, bytes32 slot, uint256 key, uint256 slotOffset)
internal
view
returns (address[] memory);
Parameters
| Name | Type | Description |
|---|---|---|
contractAddress | address | The contract address |
slot | bytes32 | The mapping's slot |
key | uint256 | The mapping key |
slotOffset | uint256 | Additional offset to add to the slot |
Returns
| Name | Type | Description |
|---|---|---|
<none> | address[] | Array of state changes as address values |
getStateChangesBool
Gets boolean state changes for a mapping entry with offset
function getStateChangesBool(address contractAddress, bytes32 slot, uint256 key, uint256 slotOffset)
internal
view
returns (bool[] memory);
Parameters
| Name | Type | Description |
|---|---|---|
contractAddress | address | The contract address |
slot | bytes32 | The mapping's slot |
key | uint256 | The mapping key |
slotOffset | uint256 | Additional offset to add to the slot |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bool[] | Array of state changes as boolean values |
getStateChangesBytes32
Gets bytes32 state changes for a mapping entry with offset
function getStateChangesBytes32(address contractAddress, bytes32 slot, uint256 key, uint256 slotOffset)
internal
view
returns (bytes32[] memory);
Parameters
| Name | Type | Description |
|---|---|---|
contractAddress | address | The contract address |
slot | bytes32 | The mapping's slot |
key | uint256 | The mapping key |
slotOffset | uint256 | Additional offset to add to the slot |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bytes32[] | Array of state changes as bytes32 values |