49,152 bytes
EIP-3860
24,576 bytes
EIP-170
Unlimited Initcode Size
EIP-7903
256 KB Contract Size Limit
EIP-7907
Ethereum limits deployed contract code to 24,576 bytes (EIP-170) for efficiency. Additionally, EIP-3860 caps initcode—the deployment data—at 49,152 bytes.
This restriction hampers factory patterns and large deployments, pushing developers toward expensive, complex multi-transaction workarounds.
EIP-7903 removes the 49,152-byte initcode cap, allowing large contracts to deploy in one transaction. Gas metering ensures fair pricing, rendering the limit obsolete.
Additionally, EIP-7907 proposes increasing the maximum contract bytecode size from 24,576 bytes to 256 KB, providing more flexibility for complex contracts. This limit exists to protect the P2P network rather than due to EVM constraints.
Benefits include streamlined factory deployments and cleaner code in languages like Vyper.
Read the full EIP draftsSimplify large contracts with Vyper's @delegate decorator.
@external
def transfer(receiver: address, amount: uint256) -> bool:
self.balances[msg.sender] -= amount
self.balances[receiver] += amount
return True
# ...
# many methods later...
@delegate
@view
@external
def large_view_function(input: uint256) -> uint256:
return input * 100 + input // 2
Deploys in one transaction post-EIP, avoiding multi-transaction complexity.
Split deployment into separate transactions, coordinated off-chain.
Deploy multiple contracts, linking them off-chain when initcode exceeds limits.
from web3 import Web3
w3 = Web3(Web3.HTTPProvider('http://localhost:8545'))
# Deploy factory contract
factory_tx = w3.eth.send_transaction({
'from': w3.eth.accounts[0],
'data': FACTORY_INITCODE
})
factory_receipt = w3.eth.wait_for_transaction_receipt(factory_tx)
factory_addr = factory_receipt.contractAddress
# Deploy child contract, linking to factory
child_tx = w3.eth.send_transaction({
'from': w3.eth.accounts[0],
'data': CHILD_INITCODE.replace('__FACTORY__', factory_addr)
})
Currently requires multiple transactions if initcode > 49,152 bytes; post-EIP, deployable in one.
Drawback: Increases gas costs and complexity.
Deploy small contracts and assemble logic off-chain.
from web3 import Web3
const { ethers } = require('hardhat');
async function deployContracts() {
const [deployer] = await ethers.getSigners();
// Deploy first contract
const Factory = await ethers.getContractFactory('FactoryContract');
const factory = await Factory.deploy();
await factory.deployed();
// Deploy second contract, referencing the first
const Child = await ethers.getContractFactory('ChildContract');
const child = await Child.deploy(factory.address);
await child.deployed();
console.log('Contracts deployed:', factory.address, child.address);
}
deployContracts();
Drawback: Lacks atomicity and is error-prone.
EIP-3860 aimed to ease JUMPDEST analysis, but gas metering is sufficient.
No, EIP-7903 does not change the deployed code size limit. However, EIP-7907 proposes to increase this limit from 24,576 bytes to 256 KB.
EIP-7907 proposes to increase the maximum contract bytecode size from 24,576 bytes to 256 KB. This complements EIP-7903's removal of initcode limits and provides more flexibility for larger contracts. The limit exists to protect the P2P network, not because of any fundamental EVM limitation.
Yes, the existing, linear gas metering of 2 gas per byte of initcode prevents abuse. View performance benchmarks.
No, they don't. They only require removing the initcode size limit introduced in EIP-3860.