Ethereum  PoC-8
The C++ Implementation of Ethereum
dev::eth::Change Struct Reference

An atomic state changelog entry. More...

#include <State.h>

Public Types

enum  Kind : int {
  Balance, Storage, StorageRoot, Nonce,
  Create, Code, Touch
}
 

Public Member Functions

 Change (Kind _kind, Address const &_addr, u256 const &_value=0)
 Helper constructor to make change log update more readable. More...
 
 Change (Address const &_addr, u256 const &_key, u256 const &_value)
 Helper constructor especially for storage change log. More...
 
 Change (Address const &_addr, u256 const &_value)
 Helper constructor for nonce change log. More...
 
 Change (Address const &_addr, bytes const &_oldCode)
 Helper constructor especially for new code change log. More...
 

Public Attributes

Kind kind
 The kind of the change. More...
 
Address address
 Changed account address. More...
 
u256 value
 Change value, e.g. balance, storage and nonce. More...
 
u256 key
 Storage key. Last because used only in one case. More...
 
bytes oldCode
 Code overwritten by CREATE, empty except in case of address collision. More...
 

Detailed Description

An atomic state changelog entry.

Definition at line 86 of file State.h.

Member Enumeration Documentation

◆ Kind

Enumerator
Balance 

Account balance changed. Change::value contains the amount the balance was increased by.

Storage 

Account storage was modified. Change::key contains the storage key, Change::value the storage value.

StorageRoot 

Account storage root was modified. Change::value contains the old account storage root.

Nonce 

Account nonce was changed.

Create 

Account was created (it was not existing before).

Code 

New code was added to an account (by "create" message execution).

Touch 

Account was touched for the first time.

Definition at line 88 of file State.h.

Constructor & Destructor Documentation

◆ Change() [1/4]

dev::eth::Change::Change ( Kind  _kind,
Address const &  _addr,
u256 const &  _value = 0 
)
inline

Helper constructor to make change log update more readable.

Definition at line 122 of file State.h.

◆ Change() [2/4]

dev::eth::Change::Change ( Address const &  _addr,
u256 const &  _key,
u256 const &  _value 
)
inline

Helper constructor especially for storage change log.

Definition at line 129 of file State.h.

◆ Change() [3/4]

dev::eth::Change::Change ( Address const &  _addr,
u256 const &  _value 
)
inline

Helper constructor for nonce change log.

Definition at line 134 of file State.h.

◆ Change() [4/4]

dev::eth::Change::Change ( Address const &  _addr,
bytes const &  _oldCode 
)
inline

Helper constructor especially for new code change log.

Definition at line 139 of file State.h.

Member Data Documentation

◆ address

Address dev::eth::Change::address

Changed account address.

Definition at line 116 of file State.h.

◆ key

u256 dev::eth::Change::key

Storage key. Last because used only in one case.

Definition at line 118 of file State.h.

◆ kind

Kind dev::eth::Change::kind

The kind of the change.

Definition at line 115 of file State.h.

◆ oldCode

bytes dev::eth::Change::oldCode

Code overwritten by CREATE, empty except in case of address collision.

Definition at line 119 of file State.h.

◆ value

u256 dev::eth::Change::value

Change value, e.g. balance, storage and nonce.

Definition at line 117 of file State.h.


The documentation for this struct was generated from the following file: