{"id":28017172,"url":"https://github.com/duneanalytics/storage-layout-extractor","last_synced_at":"2025-06-10T10:42:08.954Z","repository":{"id":203320313,"uuid":"634935056","full_name":"duneanalytics/storage-layout-extractor","owner":"duneanalytics","description":"A tool that performs extraction of storage layouts based on EVM bytecode.","archived":false,"fork":false,"pushed_at":"2024-01-19T19:37:37.000Z","size":979,"stargazers_count":142,"open_issues_count":18,"forks_count":12,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-06-03T10:47:47.820Z","etag":null,"topics":["analysis","decompiler","evm","evm-bytecode"],"latest_commit_sha":null,"homepage":"https://smlxl.io","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/duneanalytics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-01T15:30:51.000Z","updated_at":"2025-05-21T13:01:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"eae71262-32d7-4619-af99-ac780c11091b","html_url":"https://github.com/duneanalytics/storage-layout-extractor","commit_stats":null,"previous_names":["smlxl/storage-layout-extractor","duneanalytics/storage-layout-extractor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fstorage-layout-extractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fstorage-layout-extractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fstorage-layout-extractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fstorage-layout-extractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duneanalytics","download_url":"https://codeload.github.com/duneanalytics/storage-layout-extractor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fstorage-layout-extractor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259058152,"owners_count":22799307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analysis","decompiler","evm","evm-bytecode"],"created_at":"2025-05-10T10:01:46.559Z","updated_at":"2025-06-10T10:42:08.945Z","avatar_url":"https://github.com/duneanalytics.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"\u003cp align=center\u003e\n  \u003cimg src=\"https://avatars.githubusercontent.com/u/90545451?s=200\u0026v=4\"/\u003e\n\u003c/p\u003e\n\n# EVM Storage Layout Extractor\n\nThis project is a library that is able to ingest [EVM](https://ethereum.org/en/developers/docs/evm/)\n[bytecode](https://ethereum.org/en/developers/docs/evm/opcodes/) and discover an approximate storage\nlayout for the contract described by that bytecode. It is _not_ intended to be a full decompiler,\nbut is instead a tool **highly** specialised for performing this discovery process. \n\nSee our [announcement](https://blog.smlxl.io/announcing-bytecode-generated-storage-layouts-on-evm-storage-96761758d397) for more details\nor check the [deepdive post on our blog.](https://blog.smlxl.io/a-deep-dive-into-our-storage-layout-extractor-51554185d8af)\n\nThis discovery process is performed, in broad strokes, as follows:\n\n1. Bytecode is ingested and disassembled into an instruction stream that is amenable to analysis.\n   This is a sequence of Opcodes that is equivalent to the bytecode.\n2. The stream of instructions is executed symbolically on a specialised EVM implementation. This\n   execution is both **speculative** and **total**, exploring all possible code paths that can\n   influence the type attributed to a given storage location.\n3. For each value seen in the program during execution, the VM builds a **symbolic value** (a little\n   tree structure) that represents the operations performed to that particular piece of \"data\".\n4. These execution trees are passed to a type inference process. This process starts by _lifting_,\n   which turns low-level constructs into more-general high-level ones. The results of this are then\n   fed to _inference rules_ that output **type inference judgements** about the trees they analyse.\n   Finally, these inferences are combined with a _unifier_ to perform whole-program type inference.\n5. The resolved types associated with each storage slot are then turned into a **storage layout**\n   that describes the type of each storage slot that was encountered.\n\nFor more information on the process with specific reference to concrete pieces of code, see the\ndocumentation in [`lib.rs`](src/lib.rs). This also provides a basic usage example for the library,\nthough more complex ones can be found in the [tests](tests).\n\n## Extending the Library\n\nThe primary means of extending this library to get better layouts is by extending the type inference\nengine. This is done by either writing new **lifting passes** or **inference rules**, and you can\nfind more information on this process in the documentation\non [extending the library](./docs/Extending%20the%20Library.md).\n\n## Contributing\n\nIf you want to contribute code or documentation (non-code contributions are _always_ welcome) to\nthis project, please take a look at our [contributing](./docs/CONTRIBUTING.md) documentation. It\nprovides an overview of how to get up and running, as well as what the contribution process looks\nlike for the library. \nWe are also available on our [Telegram group](https://t.me/+zw0fuNoYg39hZWRh) if you have any questions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduneanalytics%2Fstorage-layout-extractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduneanalytics%2Fstorage-layout-extractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduneanalytics%2Fstorage-layout-extractor/lists"}