Fabcoin Core  0.16.2
P2P Digital Currency
Public Member Functions | Private Attributes | List of all members
dev::eth::ExtVM Class Reference

Externality interface for the Virtual Machine providing access to world state. More...

#include <ExtVM.h>

Inheritance diagram for dev::eth::ExtVM:
[legend]
Collaboration diagram for dev::eth::ExtVM:
[legend]

Public Member Functions

 ExtVM (State &_s, EnvInfo const &_envInfo, SealEngineFace const &_sealEngine, Address _myAddress, Address _caller, Address _origin, u256 _value, u256 _gasPrice, bytesConstRef _data, bytesConstRef _code, h256 const &_codeHash, unsigned _depth=0)
 Full constructor. More...
 
virtual u256 store (u256 _n) overridefinal
 Read storage location. More...
 
virtual void setStore (u256 _n, u256 _v) overridefinal
 Write a value in storage. More...
 
virtual bytes const & codeAt (Address _a) overridefinal
 Read address's code. More...
 
virtual size_t codeSizeAt (Address _a) overridefinal
 
virtual h160 create (u256 _endowment, u256 &io_gas, bytesConstRef _code, OnOpFunc const &_onOp={}) overridefinal
 Create a new contract. More...
 
virtual boost::optional< owning_bytes_refcall (CallParameters &_params) overridefinal
 Create a new message call. Leave _myAddressOverride as the default to use the present address as caller. More...
 
virtual u256 balance (Address _a) overridefinal
 Read address's balance. More...
 
virtual bool exists (Address _a) overridefinal
 Does the account exist? More...
 
virtual void suicide (Address _a) overridefinal
 Suicide the associated contract to the given address. More...
 
virtual EVMSchedule const & evmSchedule () const overridefinal
 Return the EVM gas-price schedule for this execution context. More...
 
State const & state () const
 
- Public Member Functions inherited from dev::eth::ExtVMFace
 ExtVMFace ()=default
 Null constructor. More...
 
 ExtVMFace (EnvInfo const &_envInfo, Address _myAddress, Address _caller, Address _origin, u256 _value, u256 _gasPrice, bytesConstRef _data, bytes _code, h256 const &_codeHash, unsigned _depth)
 Full constructor. More...
 
virtual ~ExtVMFace ()=default
 
 ExtVMFace (ExtVMFace const &)=delete
 
ExtVMFaceoperator= (ExtVMFace const &)=delete
 
virtual void log (h256s &&_topics, bytesConstRef _data)
 Revert any changes made (by any of the other calls). More...
 
h256 blockHash (u256 _number)
 Hash of a block if within the last 256 blocks, or h256() otherwise. More...
 
EnvInfo const & envInfo () const
 Get the execution environment information. More...
 

Private Attributes

Statem_s
 A reference to the base state. More...
 
SealEngineFace const & m_sealEngine
 

Additional Inherited Members

- Public Attributes inherited from dev::eth::ExtVMFace
Address myAddress
 Address associated with executing code (a contract, or contract-to-be). More...
 
Address caller
 Address which sent the message (either equal to origin or a contract). More...
 
Address origin
 Original transactor. More...
 
u256 value
 Value (in Wei) that was passed to this address. More...
 
u256 gasPrice
 Price of gas (that we already paid). More...
 
bytesConstRef data
 Current input data. More...
 
bytes code
 Current code that is executing. More...
 
h256 codeHash
 SHA3 hash of the executing code. More...
 
SubState sub
 Sub-band VM state (suicides, refund counter, logs). More...
 
unsigned depth = 0
 Depth of the present call. More...
 

Detailed Description

Externality interface for the Virtual Machine providing access to world state.

Definition at line 42 of file ExtVM.h.

Constructor & Destructor Documentation

dev::eth::ExtVM::ExtVM ( State _s,
EnvInfo const &  _envInfo,
SealEngineFace const &  _sealEngine,
Address  _myAddress,
Address  _caller,
Address  _origin,
u256  _value,
u256  _gasPrice,
bytesConstRef  _data,
bytesConstRef  _code,
h256 const &  _codeHash,
unsigned  _depth = 0 
)
inline

Full constructor.

Definition at line 46 of file ExtVM.h.

Here is the call graph for this function:

Member Function Documentation

virtual u256 dev::eth::ExtVM::balance ( Address  _a)
inlinefinaloverridevirtual

Read address's balance.

Reimplemented from dev::eth::ExtVMFace.

Definition at line 74 of file ExtVM.h.

Here is the call graph for this function:

boost::optional< owning_bytes_ref > ExtVM::call ( CallParameters _params)
finaloverridevirtual

Create a new message call. Leave _myAddressOverride as the default to use the present address as caller.

Implements dev::eth::ExtVMFace.

Definition at line 95 of file ExtVM.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bytes const& dev::eth::ExtVM::codeAt ( Address  _a)
inlinefinaloverridevirtual

Read address's code.

Reimplemented from dev::eth::ExtVMFace.

Definition at line 62 of file ExtVM.h.

Here is the call graph for this function:

size_t ExtVM::codeSizeAt ( dev::Address  _a)
finaloverridevirtual
Returns
the size of the code in bytes at the given address.

Reimplemented from dev::eth::ExtVMFace.

Definition at line 111 of file ExtVM.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

h160 ExtVM::create ( u256  _endowment,
u256 io_gas,
bytesConstRef  _code,
OnOpFunc const &  _onOp = {} 
)
finaloverridevirtual

Create a new contract.

Reimplemented from dev::eth::ExtVMFace.

Definition at line 121 of file ExtVM.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual EVMSchedule const& dev::eth::ExtVM::evmSchedule ( ) const
inlinefinaloverridevirtual

Return the EVM gas-price schedule for this execution context.

Reimplemented from dev::eth::ExtVMFace.

Definition at line 89 of file ExtVM.h.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool dev::eth::ExtVM::exists ( Address  _a)
inlinefinaloverridevirtual

Does the account exist?

Reimplemented from dev::eth::ExtVMFace.

Definition at line 77 of file ExtVM.h.

Here is the call graph for this function:

void ExtVM::setStore ( u256  _n,
u256  _v 
)
finaloverridevirtual

Write a value in storage.

Reimplemented from dev::eth::ExtVMFace.

Definition at line 116 of file ExtVM.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

State const& dev::eth::ExtVM::state ( ) const
inline

Definition at line 91 of file ExtVM.h.

Here is the caller graph for this function:

virtual u256 dev::eth::ExtVM::store ( u256  _n)
inlinefinaloverridevirtual

Read storage location.

Reimplemented from dev::eth::ExtVMFace.

Definition at line 56 of file ExtVM.h.

Here is the call graph for this function:

void ExtVM::suicide ( Address  _a)
finaloverridevirtual

Suicide the associated contract to the given address.

Reimplemented from dev::eth::ExtVMFace.

Definition at line 133 of file ExtVM.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

State& dev::eth::ExtVM::m_s
private

A reference to the base state.

Definition at line 94 of file ExtVM.h.

SealEngineFace const& dev::eth::ExtVM::m_sealEngine
private

Definition at line 95 of file ExtVM.h.


The documentation for this class was generated from the following files: