Environment


ADDRESS

Original EVMarrow-up-right instruction.

This value is fetched with a native EraVM instruction: context.thisarrow-up-right.

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

BALANCE

Original EVMarrow-up-right instruction.

System Contract

This information is requested a System Contract called L2BaseTokenarrow-up-right.

On how the System Contract is called, see this sectionarrow-up-right.

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

The request to the System Contract is done via the SystemRequestarrow-up-right runtime function.

ORIGIN

Original EVMarrow-up-right instruction.

System Contract

This information is requested a System Contract called SystemContextarrow-up-right.

On how the System Contract is called, see this sectionarrow-up-right.

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

The request to the System Contract is done via the SystemRequestarrow-up-right runtime function.

CALLER

Original EVMarrow-up-right instruction.

This value is fetched with a native EraVM instruction: context.callerarrow-up-right.

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

CALLVALUE

Original EVMarrow-up-right instruction.

This value is fetched with a native EraVM instruction: context.get_context_u128arrow-up-right.

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

CALLDATALOAD

Original EVMarrow-up-right instruction.

Calldata is accessed with a generic memory access instruction, but the memory chunk itself is a reference to the calling contract's heap. A fat pointer to the parent contract is passed via ABI using registers.

Then, the pointer is saved to a global stack variablearrow-up-right accessible from anywhere in the contract.

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

EraVM Assembly

CALLDATASIZE

Original EVMarrow-up-right instruction.

Calldata size is stored in the fat pointer passed from the parent contract (see CALLDATALOADarrow-up-right).

The size value can be extracted with bitwise operations as illustrated below.

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

EraVM Assembly

CALLDATACOPY

Original EVMarrow-up-right instruction.

Unlike on EVM, on EraVM it is a simple loop over CALLDATALOADarrow-up-right).

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

EraVM Assembly

CODECOPY

Original EVMarrow-up-right instruction.

See the EraVM docsarrow-up-right.

The LLVM IR generator codearrow-up-right.

CODESIZE

Original EVMarrow-up-right instruction.

See the EraVM docsarrow-up-right.

The LLVM IR generator codearrow-up-right.

GASPRICE

Original EVMarrow-up-right instruction.

System Contract

This information is requested a System Contract called SystemContextarrow-up-right.

On how the System Contract is called, see this sectionarrow-up-right.

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

The request to the System Contract is done via the SystemRequestarrow-up-right runtime function.

EXTCODESIZE

Original EVMarrow-up-right instruction.

System Contract

This information is requested a System Contract called AccountCodeStoragearrow-up-right.

On how the System Contract is called, see this sectionarrow-up-right.

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

The request to the System Contract is done via the SystemRequestarrow-up-right runtime function.

EXTCODECOPY

Original EVMarrow-up-right instruction.

Not supported. Triggers a compile-time error.

RETURNDATASIZE

Original EVMarrow-up-right instruction.

Return data size is read from the fat pointer returned from the child contract.

The size value can be extracted with bitwise operations as illustrated below.

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

EraVM Assembly

EraVM instruction: callarrow-up-right

RETURNDATACOPY

Original EVMarrow-up-right instruction.

Unlike on EVM, on EraVM it is a simple loop over memory operations on 256-bit values.

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

EraVM Assembly

EXTCODEHASH

Original EVMarrow-up-right instruction.

System Contract

This information is requested a System Contract called AccountCodeStoragearrow-up-right.

On how the System Contract is called, see this sectionarrow-up-right.

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

The request to the System Contract is done via the SystemRequestarrow-up-right runtime function.

Last updated