2

If you check the specs of EIP-3448, it states:

"The last 32 bytes (one word) of the bytecode must indicate the length of the metadata in bytes."

However, if this is not included in the bytecode, does it produce any security issues? Or is this something optional? The specs clearly mention that it must indicate the length of the metadata, so I am confused about why it is really needed. If it is not present in the bytecode, what issues can it produce? Any examples would be greatly appreciated.

I checked the following references but didn't find anything helpful:

1 Answer 1

1
+50

From the article that you linked:

It may seem odd to store the length of the metadata at the end, as ABI encoding typically stores length before the data begins, but in this case, it makes it easy for the implementation contract to parse the extra metadata with the following code from earlier.

let posOfMetadataSize := sub(calldatasize(), 32)

The assembly code illustrates how to easily parse the metadata.

It is not a security issue necessarily, it is a matter of convenience and a community enforced practice.

Without the standard one might expect to obtain the length at the beginning and not the end or not expect it at all.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.