ethereum.forks.arrow_glacier.vm.precompiled_contracts.identity

Ethereum Virtual Machine (EVM) IDENTITY PRECOMPILED CONTRACT.

.. contents:: Table of Contents :backlinks: none :local:

Introduction

Implementation of the IDENTITY precompiled contract.

identity

Writes the message data to output.

Parameters

evm : The current EVM frame.

def identity(evm: Evm) -> None:
26
    """
27
    Writes the message data to output.
28
29
    Parameters
30
    ----------
31
    evm :
32
        The current EVM frame.
33
34
    """
35
    data = evm.message.data
36
37
    # GAS
38
    word_count = ceil32(ulen(data)) // Uint(32)
39
    charge_gas(
40
        evm,
41
        GasCosts.PRECOMPILE_IDENTITY_BASE
42
        + GasCosts.PRECOMPILE_IDENTITY_PER_WORD * word_count,
43
    )
44
45
    # OPERATION
46
    evm.output = data