Yul


These instructions do not have a direct representation in EVM or Validium VM. Instead, they perform auxiliary operations required for generating the target bytecode.

datasize

Original Yularrow-up-right auxiliary instruction.

Unlike on EVM, on Validium VM target this instruction returns the size of the header part of the calldata sent to the ContractDeployerarrow-up-right. For more information, see CREATEarrow-up-right.

LLVM IR codegen references:

dataoffset

Original Yularrow-up-right auxiliary instruction.

Unlike on EVM, on Validium 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 datacopyarrow-up-right. For more information, see CREATEarrow-up-right.

LLVM IR codegen references:

datacopy

Original Yularrow-up-right auxiliary instruction.

Unlike on EVM, on Validium VM target this instruction copies the bytecode hash passed as dataoffsetarrow-up-right to the destination. For more information, see CREATEarrow-up-right.

The LLVM IR generator codearrow-up-right.

setimmutable

Original Yularrow-up-right auxiliary instruction.

Writes immutables to the auxiliary heap.

For more information, see the Differences with Ethereumarrow-up-right.

LLVM IR codegen references:

loadimmutable

Original Yularrow-up-right auxiliary instruction.

Reads immutables from the ImmutableSimulatorarrow-up-right.

For more information, see the Differences with Ethereumarrow-up-right.

LLVM IR codegen references:

linkersymbol

Original Yularrow-up-right 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 Ethereumarrow-up-right.

The LLVM IR generator codearrow-up-right.

memoryguard

Original Yularrow-up-right auxiliary instruction.

Is a Yul optimizer hint which is not used by our compiler. Instead, its only argument is simply unwrapped and returned.

The LLVM IR generator codearrow-up-right.

Original Yularrow-up-right auxiliary instruction.

Unlike on EVM, on Validium VM target this instruction has nothing to do with inserting of EVM bytecode. Instead, it is used to implement ZKsync VM Yul Extensionsarrow-up-right 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 ...).

The LLVM IR generator codearrow-up-right.

Last updated