Returns all instances where contracts' storage mappings include a given address, in the spirit of the FOIA (Freedom of Information Act)

Parameters

  1. address (address as hex string, default: 0x48D004a6C175dB331E99BeAf64423b3098357Ae7)
  2. chain_id (uint64, default: 0)
    1. Optional. Can be used to view information from a certain chain. If unset, defaults to 0 and returns results from all chains.
  3. block_number (uint64, default: 0)
    1. Optional. Can be used to view information at a particular block. If unset, defaults to 0 and returns latest.
  4. limit (uint32, default: 100)
    1. Number of records you want returned.
  5. offset (uint32, default: 0)
    1. For pagination. If you're showing ten records per page, choose offset = 9 for the second page.

Returns

Array with the following fields from @sim.mapping_storage_writes:

  1. block_number
  2. chain_id
  3. contract_address
  4. entry_slot
  5. global_counter
  6. key_1_type
  7. key_1_value
  8. key_2_type
  9. key_2_value
  10. key_3_type
  11. key_3_value
  12. txn_hash
  13. value_after
  14. value_before
  15. value_type
  16. variable_name
  17. variable_slot

Query

SELECT *
FROM @sim.mapping_storage_writes
WHERE (
    key_1_value = lower($address)
    OR key_2_value = lower($address)
    OR key_3_value = lower($address)
  )
  AND (
    chain_id = $chain_id
    OR $chain_id = 0
  )
  AND (
    block_number <= $block_number
    OR $block_number = 0
  )
LIMIT $limit OFFSET $offset