|
| | Account () |
| | Construct a dead Account. More...
|
| |
| | Account (u256 _nonce, u256 _balance, Changedness _c=Changed) |
| |
| | Account (u256 _nonce, u256 _balance, h256 _contractRoot, h256 _codeHash, Changedness _c) |
| | Explicit constructor for wierd cases of construction or a contract account. More...
|
| |
| void | kill () |
| |
| bool | isAlive () const |
| |
| bool | isDirty () const |
| |
| void | untouch () |
| |
| bool | isEmpty () const |
| |
| u256 const & | balance () const |
| |
| void | addBalance (u256 _value) |
| | Increments the balance of this account by the given amount. More...
|
| |
| u256 | nonce () const |
| |
| void | incNonce () |
| | Increment the nonce of the account by one. More...
|
| |
| void | setNonce (u256 const &_nonce) |
| |
| h256 | baseRoot () const |
| |
| u256 | storageValue (u256 const &_key, OverlayDB const &_db) const |
| |
| u256 | originalStorageValue (u256 const &_key, OverlayDB const &_db) const |
| |
| std::unordered_map< u256, u256 > const & | storageOverlay () const |
| |
| void | setStorage (u256 _p, u256 _v) |
| |
| void | clearStorage () |
| | Empty the storage. Used when a contract is overwritten. More...
|
| |
| void | setStorageRoot (h256 const &_root) |
| | Set the storage root. Used when clearStorage() is reverted. More...
|
| |
| h256 | codeHash () const |
| |
| bool | hasNewCode () const |
| |
| void | setCode (bytes &&_code) |
| | Sets the code of the account. Used by "create" messages. More...
|
| |
| void | noteCode (bytesConstRef _code) |
| |
| bytes const & | code () const |
| |
Models the state of a single Ethereum account. Used to cache a portion of the full Ethereum state. State keeps a mapping of Address's to Accounts.
Aside from storing the nonce and balance, the account may also be "dead" (where isAlive() returns false). This allows State to explicitly store the notion of a deleted account in it's cache. kill() can be used for this.
For the account's storage, the class operates a cache. baseRoot() specifies the base state of the storage given as the Trie root to be looked up in the state database. Alterations beyond this base are specified in the overlay, stored in this class and retrieved with storageOverlay(). setStorage allows the overlay to be altered.
The constructor allows you to create an one of a number of "types" of accounts. The default constructor makes a dead account (this is ignored by State when writing out the Trie). Another three allow a basic or contract account to be specified along with an initial balance. The fina two allow either a basic or a contract account to be created with arbitrary values.
Definition at line 56 of file Account.h.