ethereum.forks.spurious_dragon.vm.precompiled_contracts.identityethereum.forks.byzantium.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 | """ |
|---|---|
| 28 | Writes the message data to output. |
| 29 | |
| 30 | Parameters |
| 31 | ---------- |
| 32 | evm : |
| 33 | The current EVM frame. |
| 34 | |
| 35 | """ |
| 36 | data = evm.message.data |
| 37 | |
| 38 | # GAS |
| 39 | word_count = ceil32(Uint(len(data))) // Uint(32) |
| 40 | charge_gas( |
| 41 | evm, |
| 42 | GAS_PRECOMPILE_IDENTITY_BASE |
| 43 | + GAS_PRECOMPILE_IDENTITY_PER_WORD * word_count, |
| 44 | ) |
| 45 | |
| 46 | # OPERATION |
| 47 | evm.output = data |