1

Generally, what is the size of the bytecode stored in the EVM. I mean the approx average value of it or bytecode of a simple hello world program (setting and getting a string). On what factors this bytecode depends? and on how can i get this correct. i mean How can I know the correct value? is there any predefined keyword or command that gives this information.

Any relatable answer is appreciable !!

2

I mean the approx average value of it or bytecode of a simple hello world program (setting and getting a string).

I'm not aware of anyone tracking these statistic, you will have to compute them yourself. Contract can vary a huge amount in size.

On what factors this bytecode depends?

It is more or less directly proportional to the length of your source code, although optimization runs can make the compiled size deviate from a purely linear relationship.

and on how can i get this correct. i mean How can I know the correct value? is there any predefined keyword or command that gives this information.

The eth_getCode function allows you retrieve the bytecode at a given address.

1

If you look at Ethereum's mainnet, as of late September (last time I processed contracts and addresses for stats):

  • There are approximately 125,000 unique contracts, many more if you count duplicates
  • Most contracts range from a few hundreds of bytes (generally a few Kb) up to almost 25 Kb for the largest active contract

I can't say for testnets, private nets (of course!) or other Ethereum forks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.