The Ethereum Virtual Machine

message call

A message call is how one contract talks to another while a transaction is running. A transaction launched from a user's account is the outermost call, but inside it a contract can fire off further calls — sending value, passing data, and triggering code in other contracts — and those nested calls are message calls. They are the mechanism behind composability: an aggregator calling a DEX calling a token, all within one atomic transaction.

The workhorse opcode is CALL. It takes the target address, an amount of ETH (in wei) to transfer, a region of memory holding the input data, a region to receive the return data, and an explicit gas allowance to forward. The EVM then spins up a brand-new execution frame for the callee: its own stack, its own zeroed memory, its own calldata (the bytes you passed). When the callee finishes, CALL pushes a single word onto the caller's stack — 1 for success, 0 for failure — and copies any returned bytes into the designated memory region.

Two rules constantly trip people up. First, the callee runs in its own context: inside it, msg.sender is the calling contract and msg.value is the ETH that call forwarded, not the original transaction's. Second, the EVM cannot forward all remaining gas — by EIP-150's '63/64 rule', a call may pass at most 63/64 of the gas left, reserving a sliver so the caller can still react (e.g. handle a failure) even if the callee runs out. This means deeply nested calls geometrically lose available gas.

Critically, a failed message call does not by itself abort the caller — CALL just returns 0. It is the caller's responsibility to check that return value and decide whether to revert; ignoring it is the classic 'unchecked external call' bug. Sibling opcodes specialize the behavior: DELEGATECALL runs the callee's code in the caller's own storage and identity, and STATICCALL forbids any state change, while the old CALLCODE is deprecated.

Sending ETH with .transfer or .send forwards only a fixed 2,300-gas stipend, enough to emit a log but not to do storage writes; this once-recommended pattern can now break with gas-hungry recipients, so a checked low-level call is generally preferred.