Modular smart contracts split a blockchain application into separately deployed units with fixed public interfaces, letting teams audit, replace or retire one unit without redeploying the rest. Ethereum has pushed developers toward modular design since 2016, when EIP-170 capped deployed code at 24,576 bytes, and the Ethereum Foundation’s Glamsterdam announcement now lists EIP-7954, a draft proposal to raise the cap to 65,536 bytes, among the upgrade’s scheduled changes.
Where monolithic contracts break in production
A monolith puts storage, business rules and access control in one bytecode, and a change to any rule means redeploying and re-auditing the full system.
The Ethereum tutorial on contract size ranks contract separation as the first remedy for oversized code, ahead of removing functions or shortening revert messages, and the limit covers deployment code too: EIP-3860 set 49,152 bytes for initcode in the Shanghai upgrade, and EIP-7954 would lift it to 131,072.
Splitting code moves risk into shared components, as the Parity and Audius incidents showed: in November 2017 an anonymous user initialized and destroyed the library contract behind Parity’s multi-signature wallets, freezing every wallet built on it, and in July 2022 a storage collision at Audius let an attacker call initializer functions again and pass a malicious governance proposal.
The USENIX Security 2023 paper “Proxy Hunting”, by William Bodell III, Sajad Meisami and Yue Duan of Illinois Institute of Technology, analyzed 861,657 contracts on eight blockchains, cataloged eleven upgradeable-contract design patterns and documented 2,546 security and safety issues in six categories.

Modular smart contracts: separate state, logic and permissions
State separation sets the safe boundary for change: storage stays in a core contract or in namespaced structs, and rules live in modules reading and writing through defined functions.
Aave V4, live on Ethereum mainnet since March 2026, applies the split at protocol level, with a Hub contract holding liquidity and Spoke contracts implementing lending rules, while a credit line caps how much each Spoke can draw from the Hub.
A module registry maps each role to an address and an interface version, so the core resolves modules at call time and governance swaps an implementation with one timelocked registry update.
Permission boundaries matter as much as the split itself, since a module with unrestricted reach turns the design into a monolith spread over several addresses, and ERC-7579 standardizes the pattern for smart accounts with four module types, namely validators, executors, hooks and fallback handlers.

Namespaced storage stops an upgrade from shifting the slots of existing variables, and ERC-7201 fixes the convention by deriving each storage root from a hashed identifier.
A Trail of Bits review of Aave V4, run from October 21 to November 3, 2025, logged an informational finding on the Spoke’s inherited NoncesKeyed contract, whose fixed layout blocked new variables, and Aave resolved it in PR #1138 by moving NoncesKeyed to ERC-7201 storage.

Call-path cost grows with every module hop, since a transaction pays a cold-access charge the first time it touches each contract address, and EIP-8038, scheduled for Glamsterdam, raises the charge.
Delegatecall pays the same account-access price as a plain call, so facet routing carries the charge too, and keeping frequent operations inside one module while reserving cross-module calls for rarer operations limits the cost.
3,000 gas
Cold access to a contract address under EIP-8038 (Last Call), up from 2,600 under EIP-2929.
2,100 gas
First read of a storage slot in a transaction; EIP-8038 leaves the price unchanged.
100 gas
Repeat access to an address or slot already touched in the same transaction.
Upgrade patterns: proxy, beacon, diamond or immutable modules
OpenZeppelin’s proxy documentation now leans toward UUPS proxies over transparent proxies and leaves access control to an overridden _authorizeUpgrade function, while the OpenZeppelin Upgrades plugins validate an implementation for upgrade safety before deployment and support beacon proxies upgrading many instances in one transaction.
Instance count drives the choice: a factory deploying many identical vaults fits beacon proxies, a single protocol entry point with a changing interface fits UUPS, and an interface outgrowing one implementation fits ERC-2535 diamonds, where a router sends each function selector to a facet through delegatecall.
Diamonds carry a tooling and review cost, and Trail of Bits audited a diamond implementation in 2020 and reported a missing existence check and avoidable complexity.
Trail of Bits warned in 2018 of added complexity and new bugs from upgradeable-contract techniques, and it preferred contract migration over in-place upgrades; the issue catalog in Proxy Hunting points in the same direction.
A workable default is an immutable core with a registry of replaceable modules, with proxies reserved for components holding user funds or long-lived state.
| Pattern | Where upgrade logic lives | What one upgrade changes | Documented trade-off |
|---|---|---|---|
| Transparent proxy | In the proxy, with a ProxyAdmin contract | One proxy | Costs more to deploy than a UUPS proxy |
| UUPS (ERC-1822, ERC-1967) | In the implementation | One proxy | An implementation without an upgrade function locks upgradeability permanently; UUPSUpgradeable blocks that upgrade by default |
| Beacon proxy | In a separate beacon contract | Every proxy pointing to the beacon, in one transaction | The beacon owner controls all instances |
| Diamond (ERC-2535) | In the diamond, through diamondCut | Individual function selectors routed to facets | Trail of Bits’ 2020 audit of an implementation found a missing existence check and avoidable complexity |
Testing modular smart contracts before release
Foundry’s invariant testing runs random call sequences through handler contracts and asserts properties including solvency after each call, a fit for modular systems where bugs appear in the order modules call each other.
Initialization deserves its own test: both the Parity library and the Audius contracts failed at initialization, and a deployment script should initialize or lock every implementation and confirm no initializer can run twice.
Slither’s upgradeability checks compare a proxy, the deployed implementation and the proposed version, and flag storage-layout breaks, function collisions and initialization mistakes before an upgrade ships.
Gas repricing now belongs in the test plan as well: Ethereum core developers postponed Glamsterdam’s Hoodi activation on October 22 to study how EIP-8037 interacts with mainnet contracts, and on November 26 they set December 15 for it under the unchanged specification, while no mainnet date exists.
Fork tests replaying representative transactions under the new gas schedule show whether multi-module call paths still fit the gas limits callers set, and Sepolia has run the upgrade since October 6.

Isai Alexei is a journalist and financial analyst covering cryptocurrency markets and traditional securities for Blockchaindose. He has spent ten years analyzing digital assets, trading activity, and market structure.








