Skip to main content

Python bindings for storage-layout-extractor - EVM bytecode storage layout analysis

Project description

EVM Storage Layout Extractor

This project is a library that is able to ingest EVM bytecode and discover an approximate storage layout for the contract described by that bytecode. It is not intended to be a full decompiler, but is instead a tool highly specialised for performing this discovery process.

See our announcement for more details or check the deepdive post on our blog.

This discovery process is performed, in broad strokes, as follows:

  1. Bytecode is ingested and disassembled into an instruction stream that is amenable to analysis. This is a sequence of Opcodes that is equivalent to the bytecode.
  2. The stream of instructions is executed symbolically on a specialised EVM implementation. This execution is both speculative and total, exploring all possible code paths that can influence the type attributed to a given storage location.
  3. For each value seen in the program during execution, the VM builds a symbolic value (a little tree structure) that represents the operations performed to that particular piece of "data".
  4. These execution trees are passed to a type inference process. This process starts by lifting, which turns low-level constructs into more-general high-level ones. The results of this are then fed to inference rules that output type inference judgements about the trees they analyse. Finally, these inferences are combined with a unifier to perform whole-program type inference.
  5. The resolved types associated with each storage slot are then turned into a storage layout that describes the type of each storage slot that was encountered.

For more information on the process with specific reference to concrete pieces of code, see the documentation in lib.rs. This also provides a basic usage example for the library, though more complex ones can be found in the tests.

Extending the Library

The primary means of extending this library to get better layouts is by extending the type inference engine. This is done by either writing new lifting passes or inference rules, and you can find more information on this process in the documentation on extending the library.

Contributing

If you want to contribute code or documentation (non-code contributions are always welcome) to this project, please take a look at our contributing documentation. It provides an overview of how to get up and running, as well as what the contribution process looks like for the library. We are also available on our Telegram group if you have any questions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

storage_layout_extractor-0.6.3.tar.gz (374.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

storage_layout_extractor-0.6.3-cp312-cp312-win_amd64.whl (450.5 kB view details)

Uploaded CPython 3.12Windows x86-64

storage_layout_extractor-0.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

storage_layout_extractor-0.6.3-cp312-cp312-macosx_11_0_arm64.whl (578.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

storage_layout_extractor-0.6.3-cp312-cp312-macosx_10_12_x86_64.whl (602.1 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

storage_layout_extractor-0.6.3-cp311-cp311-win_amd64.whl (451.0 kB view details)

Uploaded CPython 3.11Windows x86-64

storage_layout_extractor-0.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

storage_layout_extractor-0.6.3-cp311-cp311-macosx_11_0_arm64.whl (579.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

storage_layout_extractor-0.6.3-cp311-cp311-macosx_10_12_x86_64.whl (604.1 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

storage_layout_extractor-0.6.3-cp310-cp310-win_amd64.whl (451.0 kB view details)

Uploaded CPython 3.10Windows x86-64

storage_layout_extractor-0.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

storage_layout_extractor-0.6.3-cp310-cp310-macosx_11_0_arm64.whl (579.9 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

storage_layout_extractor-0.6.3-cp310-cp310-macosx_10_12_x86_64.whl (604.1 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

File details

Details for the file storage_layout_extractor-0.6.3.tar.gz.

File metadata

  • Download URL: storage_layout_extractor-0.6.3.tar.gz
  • Upload date:
  • Size: 374.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for storage_layout_extractor-0.6.3.tar.gz
Algorithm Hash digest
SHA256 bf64e54862987df538e40dac57a57c5e39309e06abf0fc5119f03b37a4e86352
MD5 e74242f9dce6f1e33f35a69acfecfdb3
BLAKE2b-256 947891c9dd1633a7703cc8645044ea937f963cba913cf1f16d4b587e95734e24

See more details on using hashes here.

Provenance

The following attestation bundles were made for storage_layout_extractor-0.6.3.tar.gz:

Publisher: python-release.yml on jalbrekt85/storage-layout-extractor-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file storage_layout_extractor-0.6.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for storage_layout_extractor-0.6.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9eef79fd9c81635b52913d62d17c266baffadae52664a7e6eb1af859510f9a14
MD5 6aaf6e59681f9242e1099ccbb6dd9a0d
BLAKE2b-256 17e187d94f22114c31e1486d48646c56e8be8ff547b882166d9e7cc3a5f6e661

See more details on using hashes here.

Provenance

The following attestation bundles were made for storage_layout_extractor-0.6.3-cp312-cp312-win_amd64.whl:

Publisher: python-release.yml on jalbrekt85/storage-layout-extractor-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file storage_layout_extractor-0.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for storage_layout_extractor-0.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8313291061fd77e78486cf70babce2b832d355a3593d22ca0657265cc1f9965a
MD5 df87f2a15926f4af57c1357fa37a50ab
BLAKE2b-256 87965af10346ac9df9494d77bcb1fe9277a06835f14f7988a53156f0f35e2075

See more details on using hashes here.

Provenance

The following attestation bundles were made for storage_layout_extractor-0.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-release.yml on jalbrekt85/storage-layout-extractor-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file storage_layout_extractor-0.6.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for storage_layout_extractor-0.6.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c69b9fb973c7064a9040b7ab4905294407c88d4368e8c87dc32cf26258f7489f
MD5 61835025dfdd7a759a9712893bcd3b90
BLAKE2b-256 ece58a76b6ed41bb41dcdcd0ee452606e2429e250669e1869d1fd2205f857bb9

See more details on using hashes here.

Provenance

The following attestation bundles were made for storage_layout_extractor-0.6.3-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: python-release.yml on jalbrekt85/storage-layout-extractor-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file storage_layout_extractor-0.6.3-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for storage_layout_extractor-0.6.3-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d10e0def72fb75651660891950447a6c28d3618b71dc9f8f9bcf0a64b863602e
MD5 fa7fd934c4f6a7d8f31c233da94d7e2d
BLAKE2b-256 f9211a6357dfd4f7420995b173fec31ce3baf2f7882f968faa52945877287c20

See more details on using hashes here.

Provenance

The following attestation bundles were made for storage_layout_extractor-0.6.3-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: python-release.yml on jalbrekt85/storage-layout-extractor-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file storage_layout_extractor-0.6.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for storage_layout_extractor-0.6.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3fe4d5b858637d8718a766c8597bc46a79680c8b23dd4055848bccf371897c8e
MD5 641e324659670a9d6b3c8403d621cc3f
BLAKE2b-256 fa4cac7094c0ed84adeafd643a5cf8c29530f6bd4e7553e29d04127cb9804866

See more details on using hashes here.

Provenance

The following attestation bundles were made for storage_layout_extractor-0.6.3-cp311-cp311-win_amd64.whl:

Publisher: python-release.yml on jalbrekt85/storage-layout-extractor-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file storage_layout_extractor-0.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for storage_layout_extractor-0.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d40bf552b7bd92b01a812acbd4feb23cbf52bfc0797668e7ed9b5a36850ac52e
MD5 6e37c67b2884c23b1d0cf2f36a52d4eb
BLAKE2b-256 3e2450d3837ab9b45bacb46fef88b44af1cb88d86026c960207eda19430781d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for storage_layout_extractor-0.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-release.yml on jalbrekt85/storage-layout-extractor-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file storage_layout_extractor-0.6.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for storage_layout_extractor-0.6.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 860469bb6c9dacefcfa7953c2885c49b558b5812f77a965a25fb8e1824e7a804
MD5 734c82c6b56626647843769e5f038957
BLAKE2b-256 2d086b2018756715adfce634506dedc21414083f2fa5296dc8eb1b3450fe7a0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for storage_layout_extractor-0.6.3-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: python-release.yml on jalbrekt85/storage-layout-extractor-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file storage_layout_extractor-0.6.3-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for storage_layout_extractor-0.6.3-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1e08afdc2687a1d76a5b1ebef0f1b56ef29eb9d81bb790929112ea3ec7d9ad10
MD5 aa28c2e4f454a85461a1d39db9d23545
BLAKE2b-256 39ad3bdbea7830a7bb452e3aa1f8181ab3fa16683f80e71cfb5b2a847d273c57

See more details on using hashes here.

Provenance

The following attestation bundles were made for storage_layout_extractor-0.6.3-cp311-cp311-macosx_10_12_x86_64.whl:

Publisher: python-release.yml on jalbrekt85/storage-layout-extractor-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file storage_layout_extractor-0.6.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for storage_layout_extractor-0.6.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4760e6330937c220f5156aecbc968b9399a40765afe44c01b1b75a3216179e15
MD5 42209b5b239ffb2869a05a98c61ba6ae
BLAKE2b-256 8d3d9426573339aad6feb9b112ef841765438348d6728a0ae1b7bab3bcbc6da3

See more details on using hashes here.

Provenance

The following attestation bundles were made for storage_layout_extractor-0.6.3-cp310-cp310-win_amd64.whl:

Publisher: python-release.yml on jalbrekt85/storage-layout-extractor-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file storage_layout_extractor-0.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for storage_layout_extractor-0.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f6f47c8ee242418738d21d5a30bf5f4c72ed623b52cee58588f8478d505bb0d8
MD5 115d07587805d6e628fbc4ad24a50482
BLAKE2b-256 fc77bcd9dfe2c98cbc56a04c31fb61613dc7f6afec3a8003218642f56a70a662

See more details on using hashes here.

Provenance

The following attestation bundles were made for storage_layout_extractor-0.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-release.yml on jalbrekt85/storage-layout-extractor-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file storage_layout_extractor-0.6.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for storage_layout_extractor-0.6.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 08d696eba7558c006f146e1cd7a45ff361dd851ce4dbc36d959575f79d403d5c
MD5 1c3a740956fdd875b08e020ed60d775d
BLAKE2b-256 087e4cac060dc5c2233b6c922a92b84021cc97cb9535284c5893cfc7ef75afed

See more details on using hashes here.

Provenance

The following attestation bundles were made for storage_layout_extractor-0.6.3-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: python-release.yml on jalbrekt85/storage-layout-extractor-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file storage_layout_extractor-0.6.3-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for storage_layout_extractor-0.6.3-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f4ee5ffb17ebf89875810f84e4cd872e184fed578066ab2cd58e9fdcb32678fc
MD5 78d3d73515707c30aca69c4b1785f490
BLAKE2b-256 a47b0e143e10195d4c3c5bf87cbf9143285eb715f6d668a5fc7b81e6e2abf020

See more details on using hashes here.

Provenance

The following attestation bundles were made for storage_layout_extractor-0.6.3-cp310-cp310-macosx_10_12_x86_64.whl:

Publisher: python-release.yml on jalbrekt85/storage-layout-extractor-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page