Yul Auxiliary Instructions

These instructions do not map directly to EVM or EraVM but instead perform auxiliary operations necessary for generating the target bytecode.

datasize

Original Yul auxiliary instruction.

Unlike on EVM, on EraVM this instruction returns only the size of the header part of the calldata sent to the ContractDeployer.

For more information, see CREATE.

dataoffset

Original Yul auxiliary instruction.

Unlike on EVM, this instruction does not relate to offsets. Instead, it returns the bytecode hash of the contract referenced by the Yul object identifier.

For more information, see CREATE.

datacopy

Original Yul auxiliary instruction.

Unlike on EVM, on EraVM this instruction copies the bytecode hash passed as dataoffset to the destination. Because our compiler translates instructions without analyzing the surrounding context, there is no other way to obtain the bytecode hash within datacopy.

For more information, see CREATE.

setimmutable

Original Yul auxiliary instruction.

Writes immutables to the auxiliary heap.

For more information, see the Differences with Ethereum.

loadimmutable

Original Yul auxiliary instruction.

Reads immutables from the ImmutableSimulator in runtime code, or from temporary values on auxiliary heap in deploy code.

For more information, see the Differences with Ethereum.

linkersymbol

Original Yul auxiliary instruction.

Sets the placeholder of a deployable library. The address must be passed to zksolc with the --libraries option, either in compiler or linker mode.

memoryguard

Original Yul auxiliary instruction.

It is a Yul optimizer hint ignored by zksolc.

verbatim

Original Yul auxiliary instruction.

Unlike on EVM, on EraVM this instruction has nothing to do with insertions of EVM bytecode. Instead, it is used to implement ZKsync EraVM Yul Extensions. In order to compile a Yul contract with extensions, both Yul mode and EraVM extensions must be enabled.