Skip to content

@eez:on

Evaluate an expression as if the script were on another chain, and return its value: helpers, :: calls, variables and arithmetic resolve against that chain (reads only).

On-chain (@eez:on!): Reads the other chain through the proxy of its Assertions core, so the assertion runs as a transaction; one hop only, not simulable.

⚗️ Experimental — available at next.evmcrispr.com.

Returns: any

@eez:on(chain expression)
NameTypeDescription
chainchainChain to evaluate on (chiadoX, a viem name or a chain id)
expressionanyExpression evaluated as if the script had switched to that chain
# From L1, read the connected account's balance on the rollup
switch gnosisChiado
print @eez:on(chiadoX @balance(ETH @me))
  • The expression runs with the script's client switched to the target chain and the previous client restored afterwards — inside a sim:fork the fork is kept. Everything inside resolves against the target chain: @balance, @token:balance, :: reads, other modules' helpers (e.g. @eez:proxy computes the proxy on that chain), nested @eez:on.
  • Read-only by construction: helpers cannot emit actions, so exec-style writes are not possible inside the expression. Use the eez:on command to write.
  • Module config variables ($eez:registry, $std:tokenlist, …) are global, not per chain: a value set for the script's own chain is also seen while evaluating on the other one.
  • Editor completions inside the expression assume the script's current chain, not the target.

A synchronous cross-rollup read inside an assertion. The inner expression compiles as if the script were on the other chain (so @balance!, :: reads and every nested on-chain helper resolve there), and is evaluated at assertion time through this chain's cross-chain proxy of the Assertions core deployed over there: a static call the EEZ sequencer composes, returning the remote value inline.

switch gnosisChiado
assert @eez:on!(chiadoX @balance!(ETH @me)) >= 1e18 "not enough on the rollup"
  • The assertion becomes a transaction, marked as crossing chains so the composer prices it like any other; inside a smart block (batch !( … )) the batch's transaction is marked, and is sent without the simulation it could not pass. Only a transaction reaches the composer; an eth_call through a proxy always fails with a registry gate error (ExecutionNotInCurrentBlock, or ExecutionNotFound()). A wallet batch ( … ) cannot carry the settlement fee, and is refused with it; use a smart batch or a Safe's block (safe:execute). It cannot be simulated in sim:fork, since a fork has no composer.
  • Two proxies of the Assertions core must exist first: the remote core's proxy on this chain (eez:deploy-proxy 0xa55e47C835ACD377da79D57162117D9B5Ecf3496 --chain chiadoX from L1), which the read goes out through, and this chain's core's proxy over there (the same command from L2 with --chain gnosisChiado), which the other side sees as the reader. A static read cannot create a proxy on the way, so a missing one gets the transaction evicted rather than reverted.
  • @me compiles to the literal wallet address, so @balance!(ETH @me) on the rollup is the wallet's balance there. Anything on the far side that looks at msg.sender sees the proxy of the caller instead.
  • The Assertions core is deployed on Chiado, chiadoX and mainnet, not yet on rollupX: @eez:on! works on ChiadoX only for now.
  • One hop only: the devnet composes a static read across one chain boundary, not @eez:on! inside @eez:on!.
  • A constant inner expression is folded at composition time and never crosses; @eez:on!(gnosisChiado …) from L1 is just the inner expression.
  • eez:on — run a block of commands on the other rollup atomically