ethereum.forks.constantinople.vm.precompiled_contracts.identityethereum.forks.istanbul.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 | """ |
| 32 | data = evm.message.data |
| 33 | |
| 34 | # GAS |
| 35 | word_count = ceil32(Uint(len(data))) // Uint(32) |
| 36 | charge_gas(evm, GAS_IDENTITY + GAS_IDENTITY_WORD * word_count) |
| 37 | |
| 38 | # OPERATION |
| 39 | evm.output = data |