As far as I know, there is a contract size limit on mainnet of 24577 bytes. But I can see contracts with larger deployed bytecode, e.g., https://etherscan.io/address/0x23581767a106ae21c074b2276d25e5c3e136a68b#code

The deployed byte code is 44832 bytes. How is that possible?

2 Answers 2

  1. You are counting hex digits, not bytes. So it’s 44832 ÷ 2 = 22416 bytes, which is within the limit.
  2. It’s even lower than 22416, because 22416 is the contract creation code, which includes the constructor code + constructor arguments. Have a look at this other question. What needs to be within the limit is the deployed bytecode.

Everthing @dawrdu said, and this:

The contract size limit didn't exist before hard fork 4, described in EIP-607 which included EIP-170, the contract size limitation. So, contracts deployed prior to that were limited by the block gasLimit and not the explicit cap.


Hope it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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