← Quickstarts
Read a Remote Contract's State
PRE-MAINNET
STEP 1 OF 3
NEXT: Deploy on the EEZ testnet →
INSPECTION · STOPS HERE
THIS ROLLUP · DEPLOYED 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:89 · _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 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 CHAINThe proxy is deployed here, so opcodes answer about it, not about the contract it stands for.
  • 02 · FOUR READS, NO REVERTbalance, extcodesize, extcodecopy and delegatecall describe the proxy; block-state opcodes describe this chain.
  • 03 · ASK IT, DON'T INSPECT ITA routed read resolves against a pre-computed entry, or reverts ExecutionNotFound() — indistinguishably from the destination reverting.

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

Verified against eez-core-protocol @ 9735f53 — pre-mainnet; interfaces may move.