Ethereum Virtual Machine (EVM) IDENTITY PRECOMPILED CONTRACT

Introduction

Implementation of the IDENTITY precompiled contract.

Module Contents

Functions

identity

Writes the message data to output.

Module Details

identity

identity(evm: ethereum.byzantium.vm.Evm)None

Writes the message data to output.

Parameters

evm – The current EVM frame.

def identity(evm: Evm) -> None:
    data = evm.message.data

    # GAS
    word_count = ceil32(Uint(len(data))) // 32
    charge_gas(evm, GAS_IDENTITY + GAS_IDENTITY_WORD * word_count)

    # OPERATION
    evm.output = data