DEV Community

MihaiHng
MihaiHng

Posted on

Ethereum-Solidity Quiz Q6: What is the max bytecode size for smart contract deployment on Ethereum?

The maximum bytecode size for a smart contract deployment on Ethereum(EIP-170) is 24,576 bytes (24 KB). If the compiled contract bytecode exceeds this size, the deployment transaction will fail.

The limit applies to the final deployed bytecode, which is the compiled EVM bytecode that is stored on the blockchain(doesn't include constructor code or other temporary code that only runs during deployment).

If the contract exceeds 24 KB, there are a few used techniques: code splitting, libraries, proxies, optimization(solc optimizer), remove unnecessary code, moving code to other contracts.

Top comments (0)