GitHunt
0X

0xPolygon/storage-delta

Real-time smart contract storage auditor.

โŸ Storage Delta

Storage Delta is a tool for auditing storage layout changes during contract upgrades.

Demo

Install

Powered by Foundry.

forge install 0xPolygon/storage-delta

Run

Storage Delta analyzes the entire contract suite against any previous version.

bash lib/storage-delta/run.sh <COMMIT_OR_TAG>

./storage_delta will be generated if there are findings. Open OLD and NEW files side by side for the best experience.

Detectors

Description
๐ŸŒฑ New
๐Ÿด Problematic
๐Ÿณ๏ธ Moved
๐Ÿ Moved & problematic
๐Ÿชฆ Removed
Dirty bytes

New

When a variable with a unique name and type is added.

    uint256 a
    uint256 a
๐ŸŒฑ  bool b

Problematic

When a new variable is added, but conflicts with the existing storage.

    uint256 a
๐Ÿด  bool b

Moved

When an existing variable is moved.

    uint256 a
    ...
    ...
๐Ÿณ๏ธ  uint256 a

Moved & problematic

When an existing variable is moved and conflicts with the existing storage.

    uint256 a
    bool b
๐Ÿ  bool b
๐Ÿ  uint256 a

Removed

When a variable no longer exists.

    uint256 a
    bool b
    uint256 a
๐Ÿชฆ

Dirty bytes

When the storage is not clean.

    uint256 a
๐Ÿด  uint128 a
    16 dirty bytes

Configuration

Option Values Description
--omit new Do not generate a report with only those findings.

Requirements

Files should be named after the contract they hold. Example โ†’ Example.sol

The script utilizes Node.js to run. We recommend the node version defined in the .nvmrc file.

License

โ€‹
Licensed under either of
โ€‹

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


ยฉ 2023 PT Services DMCC

Languages

JavaScript73.4%Shell26.6%

Contributors

Apache License 2.0
Created November 10, 2023
Updated February 26, 2026
0xPolygon/storage-delta | GitHunt