vyperlang / vyper

Pythonic Smart Contract Language for the EVM
https://vyperlang.org
Other
4.84k stars 788 forks source link

bug: no sanity check on storage layout files #3516

Open tserg opened 1 year ago

tserg commented 1 year ago

Version Information

What's your issue about?

When compiling a contract with the flag storage_layout_file, some basic sanity checks could be performed on the given JSON file as currently:

For example, a contract only defining the storage variable a: uint256 can be compiled given the following storage layout:

{
    "a": {"type": "uint16", "slot": 10},
    "a": {"type": "uint8", "slot": 1},
    "b": {"type": "uint256", "slot": 1}
}

h/t @trocher

How can it be fixed?

Fill this in if you know how to fix it.

cyberthirst commented 3 months ago

roundtrip requirement was added in https://github.com/vyperlang/vyper/pull/3789