slot-reader

1.0.0 • Public • Published

Contract Storage Slot Reader

Currently only supports Ethereum contracts and first 20 slots.

./bin contains a prebuilt binary of Forge.

Usage

Create a foundry.toml file in the root directory with the following config:

[profile.slots]
src = 'node_modules/slot-reader/src'
out = 'node_modules/slot-reader/out'
libs = ['node_modules/slot-reader/lib']
test= 'node_modules/slot-reader/test'
cache_path='node_modules/slot-reader/cache'
rpc_endpoints = { eth = "https://rpc.ankr.com/eth"}

Alternatvely copy the foundry.toml from this package.

Set FOUNDRY_PROFILE=slots within your env.

Reads storage slots at latest block

import {readAllStorageSlots} from 'slot-reader'
readAllStorageSlots("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2")

Reads storage slots at given block

import {readAllStorageSlots} from 'slot-reader'
readAllStorageSlots("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", 17000000)

Readme

Keywords

none

Package Sidebar

Install

npm i slot-reader

Weekly Downloads

8

Version

1.0.0

License

MIT

Unpacked Size

32.1 MB

Total Files

60

Last publish

Collaborators

  • zilayo