Skip to content

Instantly share code, notes, and snippets.

@0xalpharush
Last active November 8, 2021 03:36
Show Gist options
  • Save 0xalpharush/46a37ce3ac792159ec145294191e5d59 to your computer and use it in GitHub Desktop.
Save 0xalpharush/46a37ce3ac792159ec145294191e5d59 to your computer and use it in GitHub Desktop.
import sys
from slither import Slither
assert len(sys.argv) == 2
address = sys.argv[1]
slither = Slither(address)
for contract in slither.contracts_derived:
for var in contract.variables:
if not var.is_constant and not var.is_immutable:
(slot, offset) = contract.compilation_unit.storage_layout_of(
contract, var
)
print(var.name, "slot", slot, "offset", offset)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment