Ethereum  PoC-8
The C++ Implementation of Ethereum
dev::eth::ExtVMFace Class Referenceabstract

Interface and null implementation of the class for specifying VM externalities. More...

#include <ExtVMFace.h>

Inheritance diagram for dev::eth::ExtVMFace:
dev::eth::ExtVM

Public Member Functions

 ExtVMFace (EnvInfo const &_envInfo, Address _myAddress, Address _caller, Address _origin, u256 _value, u256 _gasPrice, bytesConstRef _data, bytes _code, h256 const &_codeHash, unsigned _depth, bool _isCreate, bool _staticCall)
 Full constructor. More...
 
virtual ~ExtVMFace ()=default
 
 ExtVMFace (ExtVMFace const &)=delete
 
ExtVMFaceoperator= (ExtVMFace const &)=delete
 
virtual u256 store (u256)
 Read storage location. More...
 
virtual void setStore (u256, u256)
 Write a value in storage. More...
 
virtual u256 originalStorageValue (u256 const &)
 Read original storage value (before modifications in the current transaction). More...
 
virtual u256 balance (Address)
 Read address's balance. More...
 
virtual bytes const & codeAt (Address)
 Read address's code. More...
 
virtual size_t codeSizeAt (Address)
 
virtual h256 codeHashAt (Address)
 
virtual bool exists (Address)
 Does the account exist? More...
 
virtual void suicide (Address)
 Suicide the associated contract and give proceeds to the given address. More...
 
virtual CreateResult create (u256, u256 &, bytesConstRef, Instruction, u256, OnOpFunc const &)=0
 Create a new (contract) account. More...
 
virtual CallResult call (CallParameters &)=0
 Make a new message call. More...
 
virtual void log (h256s &&_topics, bytesConstRef _data)
 Revert any changes made (by any of the other calls). More...
 
virtual h256 blockHash (u256 _number)=0
 Hash of a block if within the last 256 blocks, or h256() otherwise. More...
 
EnvInfo const & envInfo () const
 Get the execution environment information. More...
 
virtual EVMSchedule const & evmSchedule () const
 Return the EVM gas-price schedule for this execution context. More...
 

Public Attributes

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...
 
u256 salt
 Values used in new address construction by CREATE2. More...
 
SubState sub
 Sub-band VM state (suicides, refund counter, logs). More...
 
unsigned depth = 0
 Depth of the present call. More...
 
bool isCreate = false
 Is this a CREATE call? More...
 
bool staticCall = false
 Throw on state changing. More...
 

Detailed Description

Interface and null implementation of the class for specifying VM externalities.

Definition at line 203 of file ExtVMFace.h.

Constructor & Destructor Documentation

◆ ExtVMFace() [1/2]

dev::eth::ExtVMFace::ExtVMFace ( EnvInfo const &  _envInfo,
Address  _myAddress,
Address  _caller,
Address  _origin,
u256  _value,
u256  _gasPrice,
bytesConstRef  _data,
bytes  _code,
h256 const &  _codeHash,
unsigned  _depth,
bool  _isCreate,
bool  _staticCall 
)

Full constructor.

Definition at line 298 of file ExtVMFace.cpp.

◆ ~ExtVMFace()

virtual dev::eth::ExtVMFace::~ExtVMFace ( )
virtualdefault

◆ ExtVMFace() [2/2]

dev::eth::ExtVMFace::ExtVMFace ( ExtVMFace const &  )
delete

Member Function Documentation

◆ balance()

virtual u256 dev::eth::ExtVMFace::balance ( Address  )
inlinevirtual

Read address's balance.

Reimplemented in dev::eth::ExtVM.

Definition at line 226 of file ExtVMFace.h.

◆ blockHash()

virtual h256 dev::eth::ExtVMFace::blockHash ( u256  _number)
pure virtual

Hash of a block if within the last 256 blocks, or h256() otherwise.

Implemented in dev::eth::ExtVM.

◆ call()

virtual CallResult dev::eth::ExtVMFace::call ( CallParameters )
pure virtual

Make a new message call.

Implemented in dev::eth::ExtVM.

◆ codeAt()

virtual bytes const& dev::eth::ExtVMFace::codeAt ( Address  )
inlinevirtual

Read address's code.

Reimplemented in dev::eth::ExtVM.

Definition at line 229 of file ExtVMFace.h.

◆ codeHashAt()

virtual h256 dev::eth::ExtVMFace::codeHashAt ( Address  )
inlinevirtual
Returns
the hash of the code at the given address.

Reimplemented in dev::eth::ExtVM.

Definition at line 235 of file ExtVMFace.h.

◆ codeSizeAt()

virtual size_t dev::eth::ExtVMFace::codeSizeAt ( Address  )
inlinevirtual
Returns
the size of the code in bytes at the given address.

Reimplemented in dev::eth::ExtVM.

Definition at line 232 of file ExtVMFace.h.

◆ create()

virtual CreateResult dev::eth::ExtVMFace::create ( u256  ,
u256 ,
bytesConstRef  ,
Instruction  ,
u256  ,
OnOpFunc const &   
)
pure virtual

Create a new (contract) account.

Implemented in dev::eth::ExtVM.

◆ envInfo()

EnvInfo const& dev::eth::ExtVMFace::envInfo ( ) const
inline

Get the execution environment information.

Definition at line 256 of file ExtVMFace.h.

◆ evmSchedule()

virtual EVMSchedule const& dev::eth::ExtVMFace::evmSchedule ( ) const
inlinevirtual

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

Reimplemented in dev::eth::ExtVM.

Definition at line 259 of file ExtVMFace.h.

◆ exists()

virtual bool dev::eth::ExtVMFace::exists ( Address  )
inlinevirtual

Does the account exist?

Reimplemented in dev::eth::ExtVM.

Definition at line 238 of file ExtVMFace.h.

◆ log()

virtual void dev::eth::ExtVMFace::log ( h256s &&  _topics,
bytesConstRef  _data 
)
inlinevirtual

Revert any changes made (by any of the other calls).

Definition at line 250 of file ExtVMFace.h.

◆ operator=()

ExtVMFace& dev::eth::ExtVMFace::operator= ( ExtVMFace const &  )
delete

◆ originalStorageValue()

virtual u256 dev::eth::ExtVMFace::originalStorageValue ( u256 const &  )
inlinevirtual

Read original storage value (before modifications in the current transaction).

Reimplemented in dev::eth::ExtVM.

Definition at line 223 of file ExtVMFace.h.

◆ setStore()

virtual void dev::eth::ExtVMFace::setStore ( u256  ,
u256   
)
inlinevirtual

Write a value in storage.

Reimplemented in dev::eth::ExtVM.

Definition at line 220 of file ExtVMFace.h.

◆ store()

virtual u256 dev::eth::ExtVMFace::store ( u256  )
inlinevirtual

Read storage location.

Reimplemented in dev::eth::ExtVM.

Definition at line 217 of file ExtVMFace.h.

◆ suicide()

virtual void dev::eth::ExtVMFace::suicide ( Address  )
inlinevirtual

Suicide the associated contract and give proceeds to the given address.

Reimplemented in dev::eth::ExtVM.

Definition at line 241 of file ExtVMFace.h.

Member Data Documentation

◆ caller

Address dev::eth::ExtVMFace::caller

Address which sent the message (either equal to origin or a contract).

Definition at line 267 of file ExtVMFace.h.

◆ code

bytes dev::eth::ExtVMFace::code

Current code that is executing.

Definition at line 272 of file ExtVMFace.h.

◆ codeHash

h256 dev::eth::ExtVMFace::codeHash

SHA3 hash of the executing code.

Definition at line 273 of file ExtVMFace.h.

◆ data

bytesConstRef dev::eth::ExtVMFace::data

Current input data.

Definition at line 271 of file ExtVMFace.h.

◆ depth

unsigned dev::eth::ExtVMFace::depth = 0

Depth of the present call.

Definition at line 276 of file ExtVMFace.h.

◆ gasPrice

u256 dev::eth::ExtVMFace::gasPrice

Price of gas (that we already paid).

Definition at line 270 of file ExtVMFace.h.

◆ isCreate

bool dev::eth::ExtVMFace::isCreate = false

Is this a CREATE call?

Definition at line 277 of file ExtVMFace.h.

◆ myAddress

Address dev::eth::ExtVMFace::myAddress

Address associated with executing code (a contract, or contract-to-be).

Definition at line 266 of file ExtVMFace.h.

◆ origin

Address dev::eth::ExtVMFace::origin

Original transactor.

Definition at line 268 of file ExtVMFace.h.

◆ salt

u256 dev::eth::ExtVMFace::salt

Values used in new address construction by CREATE2.

Definition at line 274 of file ExtVMFace.h.

◆ staticCall

bool dev::eth::ExtVMFace::staticCall = false

Throw on state changing.

Definition at line 278 of file ExtVMFace.h.

◆ sub

SubState dev::eth::ExtVMFace::sub

Sub-band VM state (suicides, refund counter, logs).

Definition at line 275 of file ExtVMFace.h.

◆ value

u256 dev::eth::ExtVMFace::value

Value (in Wei) that was passed to this address.

Definition at line 269 of file ExtVMFace.h.


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