.. py:module:: ethereum.istanbul.vm.instructions.environment Ethereum Virtual Machine (EVM) Environmental Instructions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. contents:: Table of Contents :backlinks: none :local: Introduction ------------ Implementations of the EVM environment related instructions. .. only:: stage1 Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: :nosignatures: ethereum.istanbul.vm.instructions.environment.address ethereum.istanbul.vm.instructions.environment.balance ethereum.istanbul.vm.instructions.environment.origin ethereum.istanbul.vm.instructions.environment.caller ethereum.istanbul.vm.instructions.environment.callvalue ethereum.istanbul.vm.instructions.environment.calldataload ethereum.istanbul.vm.instructions.environment.calldatasize ethereum.istanbul.vm.instructions.environment.calldatacopy ethereum.istanbul.vm.instructions.environment.codesize ethereum.istanbul.vm.instructions.environment.codecopy ethereum.istanbul.vm.instructions.environment.gasprice ethereum.istanbul.vm.instructions.environment.extcodesize ethereum.istanbul.vm.instructions.environment.extcodecopy ethereum.istanbul.vm.instructions.environment.returndatasize ethereum.istanbul.vm.instructions.environment.returndatacopy ethereum.istanbul.vm.instructions.environment.extcodehash ethereum.istanbul.vm.instructions.environment.self_balance Module Details --------------- address ~~~~~~~ .. function:: address(evm: ethereum.istanbul.vm.Evm) -> None :noindexentry: Pushes the address of the current executing account to the stack. :param evm: The current EVM frame. .. undocinclude:: /../src/ethereum/istanbul/vm/instructions/environment.py :language: python :pyobject: address balance ~~~~~~~ .. function:: balance(evm: ethereum.istanbul.vm.Evm) -> None :noindexentry: Pushes the balance of the given account onto the stack. :param evm: The current EVM frame. .. undocinclude:: /../src/ethereum/istanbul/vm/instructions/environment.py :language: python :pyobject: balance origin ~~~~~~ .. function:: origin(evm: ethereum.istanbul.vm.Evm) -> None :noindexentry: Pushes the address of the original transaction sender to the stack. The origin address can only be an EOA. :param evm: The current EVM frame. .. undocinclude:: /../src/ethereum/istanbul/vm/instructions/environment.py :language: python :pyobject: origin caller ~~~~~~ .. function:: caller(evm: ethereum.istanbul.vm.Evm) -> None :noindexentry: Pushes the address of the caller onto the stack. :param evm: The current EVM frame. .. undocinclude:: /../src/ethereum/istanbul/vm/instructions/environment.py :language: python :pyobject: caller callvalue ~~~~~~~~~ .. function:: callvalue(evm: ethereum.istanbul.vm.Evm) -> None :noindexentry: Push the value (in wei) sent with the call onto the stack. :param evm: The current EVM frame. .. undocinclude:: /../src/ethereum/istanbul/vm/instructions/environment.py :language: python :pyobject: callvalue calldataload ~~~~~~~~~~~~ .. function:: calldataload(evm: ethereum.istanbul.vm.Evm) -> None :noindexentry: Push a word (32 bytes) of the input data belonging to the current environment onto the stack. :param evm: The current EVM frame. .. undocinclude:: /../src/ethereum/istanbul/vm/instructions/environment.py :language: python :pyobject: calldataload calldatasize ~~~~~~~~~~~~ .. function:: calldatasize(evm: ethereum.istanbul.vm.Evm) -> None :noindexentry: Push the size of input data in current environment onto the stack. :param evm: The current EVM frame. .. undocinclude:: /../src/ethereum/istanbul/vm/instructions/environment.py :language: python :pyobject: calldatasize calldatacopy ~~~~~~~~~~~~ .. function:: calldatacopy(evm: ethereum.istanbul.vm.Evm) -> None :noindexentry: Copy a portion of the input data in current environment to memory. This will also expand the memory, in case that the memory is insufficient to store the data. :param evm: The current EVM frame. .. undocinclude:: /../src/ethereum/istanbul/vm/instructions/environment.py :language: python :pyobject: calldatacopy codesize ~~~~~~~~ .. function:: codesize(evm: ethereum.istanbul.vm.Evm) -> None :noindexentry: Push the size of code running in current environment onto the stack. :param evm: The current EVM frame. .. undocinclude:: /../src/ethereum/istanbul/vm/instructions/environment.py :language: python :pyobject: codesize codecopy ~~~~~~~~ .. function:: codecopy(evm: ethereum.istanbul.vm.Evm) -> None :noindexentry: Copy a portion of the code in current environment to memory. This will also expand the memory, in case that the memory is insufficient to store the data. :param evm: The current EVM frame. .. undocinclude:: /../src/ethereum/istanbul/vm/instructions/environment.py :language: python :pyobject: codecopy gasprice ~~~~~~~~ .. function:: gasprice(evm: ethereum.istanbul.vm.Evm) -> None :noindexentry: Push the gas price used in current environment onto the stack. :param evm: The current EVM frame. .. undocinclude:: /../src/ethereum/istanbul/vm/instructions/environment.py :language: python :pyobject: gasprice extcodesize ~~~~~~~~~~~ .. function:: extcodesize(evm: ethereum.istanbul.vm.Evm) -> None :noindexentry: Push the code size of a given account onto the stack. :param evm: The current EVM frame. .. undocinclude:: /../src/ethereum/istanbul/vm/instructions/environment.py :language: python :pyobject: extcodesize extcodecopy ~~~~~~~~~~~ .. function:: extcodecopy(evm: ethereum.istanbul.vm.Evm) -> None :noindexentry: Copy a portion of an account's code to memory. :param evm: The current EVM frame. .. undocinclude:: /../src/ethereum/istanbul/vm/instructions/environment.py :language: python :pyobject: extcodecopy returndatasize ~~~~~~~~~~~~~~ .. function:: returndatasize(evm: ethereum.istanbul.vm.Evm) -> None :noindexentry: Pushes the size of the return data buffer onto the stack. :param evm: The current EVM frame. .. undocinclude:: /../src/ethereum/istanbul/vm/instructions/environment.py :language: python :pyobject: returndatasize returndatacopy ~~~~~~~~~~~~~~ .. function:: returndatacopy(evm: ethereum.istanbul.vm.Evm) -> None :noindexentry: Copies data from the return data buffer code to memory :param evm: The current EVM frame. .. undocinclude:: /../src/ethereum/istanbul/vm/instructions/environment.py :language: python :pyobject: returndatacopy extcodehash ~~~~~~~~~~~ .. function:: extcodehash(evm: ethereum.istanbul.vm.Evm) -> None :noindexentry: Returns the keccak256 hash of a contract’s bytecode :param evm: The current EVM frame. .. undocinclude:: /../src/ethereum/istanbul/vm/instructions/environment.py :language: python :pyobject: extcodehash self_balance ~~~~~~~~~~~~ .. function:: self_balance(evm: ethereum.istanbul.vm.Evm) -> None :noindexentry: Pushes the balance of the current address to the stack. :param evm: The current EVM frame. .. undocinclude:: /../src/ethereum/istanbul/vm/instructions/environment.py :language: python :pyobject: self_balance