Skip to content

Latest commit

 

History

History
98 lines (49 loc) · 5.55 KB

File metadata and controls

98 lines (49 loc) · 5.55 KB

Yul Auxiliary Instructions

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

Unlike on EVM, on EraVM 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:

  1. zksolc compiler
  2. Shared FE code

Unlike on EVM, on EraVM 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:

  1. zksolc compiler
  2. Shared FE code

Unlike on EVM, on EraVM target this instruction copies the bytecode hash passed as dataoffset to the destination. For more information, see CREATE.

The LLVM IR generator code.

Writes immutables to the auxiliary heap.

For more information, see the zkSync Era documentation.

LLVM IR codegen references:

  1. zksolc compiler
  2. Shared FE code

Reads immutables from the ImmutableSimulator.

For more information, see the zkSync Era documentation.

LLVM IR codegen references:

  1. zksolc compiler
  2. Shared FE code

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 zkSync Era documentation.

The LLVM IR generator code.

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 code.

Unlike on EVM, on EraVM target this instruction has nothing to do with inserting of EVM bytecode. Instead, it is used to implement EraVM Yul extensions available in the system mode. In order to compile a Yul contract with zksolc, both Yul and system mode must be enabled (zksolc --yul --system-mode ...).

The LLVM IR generator code.