Closed 2xic closed 1 year ago
This happens because internally the analyzer records the length of all types in bits. It is perfectly valid at the EVM level to see a value that has length % BYTE_SIZE != 0
that is only ever used as bytes.
When converting to BytesN
in the output stage, we just calculate bit_length / BYTE_SIZE
, which when bit_length < BYTE_SIZE
rounds to 0 bytes and produces this strange output.
As these lengths that are not divisible by BYTE_SIZE
are correct at the machine level, we should introduce AbiType::Bits { length: Option<usize> }
for these cases, and thus leave the choice of how to handle this for users up to the CLI.
Describe the Bug
Sometimes we see types with length
0
To Reproduce
Run BlitzGenerator
Output for slot
0x000000000000000000000000000000000000000000000000000000000000000e
Expected Behaviour
Bits length have been used for data types like uint and int. So maybe seeing that here also.