Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
This article examines EIP-214, which introduces STATICCALL, an opcode that prohibits smart contracts from modifying state during a call.
This explanation translates, summarizes, and expands on the following specification.
For other proposals, see https://cardene.dev/proposals.
The article discusses several opcodes. For further information on individual opcodes, see:
Overview
The proposal introduces an opcode intended to improve smart contract safety. When a contract or function is called using it, modifications to state, including stored data and assets, are prohibited throughout the call's execution.
The called contract and its subcalls execute in a read-only context. Attempts to modify state cause an exception instead of performing the modification. This prevents unintended state changes and improves security.
Motivation
Ordinary contract calls place relatively few restrictions on the operations a callee can perform. This flexibility introduces security concerns because a caller may not know in advance what changes the called contract will make.
EIP-214 introduces a more restrictive type of contract interaction. The call executes in a read-only context, giving developers assurance that the call does not modify account state. This makes contract interactions more predictable and reliable.
Specification
The proposal introduces a STATIC flag into the EVM. It defaults to false and is inherited by subcalls, except that the new opcode 0xfa, STATICCALL, sets it to true for the child call.
STATICCALL resembles CALL, but removes the value argument and treats the transferred value as zero. The callee runs with STATIC set to true, preventing state-changing operations. When the call returns, execution continues with the caller's original flag.
When STATIC is true, operations that would modify state cause an exception. Examples include CREATE, CREATE2, LOG0 through LOG4, SSTORE, and SELFDESTRUCT, as well as CALL with nonzero value under the original specification. This prevents unintended changes.
CALLCODE is a special case that executes another contract's code in the current contract's context and is not classified as state-changing merely because its value argument is nonzero.
Additional Considerations
This mechanism lets contracts explicitly perform calls without state changes. It provides developers and reviewers with assurance that the call cannot perform state-mutating reentrancy or other state-changing operations.
Reentrancy occurs when external execution unexpectedly enters a contract again. A static call can still read state and interact with other contracts in a static context; it is not a general guarantee against all reentrancy-related risks. The call behaves like a read-only computation in the sense that it returns results without modifying persistent state.
This approach may help implement high-level languages based on functional programming. Purely functional languages emphasize avoiding side effects and making output depend on input. Restricting side effects can improve predictability and safety, although STATICCALL itself does not guarantee that output depends only on explicit input.
For further information on reentrancy attacks, see:
https://chaldene.net/solidity-reentrancy-attack
Backward Compatibility
The new opcode extends the EVM without changing the ordinary behavior of existing opcodes. Existing contracts that do not use the new opcode or run in its static context continue to operate as before.
This preserves compatibility while allowing developers who need the new capability to adopt it without forcing unrelated contracts to change.
Citation
Vitalik Buterin vitalik@ethereum.org, Christian Reitwiessner chris@ethereum.org, "EIP-214: New opcode STATICCALL," Ethereum Improvement Proposals, no. 214, February 2017. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-214.
Conclusion
EIP-214 introduces STATICCALL to prevent state changes during contract calls and their descendants.
Further reading and author links:




