smlxl / storage-layout-extractor

A tool that performs extraction of storage layouts based on EVM bytecode.
https://smlxl.io
GNU Affero General Public License v3.0
128 stars 9 forks source link

[BUG] Inferring Unused Tails for Packed Encodings #80

Open iamrecursion opened 1 year ago

iamrecursion commented 1 year ago

Describe the Bug

While I do not think it can ever be conclusively eliminated, there are some fairly recognizable cases in which we infer the tail of a packed encoding as being used where it is actually not. We want to eliminate these cases as much as possible.

To Reproduce

Steps to reproduce the behavior:

  1. Run the house.rs integration test
  2. Look at the assertion for slot number 25.
  3. See that it infers it as struct(number8, bytes31) where it should just be some type equivalent to bool.

Expected Behaviour

We do better about not returning unused tails in packed encodings.