Enabling Large Contracts on Ethereum

Remove initcode limits to unlock new deployment possibilities.

Learn More

Current Initcode Limit

49,152 bytes

EIP-3860

Deployed Code Limit

24,576 bytes

EIP-170

Proposed Changes

Unlimited Initcode Size

EIP-7903

256 KB Contract Size Limit

EIP-7907

The Problem

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.

Transaction 1: Deploy Factory Transaction 2: Deploy Child Higher Gas Costs + Complexity Single Transaction: Deploy All Lower Gas Costs + Simplicity

The Solution

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 drafts
Before Initcode Limit Deployment Fails After No Limit Single Logical Contract Multiple Physical Contracts

Examples

Vyper's @delegate decorator

Simplify 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.

Less Ergonomic Alternatives

Multiple Transactions

Split deployment into separate transactions, coordinated off-chain.

Example 1: Factory Contract with Web3.py

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.

Example 2: Off-Chain Assembly with Hardhat

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.

FAQ

Why was the limit introduced?

+

EIP-3860 aimed to ease JUMPDEST analysis, but gas metering is sufficient.

Does this change EIP-170?

+

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.

What is EIP-7907?

+

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.

Is it secure?

+

Yes, the existing, linear gas metering of 2 gas per byte of initcode prevents abuse. View performance benchmarks.

Do large contracts require EOF?

+

No, they don't. They only require removing the initcode size limit introduced in EIP-3860.