Quickstarts
Read a Remote Contract's State
STEP 1 OF 3
NEXT WALKTHROUGH: Deploy on EEZ-X mainnet →
INSPECTION · STOPS HERE
THIS ROLLUP · ONCE CREATED, LIVES HERE
proxy(counterpart)
0x7d3F…9bA1
its own code · its own balance
.balance · .code.length
↶
answered right here
ROLLUP 1 · THE REAL CONTRACT
counterpart
0xC0ffEE…4979
never touched by an opcode
routed
a CALL through the proxy
the fallback forwards it to the manager
eez-core-protocol/src/base/CrossChainProxy.sol:113 · _fallback ↗
Only a call is routed — every other question the EVM answers about the local contract.
DAPP DEVELOPERS

How to read a remote contract's state

The Quickstart flagged in gotcha 2 of card 04 that an entry counts only in its block; this card is static reads in full: what a read of the proxy really answers, and how a routed read resolves.

The contract you want to read lives on another rollup. Here it has a stand-in — a proxy — and that proxy is a real contract on this chain, with its own code and its own balance.

So inspecting it answers about it. This is the caveat with no compiler help: the read succeeds and hands back a real number about the wrong contract. The fix is to call through the proxy instead of inspecting it.

WHAT YOU'LL LEARN
  • 01 · A CONTRACT ON THIS CHAINOnce created, the proxy is a contract here, so opcodes answer about it, not about the contract it stands for.
  • 02 · THREE READS, NO REVERTbalance, extcodesize and extcodecopy describe the proxy; block-state opcodes describe this chain. A delegatecall into the proxy reverts instead.
  • 03 · ASK IT, DON'T INSPECT ITA routed read resolves against a pre-computed entry, or reverts (ExecutionNotFound() on L1, EntryNotFound on L2) — and the forwarded revert data usually tells that from the destination reverting, but don't branch on it.

RUN IT YOURSELF · forge test --match-test test_routedReadReturnsThePreCommittedEntry -vv — from eez-demos/snippets, Foundry only.

Verified against eez-core-protocol Git commit 9a1f815; interfaces may move.

UP NEXTDeploy on EEZ-X mainnet