Storage Delta is a tool for auditing storage layout changes during contract upgrades.
Powered by Foundry.
forge install 0xPolygon/storage-delta
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.
Description | |
---|---|
π± | New |
π΄ | Problematic |
π³οΈ | Moved |
π | Moved & problematic |
πͺ¦ | Removed |
Dirty bytes |
When a variable with a unique name and type is added.
uint256 a
uint256 a
π± bool b
When a new variable is added, but conflicts with the existing storage.
uint256 a
π΄ bool b
When an existing variable is moved.
uint256 a
...
...
π³οΈ uint256 a
When an existing variable is moved and conflicts with the existing storage.
uint256 a
bool b
π bool b
π uint256 a
When a variable no longer exists.
uint256 a
bool b
uint256 a
πͺ¦
When the storage is not clean.
uint256 a
π΄ uint128 a
16 dirty bytes
Option | Values | Description |
---|---|---|
--omit |
new |
Do not generate a report with only those findings. |
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.
β Licensed under either of β
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) β
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