ethereum.forks.bpo5.vm.precompiled_contracts.identityethereum.forks.amsterdam.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:
| 27 | <snip> |
|---|---|
| 35 | data = evm.message.data |
| 36 | data = evm.call_data |
| 37 | |
| 38 | # GAS |
| 39 | word_count = ceil32(ulen(data)) // Uint(32) |
| 40 | charge_gas( |
| 41 | evm, |
| 41 | GasCosts.PRECOMPILE_IDENTITY_BASE |
| 42 | + GasCosts.PRECOMPILE_IDENTITY_PER_WORD * word_count, |
| 42 | ExecutionGas( |
| 43 | GasCosts.PRECOMPILE_IDENTITY_BASE |
| 44 | + GasCosts.PRECOMPILE_IDENTITY_PER_WORD * word_count |
| 45 | ), |
| 46 | ) |
| 47 | |
| 48 | # OPERATION |
| 49 | evm.output = data |