Is there anyway to increase the MaxCodeSize = 24576 ? I am getting below error while deploying the contract

DEBUG[09-18|11:33:43.885] VM returned with error err=evm: max code size exceeded

1 Answer 1


It's hardcoded in go-ethereum, see why in eip-170.

In theory, you can change the value in the source code, build your own geth, run your private dev environment with it and enjoy a higher code size limit value. But you can't change this value neither in Mainnet nor in any public testnet, so it's best to cope with it differently.

Check this answer to a related question.

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.