Overview
System instructions enable contracts to interact with external accounts, create new contracts, and manage account lifecycle. These are the most complex EVM opcodes, handling gas forwarding, context preservation, and state modifications.Instructions
Contract Creation
- CREATE (0xf0) - Create contract at computed address
- CREATE2 (0xf5) - Create contract at deterministic address (Constantinople+)
Message Calls
- CALL (0xf1) - External call with value transfer
- CALLCODE (0xf2) - Execute code in current context (deprecated)
- DELEGATECALL (0xf4) - Execute code preserving msg.sender/value (Homestead+)
- STATICCALL (0xfa) - Read-only call (Byzantium+)
Account Management
- SELFDESTRUCT (0xff) - Transfer balance and mark for deletion
Key Concepts
Gas Forwarding (EIP-150)
63/64 Rule (Tangerine Whistle+): Caller retains 1/64th of remaining gas, forwards up to 63/64:Call Variants
| Opcode | msg.sender | msg.value | Storage | State Changes | Introduced |
|---|---|---|---|---|---|
| CALL | caller | specified | callee | allowed | Frontier |
| CALLCODE | caller | specified | caller | allowed | Frontier |
| DELEGATECALL | preserved | preserved | caller | allowed | Homestead |
| STATICCALL | caller | 0 | callee | forbidden | Byzantium |
Value Transfer Gas Costs
With non-zero value:- Base call cost: 700 gas (Tangerine Whistle+)
- Value transfer: +9,000 gas
- Stipend to callee: +2,300 gas (free)
- New account: +25,000 gas (if recipient doesn’t exist)
- Base call cost: 700 gas (Tangerine Whistle+)
- Access cost: 100 (warm) or 2,600 (cold) gas (Berlin+)
Address Computation
CREATE:Security Considerations
Reentrancy
External calls enable reentrancy attacks:CREATE2 Address Collision
CREATE2 enables deterministic addresses but introduces collision risks:CALLCODE Deprecation
CALLCODE is deprecated - use DELEGATECALL instead:SELFDESTRUCT Changes (EIP-6780)
Pre-Cancun: SELFDESTRUCT deletes code, storage, nonce. Cancun+: SELFDESTRUCT only transfers balance (unless created same tx).Gas Cost Summary
Call Instructions
| Operation | Base | Value Transfer | New Account | Cold Access | Memory |
|---|---|---|---|---|---|
| CALL | 700 | +9,000 | +25,000 | +2,600 | dynamic |
| CALLCODE | 700 | +9,000 | - | +2,600 | dynamic |
| DELEGATECALL | 700 | - | - | +2,600 | dynamic |
| STATICCALL | 700 | - | - | +2,600 | dynamic |
Creation Instructions
| Operation | Base | Init Code | Memory | Notes |
|---|---|---|---|---|
| CREATE | 32,000 | +6/byte (EIP-3860) | dynamic | +200/byte codesize |
| CREATE2 | 32,000 | +6/byte + 6/byte (hashing) | dynamic | +200/byte codesize |
SELFDESTRUCT
- Base: 5,000 gas
- Cold beneficiary: +2,600 gas (Berlin+)
- New account: +25,000 gas (if beneficiary doesn’t exist)
- Refund: 24,000 gas (removed in London)

