EVMC
evmc::address Struct Reference

The big-endian 160-bit hash suitable for keeping an Ethereum address. More...

#include <evmc.hpp>

Inherits evmc_address.

Public Member Functions

constexpr address (evmc_address init={}) noexcept
 Default and converting constructor. More...
 
constexpr address (uint64_t v) noexcept
 Converting constructor from unsigned integer value. More...
 
constexpr operator bool () const noexcept
 Explicit operator converting to bool.
 

Additional Inherited Members

- Public Attributes inherited from evmc_address
uint8_t bytes [20]
 The 20 bytes of the hash. More...
 

Detailed Description

The big-endian 160-bit hash suitable for keeping an Ethereum address.

This type wraps C evmc_address to make sure objects of this type are always initialized.

Definition at line 21 of file evmc.hpp.

Constructor & Destructor Documentation

◆ address() [1/2]

constexpr evmc::address::address ( evmc_address  init = {})
inlinenoexcept

Default and converting constructor.

Initializes bytes to zeros if not other init value provided.

Definition at line 26 of file evmc.hpp.

26 {}) noexcept : evmc_address{init} {}
Big-endian 160-bit hash suitable for keeping an Ethereum address.
Definition: evmc.h:68

◆ address() [2/2]

constexpr evmc::address::address ( uint64_t  v)
inlineexplicitnoexcept

Converting constructor from unsigned integer value.

This constructor assigns the v value to the last 8 bytes [12:19] in big-endian order.

Definition at line 32 of file evmc.hpp.

33  : evmc_address{{0,
34  0,
35  0,
36  0,
37  0,
38  0,
39  0,
40  0,
41  0,
42  0,
43  0,
44  0,
45  static_cast<uint8_t>(v >> 56),
46  static_cast<uint8_t>(v >> 48),
47  static_cast<uint8_t>(v >> 40),
48  static_cast<uint8_t>(v >> 32),
49  static_cast<uint8_t>(v >> 24),
50  static_cast<uint8_t>(v >> 16),
51  static_cast<uint8_t>(v >> 8),
52  static_cast<uint8_t>(v >> 0)}}
53  {}
Big-endian 160-bit hash suitable for keeping an Ethereum address.
Definition: evmc.h:68

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