EIP-7954 · Last Call · Core · 2025-06-09
EIP-7954: Increase Maximum Contract Size
Raises the maximum deployed contract size from 24 KiB to 64 KiB and the initcode limit from 48 KiB to 128 KiB, so complex contracts no longer need to be split up.
What problem does it solve?
Since EIP-170 (2016), deployed contract code has been capped at 24,576 bytes. Developers of large protocols regularly hit "contract code size exceeds limit" errors and work around it with proxies, diamonds, libraries, external modules or aggressive optimizer settings. These workarounds add complexity, extra calls and sometimes extra attack surface.
EIP-7954 simply raises the limit, keeping everything else the same.
How it works
Two constants change:
| Limit | Before | After |
|---|---|---|
| Max contract code size (EIP-170) | 24 KiB (0x6000 = 24,576 bytes) |
64 KiB (0x10000 = 65,536 bytes) |
| Max initcode size (EIP-3860) | 48 KiB (0xC000 = 49,152 bytes) |
128 KiB (0x20000 = 131,072 bytes) |
The initcode limit stays at twice the code limit, as before. Gas metering is unchanged: creation still pays the existing per-byte deposit cost and initcode word cost, so a bigger contract simply costs proportionally more to deploy.
Existing contracts are unaffected. After activation, contracts between 24 KiB and 64 KiB become deployable.
Sample code
Checking a build artifact against the old and new limits (Node / TypeScript):
import { readFileSync } from "node:fs";
const OLD_LIMIT = 0x6000; // 24,576 bytes (EIP-170)
const NEW_LIMIT = 0x10000; // 65,536 bytes (EIP-7954)
const artifact = JSON.parse(readFileSync("out/MyProtocol.sol/MyProtocol.json", "utf8"));
const hex: string = artifact.deployedBytecode.object;
const size = (hex.startsWith("0x") ? hex.length - 2 : hex.length) / 2;
console.log(`runtime size: ${size} bytes`);
if (size > NEW_LIMIT) console.log("too big even after EIP-7954");
else if (size > OLD_LIMIT) console.log("deployable only where EIP-7954 is active");
Things to know
- Status: Last Call (deadline 2026-11-01 in the spec). It is listed as Scheduled for Inclusion in the Glamsterdam meta EIP (EIP-7773), which is itself still in Review. Until activation, the 24 KiB limit applies on mainnet.
- It needs a hard fork. Other EVM chains choose their own limits.
- The spec notes a marginal increase in DoS risk from larger code that must be loaded, but considers 64 KiB conservative. EIP-7907 (Draft) explores metering code size instead of a hard cap.
- Tooling (Foundry, Hardhat, solc warnings) may still flag contracts above 24 KiB until configured for the new limit.