Yul
These instructions do not have a direct representation in EVM or ZKsync VM. Instead, they perform auxiliary operations required for generating the target bytecode.
datasize
Original Yul auxiliary instruction.
Unlike on EVM, on ZKsync VM target this instruction returns the size of the header part of the calldata sent to the ContractDeployer. For more information, see CREATE.
LLVM IR codegen references:
dataoffset
Original Yul auxiliary instruction.
Unlike on EVM, on ZKsync VM target this instruction has nothing to do with the offset. Instead, it returns the bytecode hash of the contract referenced by the Yul object identifier. Since our compiler translates instructions without analyzing the surrounding context, it is not possible to get the bytecode hash from anywhere else in datacopy. For more information, see CREATE.
LLVM IR codegen references:
datacopy
Original Yul auxiliary instruction.
Unlike on EVM, on ZKsync VM target this instruction copies the bytecode hash passed as dataoffset to the destination. For more information, see CREATE.
setimmutable
Original Yul auxiliary instruction.
Writes immutables to the auxiliary heap.
For more information, see the Differences with Ethereum.
LLVM IR codegen references:
loadimmutable
Original Yul auxiliary instruction.
Reads immutables from the ImmutableSimulator.
For more information, see the Differences with Ethereum.
LLVM IR codegen references:
linkersymbol
Original Yul auxiliary instruction.
Returns the address of a deployable library. The address must be passed to zksolc
with the --libraries
option,
otherwise a compile-time error will be produced.
There is a special zksolc
execution mode that can be enabled with --missing-libraries
flag. In this mode, the
compiler will return the list of deployable libraries not provided with --libraries
. This mode allows package managers
like Hardhat to automatically deploy libraries.
For more information, see the Differences with Ethereum.
memoryguard
Original Yul auxiliary instruction.
Is a Yul optimizer hint which is not used by our compiler. Instead, its only argument is simply unwrapped and returned.
verbatim
Original Yul auxiliary instruction.
Unlike on EVM, on ZKsync VM target this instruction has nothing to do with inserting of EVM bytecode. Instead, it is used to implement
ZKsync VM Yul Extensions available in the system mode.
In order to compile a Yul contract with extensions, both Yul and system mode must be enabled (zksolc --yul --system-mode ...
).