ethereum.spurious_dragon.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:
23
    """
24
    Writes the message data to output.
25
26
    Parameters
27
    ----------
28
    evm :
29
        The current EVM frame.
30
    """
31
    data = evm.message.data
32
33
    # GAS
34
    word_count = ceil32(Uint(len(data))) // Uint(32)
35
    charge_gas(evm, GAS_IDENTITY + GAS_IDENTITY_WORD * word_count)
36
37
    # OPERATION
38
    evm.output = data