diff --git a/annotated.html b/annotated.html new file mode 100644 index 000000000..6c7bf50ae --- /dev/null +++ b/annotated.html @@ -0,0 +1,104 @@ + + + + + + + +EVMC: Class List + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Class List
+
+
+
Here are the classes, structs, unions and interfaces with brief descriptions:
+
[detail level 123]
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
 NevmcEVMC C++ API - wrappers and bindings for C++
 CaddressThe big-endian 160-bit hash suitable for keeping an Ethereum address
 Cbyte_traitsThe char traits for byte-like types
 Cbytes32The fixed size array of 32 bytes for storing 256-bit EVM values
 Cfilter_iteratorThe filter iterator adaptor creates a view of an iterator range in which some elements of the range are skipped
 CHostAbstract class to be used by Host implementations
 CHostContextWrapper around EVMC host context / host interface
 CHostInterfaceThe EVMC Host interface
 CMockedAccountMocked account
 CMockedHostMocked EVMC Host implementation
 Clog_recordLOG record
 CResultThe EVM code execution result.
 Cskip_space_iteratorThe input filter iterator which skips whitespace characters from the base input iterator
 CStorageValueExtended value (with original value and access flag) for account storage
 CVMThe VM instance.
 Cevmc_addressBig-endian 160-bit hash suitable for keeping an Ethereum address
 Cevmc_bytes32The fixed size array of 32 bytes
 Cevmc_host_contextThe opaque data type representing the Host execution context
 Cevmc_host_interfaceThe Host interface
 Cevmc_instruction_metricsMetrics for an EVM 1 instruction
 Cevmc_messageThe message describing an EVM call, including a zero-depth calls from a transaction origin
 Cevmc_resultThe EVM code execution result
 Cevmc_result_optional_storageThe union representing evmc_result "optional storage"
 Cevmc_tx_contextThe transaction and block data for execution
 Cevmc_tx_initcodeThe hashed initcode used for TXCREATE instruction
 Cevmc_vmThe VM instance
+
+
+
+ + + + diff --git a/annotated_dup.js b/annotated_dup.js new file mode 100644 index 000000000..b3f8a4935 --- /dev/null +++ b/annotated_dup.js @@ -0,0 +1,29 @@ +var annotated_dup = +[ + [ "evmc", "namespaceevmc.html", [ + [ "address", "structevmc_1_1address.html", "structevmc_1_1address" ], + [ "byte_traits", "structevmc_1_1byte__traits.html", "structevmc_1_1byte__traits" ], + [ "bytes32", "structevmc_1_1bytes32.html", "structevmc_1_1bytes32" ], + [ "filter_iterator", "structevmc_1_1filter__iterator.html", "structevmc_1_1filter__iterator" ], + [ "Host", "classevmc_1_1Host.html", "classevmc_1_1Host" ], + [ "HostContext", "classevmc_1_1HostContext.html", "classevmc_1_1HostContext" ], + [ "HostInterface", "classevmc_1_1HostInterface.html", "classevmc_1_1HostInterface" ], + [ "MockedAccount", "structevmc_1_1MockedAccount.html", "structevmc_1_1MockedAccount" ], + [ "MockedHost", "classevmc_1_1MockedHost.html", "classevmc_1_1MockedHost" ], + [ "Result", "classevmc_1_1Result.html", "classevmc_1_1Result" ], + [ "skip_space_iterator", "structevmc_1_1skip__space__iterator.html", null ], + [ "StorageValue", "structevmc_1_1StorageValue.html", "structevmc_1_1StorageValue" ], + [ "VM", "classevmc_1_1VM.html", "classevmc_1_1VM" ] + ] ], + [ "evmc_address", "structevmc__address.html", "structevmc__address" ], + [ "evmc_bytes32", "structevmc__bytes32.html", "structevmc__bytes32" ], + [ "evmc_host_context", "structevmc__host__context.html", null ], + [ "evmc_host_interface", "structevmc__host__interface.html", "structevmc__host__interface" ], + [ "evmc_instruction_metrics", "structevmc__instruction__metrics.html", "structevmc__instruction__metrics" ], + [ "evmc_message", "structevmc__message.html", "structevmc__message" ], + [ "evmc_result", "structevmc__result.html", "structevmc__result" ], + [ "evmc_result_optional_storage", "unionevmc__result__optional__storage.html", "unionevmc__result__optional__storage" ], + [ "evmc_tx_context", "structevmc__tx__context.html", "structevmc__tx__context" ], + [ "evmc_tx_initcode", "structevmc__tx__initcode.html", "structevmc__tx__initcode" ], + [ "evmc_vm", "structevmc__vm.html", "structevmc__vm" ] +]; \ No newline at end of file diff --git a/bc_s.png b/bc_s.png new file mode 100644 index 000000000..224b29aa9 Binary files /dev/null and b/bc_s.png differ diff --git a/bc_sd.png b/bc_sd.png new file mode 100644 index 000000000..31ca888dc Binary files /dev/null and b/bc_sd.png differ diff --git a/bdwn.png b/bdwn.png new file mode 100644 index 000000000..940a0b950 Binary files /dev/null and b/bdwn.png differ diff --git a/bindings/rust/evmc-sys/evmc.h b/bindings/rust/evmc-sys/evmc.h deleted file mode 120000 index 68e4b5bee..000000000 --- a/bindings/rust/evmc-sys/evmc.h +++ /dev/null @@ -1 +0,0 @@ -../../../include/evmc/evmc.h \ No newline at end of file diff --git a/bytes_8hpp_source.html b/bytes_8hpp_source.html new file mode 100644 index 000000000..b1a3a59ab --- /dev/null +++ b/bytes_8hpp_source.html @@ -0,0 +1,167 @@ + + + + + + + +EVMC: include/evmc/bytes.hpp Source File + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
bytes.hpp
+
+
+
1// EVMC: Ethereum Client-VM Connector API.
+
2// Copyright 2024 The EVMC Authors.
+
3// Licensed under the Apache License, Version 2.0.
+
4#pragma once
+
5
+
6#include <algorithm>
+
7#include <cstring>
+
8#include <string>
+
9#include <string_view>
+
10
+
11namespace evmc
+
12{
+
16template <typename T>
+
17struct byte_traits : std::char_traits<char>
+
18{
+
19 static_assert(sizeof(T) == 1, "type must be a byte");
+
20
+
21 using char_type = T;
+
22
+
24 static constexpr void assign(char_type& c1, const char_type& c2) { c1 = c2; }
+
25
+
27 static constexpr char_type* assign(char_type* ptr, std::size_t count, char_type value)
+
28 {
+
29 std::fill_n(ptr, count, value);
+
30 return ptr;
+
31 }
+
32
+
34 static constexpr bool eq(char_type a, char_type b) { return a == b; }
+
35
+
37 static constexpr bool lt(char_type a, char_type b) { return a < b; }
+
38
+
40 static constexpr char_type* move(char_type* dest, const char_type* src, std::size_t count)
+
41 {
+
42 if (dest < src)
+
43 std::copy_n(src, count, dest);
+
44 else if (src < dest)
+
45 std::copy_backward(src, src + count, dest + count);
+
46 return dest;
+
47 }
+
48
+
50 static constexpr char_type* copy(char_type* dest, const char_type* src, std::size_t count)
+
51 {
+
52 std::copy_n(src, count, dest);
+
53 return dest;
+
54 }
+
55
+
57 static constexpr int compare(const char_type* a, const char_type* b, std::size_t count)
+
58 {
+
59 for (; count != 0; --count, ++a, ++b)
+
60 {
+
61 if (lt(*a, *b))
+
62 return -1;
+
63 if (lt(*b, *a))
+
64 return 1;
+
65 }
+
66 return 0;
+
67 }
+
68
+
70 // TODO: Not constexpr
+
71 static std::size_t length(const char_type* s)
+
72 {
+
73 return std::strlen(reinterpret_cast<const char*>(s));
+
74 }
+
75
+
78 static constexpr const char_type* find(const char_type* s,
+
79 std::size_t count,
+
80 const char_type& value)
+
81 {
+
82 const auto end = s + count;
+
83 const auto p = std::find(s, end, value);
+
84 return p != end ? p : nullptr;
+
85 }
+
86};
+
87
+
89using bytes = std::basic_string<unsigned char, byte_traits<unsigned char>>;
+
90
+
92using bytes_view = std::basic_string_view<unsigned char, byte_traits<unsigned char>>;
+
93} // namespace evmc
+
EVMC C++ API - wrappers and bindings for C++.
Definition: bytes.hpp:12
+
std::basic_string_view< unsigned char, byte_traits< unsigned char > > bytes_view
String view of unsigned chars representing bytes.
Definition: bytes.hpp:92
+
std::basic_string< unsigned char, byte_traits< unsigned char > > bytes
String of unsigned chars representing bytes.
Definition: bytes.hpp:89
+
The char traits for byte-like types.
Definition: bytes.hpp:18
+
static constexpr void assign(char_type &c1, const char_type &c2)
Assigns c2 to c1.
Definition: bytes.hpp:24
+
static constexpr char_type * copy(char_type *dest, const char_type *src, std::size_t count)
Copies count bytes from src to dest. The ranges must not overlap.
Definition: bytes.hpp:50
+
static std::size_t length(const char_type *s)
Returns the length of a null-terminated byte string.
Definition: bytes.hpp:71
+
static constexpr bool eq(char_type a, char_type b)
Returns true if bytes are equal.
Definition: bytes.hpp:34
+
static constexpr char_type * move(char_type *dest, const char_type *src, std::size_t count)
Copies count bytes from src to dest. Performs correctly even if ranges overlap.
Definition: bytes.hpp:40
+
static constexpr int compare(const char_type *a, const char_type *b, std::size_t count)
Compares lexicographically the bytes in two ranges of equal length.
Definition: bytes.hpp:57
+
static constexpr const char_type * find(const char_type *s, std::size_t count, const char_type &value)
Finds the value in the range of bytes and returns the pointer to the first occurrence or nullptr if n...
Definition: bytes.hpp:78
+
static constexpr bool lt(char_type a, char_type b)
Returns true if byte a is less than byte b.
Definition: bytes.hpp:37
+
T char_type
The byte type.
Definition: bytes.hpp:21
+
static constexpr char_type * assign(char_type *ptr, std::size_t count, char_type value)
Assigns value to each byte in [ptr, ptr+count).
Definition: bytes.hpp:27
+
+
+ + + + diff --git a/classes.html b/classes.html new file mode 100644 index 000000000..78dc9debf --- /dev/null +++ b/classes.html @@ -0,0 +1,107 @@ + + + + + + + +EVMC: Class Index + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Class Index
+
+
+
A | B | E | F | H | L | M | R | S | V
+ +
+
+ + + + diff --git a/classevmc_1_1Host-members.html b/classevmc_1_1Host-members.html new file mode 100644 index 000000000..9951c15e3 --- /dev/null +++ b/classevmc_1_1Host-members.html @@ -0,0 +1,97 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
evmc::Host Member List
+
+
+ +

This is the complete list of members for evmc::Host, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + +
access_account(const address &addr) noexcept=0evmc::HostInterfacepure virtual
access_storage(const address &addr, const bytes32 &key) noexcept=0evmc::HostInterfacepure virtual
account_exists(const address &addr) const noexcept=0evmc::HostInterfacepure virtual
call(const evmc_message &msg) noexcept=0evmc::HostInterfacepure virtual
copy_code(const address &addr, size_t code_offset, uint8_t *buffer_data, size_t buffer_size) const noexcept=0evmc::HostInterfacepure virtual
emit_log(const address &addr, const uint8_t *data, size_t data_size, const bytes32 topics[], size_t num_topics) noexcept=0evmc::HostInterfacepure virtual
from_context(evmc_host_context *context) noexceptevmc::Hostinlinestatic
get_balance(const address &addr) const noexcept=0evmc::HostInterfacepure virtual
get_block_hash(int64_t block_number) const noexcept=0evmc::HostInterfacepure virtual
get_code_hash(const address &addr) const noexcept=0evmc::HostInterfacepure virtual
get_code_size(const address &addr) const noexcept=0evmc::HostInterfacepure virtual
get_interface() noexceptevmc::Hostinlinestatic
get_storage(const address &addr, const bytes32 &key) const noexcept=0evmc::HostInterfacepure virtual
get_transient_storage(const address &addr, const bytes32 &key) const noexcept=0evmc::HostInterfacepure virtual
get_tx_context() const noexcept=0evmc::HostInterfacepure virtual
selfdestruct(const address &addr, const address &beneficiary) noexcept=0evmc::HostInterfacepure virtual
set_storage(const address &addr, const bytes32 &key, const bytes32 &value) noexcept=0evmc::HostInterfacepure virtual
set_transient_storage(const address &addr, const bytes32 &key, const bytes32 &value) noexcept=0evmc::HostInterfacepure virtual
to_context() noexceptevmc::Hostinline
~HostInterface() noexcept=default (defined in evmc::HostInterface)evmc::HostInterfacevirtual
+
+ + + + diff --git a/classevmc_1_1Host.html b/classevmc_1_1Host.html new file mode 100644 index 000000000..47229113d --- /dev/null +++ b/classevmc_1_1Host.html @@ -0,0 +1,305 @@ + + + + + + + +EVMC: evmc::Host Class Reference + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ +
evmc::Host Class Reference
+
+
+ +

Abstract class to be used by Host implementations. + More...

+ +

#include <evmc.hpp>

+
+Inheritance diagram for evmc::Host:
+
+
+ + +evmc::HostInterface +evmc::MockedHost + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

evmc_host_contextto_context () noexcept
 Converts the Host object to the opaque host context pointer.
 
- Public Member Functions inherited from evmc::HostInterface
virtual bool account_exists (const address &addr) const noexcept=0
 Check account existence callback function.
 
virtual bytes32 get_storage (const address &addr, const bytes32 &key) const noexcept=0
 Get storage callback function.
 
virtual evmc_storage_status set_storage (const address &addr, const bytes32 &key, const bytes32 &value) noexcept=0
 Set storage callback function.
 
virtual uint256be get_balance (const address &addr) const noexcept=0
 Get balance callback function.
 
virtual size_t get_code_size (const address &addr) const noexcept=0
 Get code size callback function.
 
virtual bytes32 get_code_hash (const address &addr) const noexcept=0
 Get code hash callback function.
 
virtual size_t copy_code (const address &addr, size_t code_offset, uint8_t *buffer_data, size_t buffer_size) const noexcept=0
 Copy code callback function.
 
virtual bool selfdestruct (const address &addr, const address &beneficiary) noexcept=0
 Selfdestruct callback function.
 
virtual Result call (const evmc_message &msg) noexcept=0
 Call callback function.
 
virtual evmc_tx_context get_tx_context () const noexcept=0
 Get transaction context callback function.
 
virtual bytes32 get_block_hash (int64_t block_number) const noexcept=0
 Get block hash callback function.
 
virtual void emit_log (const address &addr, const uint8_t *data, size_t data_size, const bytes32 topics[], size_t num_topics) noexcept=0
 Emit log callback function.
 
virtual evmc_access_status access_account (const address &addr) noexcept=0
 Access account callback function.
 
virtual evmc_access_status access_storage (const address &addr, const bytes32 &key) noexcept=0
 Access storage callback function.
 
virtual bytes32 get_transient_storage (const address &addr, const bytes32 &key) const noexcept=0
 Get transient storage callback function.
 
virtual void set_transient_storage (const address &addr, const bytes32 &key, const bytes32 &value) noexcept=0
 Set transient storage callback function.
 
+ + + + + + + + +

+Static Public Member Functions

static const evmc_host_interfaceget_interface () noexcept
 Provides access to the global host interface.
 
template<typename DerivedClass = Host>
static DerivedClass * from_context (evmc_host_context *context) noexcept
 Converts the opaque host context pointer back to the original Host object.
 
+

Detailed Description

+

Abstract class to be used by Host implementations.

+

When implementing EVMC Host, you can directly inherit from the evmc::Host class. This way your implementation will be simpler by avoiding manual handling of the evmc_host_context and the evmc_host_interface.

+ +

Definition at line 620 of file evmc.hpp.

+

Member Function Documentation

+ +

◆ from_context()

+ +
+
+
+template<typename DerivedClass = Host>
+ + + + + +
+ + + + + + + + +
static DerivedClass * evmc::Host::from_context (evmc_host_contextcontext)
+
+inlinestaticnoexcept
+
+ +

Converts the opaque host context pointer back to the original Host object.

+
Template Parameters
+ + +
DerivedClassThe class derived from the Host class.
+
+
+
Parameters
+ + +
contextThe opaque host context pointer.
+
+
+
Returns
The pointer to DerivedClass.
+ +

Definition at line 636 of file evmc.hpp.

+
637 {
+
638 // Get pointer of the Host base class.
+
639 auto* h = reinterpret_cast<Host*>(context);
+
640
+
641 // Additional downcast, only possible if DerivedClass inherits from Host.
+
642 return static_cast<DerivedClass*>(h);
+
643 }
+
+
+
+ +

◆ get_interface()

+ +
+
+ + + + + +
+ + + + + + + +
const evmc_host_interface & evmc::Host::get_interface ()
+
+inlinestaticnoexcept
+
+ +

Provides access to the global host interface.

+
Returns
Reference to the host interface object.
+ +

Definition at line 882 of file evmc.hpp.

+
883{
+
884 static constexpr evmc_host_interface interface = {
+
885 ::evmc::internal::account_exists,
+
886 ::evmc::internal::get_storage,
+
887 ::evmc::internal::set_storage,
+
888 ::evmc::internal::get_balance,
+
889 ::evmc::internal::get_code_size,
+
890 ::evmc::internal::get_code_hash,
+
891 ::evmc::internal::copy_code,
+
892 ::evmc::internal::selfdestruct,
+
893 ::evmc::internal::call,
+
894 ::evmc::internal::get_tx_context,
+
895 ::evmc::internal::get_block_hash,
+
896 ::evmc::internal::emit_log,
+
897 ::evmc::internal::access_account,
+
898 ::evmc::internal::access_storage,
+
899 ::evmc::internal::get_transient_storage,
+
900 ::evmc::internal::set_transient_storage,
+
901 };
+
902 return interface;
+
903}
+
The Host interface.
Definition: evmc.h:845
+
+
+
+ +

◆ to_context()

+ +
+
+ + + + + +
+ + + + + + + +
evmc_host_context * evmc::Host::to_context ()
+
+inlinenoexcept
+
+ +

Converts the Host object to the opaque host context pointer.

+
Returns
Pointer to evmc_host_context.
+ +

Definition at line 629 of file evmc.hpp.

+
629{ return reinterpret_cast<evmc_host_context*>(this); }
+
The opaque data type representing the Host execution context.
+
+
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/classevmc_1_1Host.js b/classevmc_1_1Host.js new file mode 100644 index 000000000..cd22adc70 --- /dev/null +++ b/classevmc_1_1Host.js @@ -0,0 +1,6 @@ +var classevmc_1_1Host = +[ + [ "from_context", "classevmc_1_1Host.html#a8f28078b9c8fd003061859ecf31d1bed", null ], + [ "get_interface", "classevmc_1_1Host.html#afb96540fea288f02d83f01e185a78374", null ], + [ "to_context", "classevmc_1_1Host.html#abd96a61aa3b45d949cb41cf7778fdf6d", null ] +]; \ No newline at end of file diff --git a/classevmc_1_1Host.png b/classevmc_1_1Host.png new file mode 100644 index 000000000..89d7c96ce Binary files /dev/null and b/classevmc_1_1Host.png differ diff --git a/classevmc_1_1HostContext-members.html b/classevmc_1_1HostContext-members.html new file mode 100644 index 000000000..b2bd5ecdf --- /dev/null +++ b/classevmc_1_1HostContext-members.html @@ -0,0 +1,96 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
evmc::HostContext Member List
+
+
+ +

This is the complete list of members for evmc::HostContext, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + +
access_account(const address &address) noexcept finalevmc::HostContextinlinevirtual
access_storage(const address &address, const bytes32 &key) noexcept finalevmc::HostContextinlinevirtual
account_exists(const address &address) const noexcept finalevmc::HostContextinlinevirtual
call(const evmc_message &message) noexcept finalevmc::HostContextinlinevirtual
copy_code(const address &address, size_t code_offset, uint8_t *buffer_data, size_t buffer_size) const noexcept finalevmc::HostContextinlinevirtual
emit_log(const address &addr, const uint8_t *data, size_t data_size, const bytes32 topics[], size_t topics_count) noexcept finalevmc::HostContextinlinevirtual
get_balance(const address &address) const noexcept finalevmc::HostContextinlinevirtual
get_block_hash(int64_t number) const noexcept finalevmc::HostContextinlinevirtual
get_code_hash(const address &address) const noexcept finalevmc::HostContextinlinevirtual
get_code_size(const address &address) const noexcept finalevmc::HostContextinlinevirtual
get_storage(const address &address, const bytes32 &key) const noexcept finalevmc::HostContextinlinevirtual
get_transient_storage(const address &address, const bytes32 &key) const noexcept finalevmc::HostContextinlinevirtual
get_tx_context() const noexcept finalevmc::HostContextinlinevirtual
HostContext()=defaultevmc::HostContext
HostContext(const evmc_host_interface &interface, evmc_host_context *ctx) noexceptevmc::HostContextinline
selfdestruct(const address &addr, const address &beneficiary) noexcept finalevmc::HostContextinlinevirtual
set_storage(const address &address, const bytes32 &key, const bytes32 &value) noexcept finalevmc::HostContextinlinevirtual
set_transient_storage(const address &address, const bytes32 &key, const bytes32 &value) noexcept finalevmc::HostContextinlinevirtual
~HostInterface() noexcept=default (defined in evmc::HostInterface)evmc::HostInterfacevirtual
+
+ + + + diff --git a/classevmc_1_1HostContext.html b/classevmc_1_1HostContext.html new file mode 100644 index 000000000..3f0e49d30 --- /dev/null +++ b/classevmc_1_1HostContext.html @@ -0,0 +1,953 @@ + + + + + + + +EVMC: evmc::HostContext Class Reference + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ +
evmc::HostContext Class Reference
+
+
+ +

Wrapper around EVMC host context / host interface. + More...

+ +

#include <evmc.hpp>

+
+Inheritance diagram for evmc::HostContext:
+
+
+ + +evmc::HostInterface + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

HostContext ()=default
 Default constructor for null Host context.
 
 HostContext (const evmc_host_interface &interface, evmc_host_context *ctx) noexcept
 Constructor from the EVMC Host primitives.
 
bool account_exists (const address &address) const noexcept final
 Check account existence callback function.
 
bytes32 get_storage (const address &address, const bytes32 &key) const noexcept final
 Get storage callback function.
 
evmc_storage_status set_storage (const address &address, const bytes32 &key, const bytes32 &value) noexcept final
 Set storage callback function.
 
uint256be get_balance (const address &address) const noexcept final
 Get balance callback function.
 
size_t get_code_size (const address &address) const noexcept final
 Get code size callback function.
 
bytes32 get_code_hash (const address &address) const noexcept final
 Get code hash callback function.
 
size_t copy_code (const address &address, size_t code_offset, uint8_t *buffer_data, size_t buffer_size) const noexcept final
 Copy code callback function.
 
bool selfdestruct (const address &addr, const address &beneficiary) noexcept final
 Selfdestruct callback function.
 
Result call (const evmc_message &message) noexcept final
 Call callback function.
 
evmc_tx_context get_tx_context () const noexcept final
 Get transaction context callback function.
 
bytes32 get_block_hash (int64_t number) const noexcept final
 Get block hash callback function.
 
void emit_log (const address &addr, const uint8_t *data, size_t data_size, const bytes32 topics[], size_t topics_count) noexcept final
 Emit log callback function.
 
evmc_access_status access_account (const address &address) noexcept final
 Access account callback function.
 
evmc_access_status access_storage (const address &address, const bytes32 &key) noexcept final
 Access storage callback function.
 
bytes32 get_transient_storage (const address &address, const bytes32 &key) const noexcept final
 Get transient storage callback function.
 
void set_transient_storage (const address &address, const bytes32 &key, const bytes32 &value) noexcept final
 Set transient storage callback function.
 
virtual bool account_exists (const address &addr) const noexcept=0
 Check account existence callback function.
 
virtual bytes32 get_storage (const address &addr, const bytes32 &key) const noexcept=0
 Get storage callback function.
 
virtual evmc_storage_status set_storage (const address &addr, const bytes32 &key, const bytes32 &value) noexcept=0
 Set storage callback function.
 
virtual uint256be get_balance (const address &addr) const noexcept=0
 Get balance callback function.
 
virtual size_t get_code_size (const address &addr) const noexcept=0
 Get code size callback function.
 
virtual bytes32 get_code_hash (const address &addr) const noexcept=0
 Get code hash callback function.
 
virtual size_t copy_code (const address &addr, size_t code_offset, uint8_t *buffer_data, size_t buffer_size) const noexcept=0
 Copy code callback function.
 
virtual bool selfdestruct (const address &addr, const address &beneficiary) noexcept=0
 Selfdestruct callback function.
 
virtual Result call (const evmc_message &msg) noexcept=0
 Call callback function.
 
virtual evmc_tx_context get_tx_context () const noexcept=0
 Get transaction context callback function.
 
virtual bytes32 get_block_hash (int64_t block_number) const noexcept=0
 Get block hash callback function.
 
virtual void emit_log (const address &addr, const uint8_t *data, size_t data_size, const bytes32 topics[], size_t num_topics) noexcept=0
 Emit log callback function.
 
virtual evmc_access_status access_account (const address &addr) noexcept=0
 Access account callback function.
 
virtual evmc_access_status access_storage (const address &addr, const bytes32 &key) noexcept=0
 Access storage callback function.
 
virtual bytes32 get_transient_storage (const address &addr, const bytes32 &key) const noexcept=0
 Get transient storage callback function.
 
virtual void set_transient_storage (const address &addr, const bytes32 &key, const bytes32 &value) noexcept=0
 Set transient storage callback function.
 
+

Detailed Description

+

Wrapper around EVMC host context / host interface.

+

To be used by VM implementations as better alternative to using evmc_host_context directly.

+ +

Definition at line 508 of file evmc.hpp.

+

Constructor & Destructor Documentation

+ +

◆ HostContext()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
evmc::HostContext::HostContext (const evmc_host_interfaceinterface,
evmc_host_contextctx 
)
+
+inlinenoexcept
+
+ +

Constructor from the EVMC Host primitives.

+
Parameters
+ + + +
interfaceThe reference to the Host interface.
ctxThe pointer to the Host context object. This parameter MAY be null.
+
+
+ +

Definition at line 520 of file evmc.hpp.

+
521 : host{&interface}, context{ctx}
+
522 {}
+
+
+
+

Member Function Documentation

+ +

◆ access_account()

+ +
+
+ + + + + +
+ + + + + + + + +
evmc_access_status evmc::HostContext::access_account (const addressaddr)
+
+inlinefinalvirtualnoexcept
+
+ +

Access account callback function.

+ +

Implements evmc::HostInterface.

+ +

Definition at line 591 of file evmc.hpp.

+
592 {
+
593 return host->access_account(context, &address);
+
594 }
+
evmc_access_account_fn access_account
Access account callback function.
Definition: evmc.h:883
+
+
+
+ +

◆ access_storage()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
evmc_access_status evmc::HostContext::access_storage (const addressaddr,
const bytes32key 
)
+
+inlinefinalvirtualnoexcept
+
+ +

Access storage callback function.

+ +

Implements evmc::HostInterface.

+ +

Definition at line 596 of file evmc.hpp.

+
597 {
+
598 return host->access_storage(context, &address, &key);
+
599 }
+
evmc_access_storage_fn access_storage
Access storage callback function.
Definition: evmc.h:886
+
+
+
+ +

◆ account_exists()

+ +
+
+ + + + + +
+ + + + + + + + +
bool evmc::HostContext::account_exists (const addressaddr) const
+
+inlinefinalvirtualnoexcept
+
+ +

Check account existence callback function.

+ +

Implements evmc::HostInterface.

+ +

Definition at line 524 of file evmc.hpp.

+
525 {
+
526 return host->account_exists(context, &address);
+
527 }
+
evmc_account_exists_fn account_exists
Check account existence callback function.
Definition: evmc.h:847
+
+
+
+ +

◆ call()

+ +
+
+ + + + + +
+ + + + + + + + +
Result evmc::HostContext::call (const evmc_messagemsg)
+
+inlinefinalvirtualnoexcept
+
+ +

Call callback function.

+ +

Implements evmc::HostInterface.

+ +

Definition at line 569 of file evmc.hpp.

+
570 {
+
571 return Result{host->call(context, &message)};
+
572 }
+
evmc_call_fn call
Call callback function.
Definition: evmc.h:871
+
+
+
+ +

◆ copy_code()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
size_t evmc::HostContext::copy_code (const addressaddr,
size_t code_offset,
uint8_t * buffer_data,
size_t buffer_size 
) const
+
+inlinefinalvirtualnoexcept
+
+ +

Copy code callback function.

+ +

Implements evmc::HostInterface.

+ +

Definition at line 556 of file evmc.hpp.

+
560 {
+
561 return host->copy_code(context, &address, code_offset, buffer_data, buffer_size);
+
562 }
+
evmc_copy_code_fn copy_code
Copy code callback function.
Definition: evmc.h:865
+
+
+
+ +

◆ emit_log()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void evmc::HostContext::emit_log (const addressaddr,
const uint8_t * data,
size_t data_size,
const bytes32 topics[],
size_t num_topics 
)
+
+inlinefinalvirtualnoexcept
+
+ +

Emit log callback function.

+ +

Implements evmc::HostInterface.

+ +

Definition at line 582 of file evmc.hpp.

+
587 {
+
588 host->emit_log(context, &addr, data, data_size, topics, topics_count);
+
589 }
+
evmc_emit_log_fn emit_log
Emit log callback function.
Definition: evmc.h:880
+
+
+
+ +

◆ get_balance()

+ +
+
+ + + + + +
+ + + + + + + + +
uint256be evmc::HostContext::get_balance (const addressaddr) const
+
+inlinefinalvirtualnoexcept
+
+ +

Get balance callback function.

+ +

Implements evmc::HostInterface.

+ +

Definition at line 541 of file evmc.hpp.

+
542 {
+
543 return host->get_balance(context, &address);
+
544 }
+
evmc_get_balance_fn get_balance
Get balance callback function.
Definition: evmc.h:856
+
+
+
+ +

◆ get_block_hash()

+ +
+
+ + + + + +
+ + + + + + + + +
bytes32 evmc::HostContext::get_block_hash (int64_t block_number) const
+
+inlinefinalvirtualnoexcept
+
+ +

Get block hash callback function.

+ +

Implements evmc::HostInterface.

+ +

Definition at line 577 of file evmc.hpp.

+
578 {
+
579 return host->get_block_hash(context, number);
+
580 }
+
evmc_get_block_hash_fn get_block_hash
Get block hash callback function.
Definition: evmc.h:877
+
+
+
+ +

◆ get_code_hash()

+ +
+
+ + + + + +
+ + + + + + + + +
bytes32 evmc::HostContext::get_code_hash (const addressaddr) const
+
+inlinefinalvirtualnoexcept
+
+ +

Get code hash callback function.

+ +

Implements evmc::HostInterface.

+ +

Definition at line 551 of file evmc.hpp.

+
552 {
+
553 return host->get_code_hash(context, &address);
+
554 }
+
evmc_get_code_hash_fn get_code_hash
Get code hash callback function.
Definition: evmc.h:862
+
+
+
+ +

◆ get_code_size()

+ +
+
+ + + + + +
+ + + + + + + + +
size_t evmc::HostContext::get_code_size (const addressaddr) const
+
+inlinefinalvirtualnoexcept
+
+ +

Get code size callback function.

+ +

Implements evmc::HostInterface.

+ +

Definition at line 546 of file evmc.hpp.

+
547 {
+
548 return host->get_code_size(context, &address);
+
549 }
+
evmc_get_code_size_fn get_code_size
Get code size callback function.
Definition: evmc.h:859
+
+
+
+ +

◆ get_storage()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bytes32 evmc::HostContext::get_storage (const addressaddr,
const bytes32key 
) const
+
+inlinefinalvirtualnoexcept
+
+ +

Get storage callback function.

+ +

Implements evmc::HostInterface.

+ +

Definition at line 529 of file evmc.hpp.

+
530 {
+
531 return host->get_storage(context, &address, &key);
+
532 }
+
evmc_get_storage_fn get_storage
Get storage callback function.
Definition: evmc.h:850
+
+
+
+ +

◆ get_transient_storage()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bytes32 evmc::HostContext::get_transient_storage (const addressaddr,
const bytes32key 
) const
+
+inlinefinalvirtualnoexcept
+
+ +

Get transient storage callback function.

+ +

Implements evmc::HostInterface.

+ +

Definition at line 601 of file evmc.hpp.

+
602 {
+
603 return host->get_transient_storage(context, &address, &key);
+
604 }
+
evmc_get_transient_storage_fn get_transient_storage
Get transient storage callback function.
Definition: evmc.h:889
+
+
+
+ +

◆ get_tx_context()

+ +
+
+ + + + + +
+ + + + + + + +
evmc_tx_context evmc::HostContext::get_tx_context () const
+
+inlinefinalvirtualnoexcept
+
+ +

Get transaction context callback function.

+ +

Implements evmc::HostInterface.

+ +

Definition at line 575 of file evmc.hpp.

+
575{ return host->get_tx_context(context); }
+
evmc_get_tx_context_fn get_tx_context
Get transaction context callback function.
Definition: evmc.h:874
+
+
+
+ +

◆ selfdestruct()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool evmc::HostContext::selfdestruct (const addressaddr,
const addressbeneficiary 
)
+
+inlinefinalvirtualnoexcept
+
+ +

Selfdestruct callback function.

+ +

Implements evmc::HostInterface.

+ +

Definition at line 564 of file evmc.hpp.

+
565 {
+
566 return host->selfdestruct(context, &addr, &beneficiary);
+
567 }
+
evmc_selfdestruct_fn selfdestruct
Selfdestruct callback function.
Definition: evmc.h:868
+
+
+
+ +

◆ set_storage()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
evmc_storage_status evmc::HostContext::set_storage (const addressaddr,
const bytes32key,
const bytes32value 
)
+
+inlinefinalvirtualnoexcept
+
+ +

Set storage callback function.

+ +

Implements evmc::HostInterface.

+ +

Definition at line 534 of file evmc.hpp.

+
537 {
+
538 return host->set_storage(context, &address, &key, &value);
+
539 }
+
evmc_set_storage_fn set_storage
Set storage callback function.
Definition: evmc.h:853
+
+
+
+ +

◆ set_transient_storage()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void evmc::HostContext::set_transient_storage (const addressaddr,
const bytes32key,
const bytes32value 
)
+
+inlinefinalvirtualnoexcept
+
+ +

Set transient storage callback function.

+ +

Implements evmc::HostInterface.

+ +

Definition at line 606 of file evmc.hpp.

+
609 {
+
610 host->set_transient_storage(context, &address, &key, &value);
+
611 }
+
evmc_set_transient_storage_fn set_transient_storage
Set transient storage callback function.
Definition: evmc.h:892
+
+
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/classevmc_1_1HostContext.js b/classevmc_1_1HostContext.js new file mode 100644 index 000000000..485ba467c --- /dev/null +++ b/classevmc_1_1HostContext.js @@ -0,0 +1,21 @@ +var classevmc_1_1HostContext = +[ + [ "HostContext", "classevmc_1_1HostContext.html#a2a04dc538a47cd599d6e3f9e389aa960", null ], + [ "HostContext", "classevmc_1_1HostContext.html#a3c2eeff87915c8aa8652c5dc2a17f51a", null ], + [ "access_account", "classevmc_1_1HostContext.html#a703bce4ebfcec7bd8b804e30f7b0d965", null ], + [ "access_storage", "classevmc_1_1HostContext.html#a4132fc7dd93405c5c2fcd2729d7a2be8", null ], + [ "account_exists", "classevmc_1_1HostContext.html#a08a0b1cc1f03aff697e9344865047e56", null ], + [ "call", "classevmc_1_1HostContext.html#a6aa7f81a3d60a02fe2320e9090145f02", null ], + [ "copy_code", "classevmc_1_1HostContext.html#a62742a0675d8675dd8ee155b5def02dc", null ], + [ "emit_log", "classevmc_1_1HostContext.html#acb1f7dabab3134e4ac80f9f6ada590a9", null ], + [ "get_balance", "classevmc_1_1HostContext.html#a2e50fd490162237ac04f26cbd8c9e916", null ], + [ "get_block_hash", "classevmc_1_1HostContext.html#ac7ce942550fee4d6e801af880484e271", null ], + [ "get_code_hash", "classevmc_1_1HostContext.html#a06c2f1a5f29be3384b4e48c70198b563", null ], + [ "get_code_size", "classevmc_1_1HostContext.html#a278e6c530fce8397b1dc2de07ba0b26d", null ], + [ "get_storage", "classevmc_1_1HostContext.html#afb6bc0d98a19cf760ef9e886366e4108", null ], + [ "get_transient_storage", "classevmc_1_1HostContext.html#acf906761de74e624fe95cd659019df2a", null ], + [ "get_tx_context", "classevmc_1_1HostContext.html#af51f231f8607e7a506a25d8b21874cd1", null ], + [ "selfdestruct", "classevmc_1_1HostContext.html#a6f547b0a46eee616b57341ccea1d8ece", null ], + [ "set_storage", "classevmc_1_1HostContext.html#accce7c534c0f1e50f70d52a50d2ff659", null ], + [ "set_transient_storage", "classevmc_1_1HostContext.html#a8d1c7f37fab0e28faa8e88a69c5ad00c", null ] +]; \ No newline at end of file diff --git a/classevmc_1_1HostContext.png b/classevmc_1_1HostContext.png new file mode 100644 index 000000000..f64e9032b Binary files /dev/null and b/classevmc_1_1HostContext.png differ diff --git a/classevmc_1_1HostInterface-members.html b/classevmc_1_1HostInterface-members.html new file mode 100644 index 000000000..f2f941635 --- /dev/null +++ b/classevmc_1_1HostInterface-members.html @@ -0,0 +1,94 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
evmc::HostInterface Member List
+
+
+ +

This is the complete list of members for evmc::HostInterface, including all inherited members.

+ + + + + + + + + + + + + + + + + + +
access_account(const address &addr) noexcept=0evmc::HostInterfacepure virtual
access_storage(const address &addr, const bytes32 &key) noexcept=0evmc::HostInterfacepure virtual
account_exists(const address &addr) const noexcept=0evmc::HostInterfacepure virtual
call(const evmc_message &msg) noexcept=0evmc::HostInterfacepure virtual
copy_code(const address &addr, size_t code_offset, uint8_t *buffer_data, size_t buffer_size) const noexcept=0evmc::HostInterfacepure virtual
emit_log(const address &addr, const uint8_t *data, size_t data_size, const bytes32 topics[], size_t num_topics) noexcept=0evmc::HostInterfacepure virtual
get_balance(const address &addr) const noexcept=0evmc::HostInterfacepure virtual
get_block_hash(int64_t block_number) const noexcept=0evmc::HostInterfacepure virtual
get_code_hash(const address &addr) const noexcept=0evmc::HostInterfacepure virtual
get_code_size(const address &addr) const noexcept=0evmc::HostInterfacepure virtual
get_storage(const address &addr, const bytes32 &key) const noexcept=0evmc::HostInterfacepure virtual
get_transient_storage(const address &addr, const bytes32 &key) const noexcept=0evmc::HostInterfacepure virtual
get_tx_context() const noexcept=0evmc::HostInterfacepure virtual
selfdestruct(const address &addr, const address &beneficiary) noexcept=0evmc::HostInterfacepure virtual
set_storage(const address &addr, const bytes32 &key, const bytes32 &value) noexcept=0evmc::HostInterfacepure virtual
set_transient_storage(const address &addr, const bytes32 &key, const bytes32 &value) noexcept=0evmc::HostInterfacepure virtual
~HostInterface() noexcept=default (defined in evmc::HostInterface)evmc::HostInterfacevirtual
+
+ + + + diff --git a/classevmc_1_1HostInterface.html b/classevmc_1_1HostInterface.html new file mode 100644 index 000000000..525a68a58 --- /dev/null +++ b/classevmc_1_1HostInterface.html @@ -0,0 +1,755 @@ + + + + + + + +EVMC: evmc::HostInterface Class Reference + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ +
evmc::HostInterface Class Referenceabstract
+
+
+ +

The EVMC Host interface. + More...

+ +

#include <evmc.hpp>

+
+Inheritance diagram for evmc::HostInterface:
+
+
+ + +evmc::Host +evmc::HostContext +evmc::MockedHost + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

virtual bool account_exists (const address &addr) const noexcept=0
 Check account existence callback function.
 
virtual bytes32 get_storage (const address &addr, const bytes32 &key) const noexcept=0
 Get storage callback function.
 
virtual evmc_storage_status set_storage (const address &addr, const bytes32 &key, const bytes32 &value) noexcept=0
 Set storage callback function.
 
virtual uint256be get_balance (const address &addr) const noexcept=0
 Get balance callback function.
 
virtual size_t get_code_size (const address &addr) const noexcept=0
 Get code size callback function.
 
virtual bytes32 get_code_hash (const address &addr) const noexcept=0
 Get code hash callback function.
 
virtual size_t copy_code (const address &addr, size_t code_offset, uint8_t *buffer_data, size_t buffer_size) const noexcept=0
 Copy code callback function.
 
virtual bool selfdestruct (const address &addr, const address &beneficiary) noexcept=0
 Selfdestruct callback function.
 
virtual Result call (const evmc_message &msg) noexcept=0
 Call callback function.
 
virtual evmc_tx_context get_tx_context () const noexcept=0
 Get transaction context callback function.
 
virtual bytes32 get_block_hash (int64_t block_number) const noexcept=0
 Get block hash callback function.
 
virtual void emit_log (const address &addr, const uint8_t *data, size_t data_size, const bytes32 topics[], size_t num_topics) noexcept=0
 Emit log callback function.
 
virtual evmc_access_status access_account (const address &addr) noexcept=0
 Access account callback function.
 
virtual evmc_access_status access_storage (const address &addr, const bytes32 &key) noexcept=0
 Access storage callback function.
 
virtual bytes32 get_transient_storage (const address &addr, const bytes32 &key) const noexcept=0
 Get transient storage callback function.
 
virtual void set_transient_storage (const address &addr, const bytes32 &key, const bytes32 &value) noexcept=0
 Set transient storage callback function.
 
+

Detailed Description

+

The EVMC Host interface.

+ +

Definition at line 438 of file evmc.hpp.

+

Member Function Documentation

+ +

◆ access_account()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual evmc_access_status evmc::HostInterface::access_account (const addressaddr)
+
+pure virtualnoexcept
+
+ +

Access account callback function.

+ +

Implemented in evmc::MockedHost, and evmc::HostContext.

+ +
+
+ +

◆ access_storage()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual evmc_access_status evmc::HostInterface::access_storage (const addressaddr,
const bytes32key 
)
+
+pure virtualnoexcept
+
+ +

Access storage callback function.

+ +

Implemented in evmc::MockedHost, and evmc::HostContext.

+ +
+
+ +

◆ account_exists()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual bool evmc::HostInterface::account_exists (const addressaddr) const
+
+pure virtualnoexcept
+
+ +

Check account existence callback function.

+ +

Implemented in evmc::MockedHost, and evmc::HostContext.

+ +
+
+ +

◆ call()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual Result evmc::HostInterface::call (const evmc_messagemsg)
+
+pure virtualnoexcept
+
+ +

Call callback function.

+ +

Implemented in evmc::HostContext, and evmc::MockedHost.

+ +
+
+ +

◆ copy_code()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
virtual size_t evmc::HostInterface::copy_code (const addressaddr,
size_t code_offset,
uint8_t * buffer_data,
size_t buffer_size 
) const
+
+pure virtualnoexcept
+
+ +

Copy code callback function.

+ +

Implemented in evmc::MockedHost, and evmc::HostContext.

+ +
+
+ +

◆ emit_log()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
virtual void evmc::HostInterface::emit_log (const addressaddr,
const uint8_t * data,
size_t data_size,
const bytes32 topics[],
size_t num_topics 
)
+
+pure virtualnoexcept
+
+ +

Emit log callback function.

+ +

Implemented in evmc::HostContext, and evmc::MockedHost.

+ +
+
+ +

◆ get_balance()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual uint256be evmc::HostInterface::get_balance (const addressaddr) const
+
+pure virtualnoexcept
+
+ +

Get balance callback function.

+ +

Implemented in evmc::MockedHost, and evmc::HostContext.

+ +
+
+ +

◆ get_block_hash()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual bytes32 evmc::HostInterface::get_block_hash (int64_t block_number) const
+
+pure virtualnoexcept
+
+ +

Get block hash callback function.

+ +

Implemented in evmc::MockedHost, and evmc::HostContext.

+ +
+
+ +

◆ get_code_hash()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual bytes32 evmc::HostInterface::get_code_hash (const addressaddr) const
+
+pure virtualnoexcept
+
+ +

Get code hash callback function.

+ +

Implemented in evmc::MockedHost, and evmc::HostContext.

+ +
+
+ +

◆ get_code_size()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual size_t evmc::HostInterface::get_code_size (const addressaddr) const
+
+pure virtualnoexcept
+
+ +

Get code size callback function.

+ +

Implemented in evmc::MockedHost, and evmc::HostContext.

+ +
+
+ +

◆ get_storage()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual bytes32 evmc::HostInterface::get_storage (const addressaddr,
const bytes32key 
) const
+
+pure virtualnoexcept
+
+ +

Get storage callback function.

+ +

Implemented in evmc::MockedHost, and evmc::HostContext.

+ +
+
+ +

◆ get_transient_storage()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual bytes32 evmc::HostInterface::get_transient_storage (const addressaddr,
const bytes32key 
) const
+
+pure virtualnoexcept
+
+ +

Get transient storage callback function.

+ +

Implemented in evmc::MockedHost, and evmc::HostContext.

+ +
+
+ +

◆ get_tx_context()

+ +
+
+ + + + + +
+ + + + + + + +
virtual evmc_tx_context evmc::HostInterface::get_tx_context () const
+
+pure virtualnoexcept
+
+ +

Get transaction context callback function.

+ +

Implemented in evmc::HostContext, and evmc::MockedHost.

+ +
+
+ +

◆ selfdestruct()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual bool evmc::HostInterface::selfdestruct (const addressaddr,
const addressbeneficiary 
)
+
+pure virtualnoexcept
+
+ +

Selfdestruct callback function.

+ +

Implemented in evmc::HostContext, and evmc::MockedHost.

+ +
+
+ +

◆ set_storage()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
virtual evmc_storage_status evmc::HostInterface::set_storage (const addressaddr,
const bytes32key,
const bytes32value 
)
+
+pure virtualnoexcept
+
+ +

Set storage callback function.

+ +

Implemented in evmc::MockedHost, and evmc::HostContext.

+ +
+
+ +

◆ set_transient_storage()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
virtual void evmc::HostInterface::set_transient_storage (const addressaddr,
const bytes32key,
const bytes32value 
)
+
+pure virtualnoexcept
+
+ +

Set transient storage callback function.

+ +

Implemented in evmc::MockedHost, and evmc::HostContext.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/classevmc_1_1HostInterface.js b/classevmc_1_1HostInterface.js new file mode 100644 index 000000000..de6c85947 --- /dev/null +++ b/classevmc_1_1HostInterface.js @@ -0,0 +1,19 @@ +var classevmc_1_1HostInterface = +[ + [ "access_account", "classevmc_1_1HostInterface.html#ab5ec93cb9fc439fd22cacecc468ed9f8", null ], + [ "access_storage", "classevmc_1_1HostInterface.html#ac0192ce7575fe86b7466405e93484ad8", null ], + [ "account_exists", "classevmc_1_1HostInterface.html#ae735474dc8425b49b3eb0ef12212fae7", null ], + [ "call", "classevmc_1_1HostInterface.html#a13814524c4305545c08643bb095583f5", null ], + [ "copy_code", "classevmc_1_1HostInterface.html#ace3dcf2b277c60cb422f3af1d63dd36b", null ], + [ "emit_log", "classevmc_1_1HostInterface.html#a1f95317392e4615e29ad038fe4ff049d", null ], + [ "get_balance", "classevmc_1_1HostInterface.html#ac30e7e938793a2c46e3d5d416e15c3f5", null ], + [ "get_block_hash", "classevmc_1_1HostInterface.html#ab4fcbbe88b9490f78e0f99c7ce2b167f", null ], + [ "get_code_hash", "classevmc_1_1HostInterface.html#a748a36bc934302492f54e3fc90cdca88", null ], + [ "get_code_size", "classevmc_1_1HostInterface.html#a8cb4656ab4c478d5fe152b4f6c4b6dc4", null ], + [ "get_storage", "classevmc_1_1HostInterface.html#a020f849f737fcd841681f73f74514b4d", null ], + [ "get_transient_storage", "classevmc_1_1HostInterface.html#a003ec160c5e6e122ec079143a07a11da", null ], + [ "get_tx_context", "classevmc_1_1HostInterface.html#a2e958d4265e17048b817626f6fd3cdcc", null ], + [ "selfdestruct", "classevmc_1_1HostInterface.html#a2637dec130d6236d17f1b1c0b1d7e742", null ], + [ "set_storage", "classevmc_1_1HostInterface.html#ab302ebc0c838560a6c4b8b1aec21815a", null ], + [ "set_transient_storage", "classevmc_1_1HostInterface.html#ae024151b4d5667b6cd8b5d45a10f7a64", null ] +]; \ No newline at end of file diff --git a/classevmc_1_1HostInterface.png b/classevmc_1_1HostInterface.png new file mode 100644 index 000000000..b554aeaae Binary files /dev/null and b/classevmc_1_1HostInterface.png differ diff --git a/classevmc_1_1MockedHost-members.html b/classevmc_1_1MockedHost-members.html new file mode 100644 index 000000000..12d5385d4 --- /dev/null +++ b/classevmc_1_1MockedHost-members.html @@ -0,0 +1,108 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
evmc::MockedHost Member List
+
+
+ +

This is the complete list of members for evmc::MockedHost, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
access_account(const address &addr) noexcept overrideevmc::MockedHostinlinevirtual
access_storage(const address &addr, const bytes32 &key) noexcept overrideevmc::MockedHostinlinevirtual
account_exists(const address &addr) const noexcept overrideevmc::MockedHostinlinevirtual
accountsevmc::MockedHost
block_hashevmc::MockedHost
call(const evmc_message &msg) noexcept overrideevmc::MockedHostinlinevirtual
call_resultevmc::MockedHost
copy_code(const address &addr, size_t code_offset, uint8_t *buffer_data, size_t buffer_size) const noexcept overrideevmc::MockedHostinlinevirtual
emit_log(const address &addr, const uint8_t *data, size_t data_size, const bytes32 topics[], size_t topics_count) noexcept overrideevmc::MockedHostinlinevirtual
from_context(evmc_host_context *context) noexceptevmc::Hostinlinestatic
get_balance(const address &addr) const noexcept overrideevmc::MockedHostinlinevirtual
get_block_hash(int64_t block_number) const noexcept overrideevmc::MockedHostinlinevirtual
get_code_hash(const address &addr) const noexcept overrideevmc::MockedHostinlinevirtual
get_code_size(const address &addr) const noexcept overrideevmc::MockedHostinlinevirtual
get_interface() noexceptevmc::Hostinlinestatic
get_storage(const address &addr, const bytes32 &key) const noexcept overrideevmc::MockedHostinlinevirtual
get_transient_storage(const address &addr, const bytes32 &key) const noexcept overrideevmc::MockedHostinlinevirtual
get_tx_context() const noexcept overrideevmc::MockedHostinlinevirtual
max_recorded_account_accessesevmc::MockedHoststatic
max_recorded_callsevmc::MockedHoststatic
recorded_account_accessesevmc::MockedHostmutable
recorded_blockhashesevmc::MockedHostmutable
recorded_callsevmc::MockedHost
recorded_logsevmc::MockedHost
recorded_selfdestructsevmc::MockedHost
selfdestruct(const address &addr, const address &beneficiary) noexcept overrideevmc::MockedHostinlinevirtual
set_storage(const address &addr, const bytes32 &key, const bytes32 &value) noexcept overrideevmc::MockedHostinlinevirtual
set_transient_storage(const address &addr, const bytes32 &key, const bytes32 &value) noexcept overrideevmc::MockedHostinlinevirtual
to_context() noexceptevmc::Hostinline
tx_contextevmc::MockedHost
~HostInterface() noexcept=default (defined in evmc::HostInterface)evmc::HostInterfacevirtual
+
+ + + + diff --git a/classevmc_1_1MockedHost.html b/classevmc_1_1MockedHost.html new file mode 100644 index 000000000..227b5a4da --- /dev/null +++ b/classevmc_1_1MockedHost.html @@ -0,0 +1,1458 @@ + + + + + + + +EVMC: evmc::MockedHost Class Reference + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ +
evmc::MockedHost Class Reference
+
+
+ +

Mocked EVMC Host implementation. + More...

+ +

#include <mocked_host.hpp>

+
+Inheritance diagram for evmc::MockedHost:
+
+
+ + +evmc::Host +evmc::HostInterface + +
+ + + + + +

+Classes

struct  log_record
 LOG record. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

bool account_exists (const address &addr) const noexcept override
 Returns true if an account exists (EVMC Host method).
 
bytes32 get_storage (const address &addr, const bytes32 &key) const noexcept override
 Get the account's storage value at the given key (EVMC Host method).
 
evmc_storage_status set_storage (const address &addr, const bytes32 &key, const bytes32 &value) noexcept override
 Set the account's storage value (EVMC Host method).
 
uint256be get_balance (const address &addr) const noexcept override
 Get the account's balance (EVMC Host method).
 
size_t get_code_size (const address &addr) const noexcept override
 Get the account's code size (EVMC host method).
 
bytes32 get_code_hash (const address &addr) const noexcept override
 Get the account's code hash (EVMC host method).
 
size_t copy_code (const address &addr, size_t code_offset, uint8_t *buffer_data, size_t buffer_size) const noexcept override
 Copy the account's code to the given buffer (EVMC host method).
 
bool selfdestruct (const address &addr, const address &beneficiary) noexcept override
 Selfdestruct the account (EVMC host method).
 
Result call (const evmc_message &msg) noexcept override
 Call/create other contract (EVMC host method).
 
evmc_tx_context get_tx_context () const noexcept override
 Get transaction context (EVMC host method).
 
bytes32 get_block_hash (int64_t block_number) const noexcept override
 Get the block header hash (EVMC host method).
 
void emit_log (const address &addr, const uint8_t *data, size_t data_size, const bytes32 topics[], size_t topics_count) noexcept override
 Emit LOG (EVMC host method).
 
evmc_access_status access_account (const address &addr) noexcept override
 Record an account access.
 
evmc_access_status access_storage (const address &addr, const bytes32 &key) noexcept override
 Access the account's storage value at the given key.
 
bytes32 get_transient_storage (const address &addr, const bytes32 &key) const noexcept override
 Get account's transient storage.
 
void set_transient_storage (const address &addr, const bytes32 &key, const bytes32 &value) noexcept override
 Set account's transient storage.
 
- Public Member Functions inherited from evmc::Host
evmc_host_contextto_context () noexcept
 Converts the Host object to the opaque host context pointer.
 
virtual bool account_exists (const address &addr) const noexcept=0
 Check account existence callback function.
 
virtual bytes32 get_storage (const address &addr, const bytes32 &key) const noexcept=0
 Get storage callback function.
 
virtual evmc_storage_status set_storage (const address &addr, const bytes32 &key, const bytes32 &value) noexcept=0
 Set storage callback function.
 
virtual uint256be get_balance (const address &addr) const noexcept=0
 Get balance callback function.
 
virtual size_t get_code_size (const address &addr) const noexcept=0
 Get code size callback function.
 
virtual bytes32 get_code_hash (const address &addr) const noexcept=0
 Get code hash callback function.
 
virtual size_t copy_code (const address &addr, size_t code_offset, uint8_t *buffer_data, size_t buffer_size) const noexcept=0
 Copy code callback function.
 
virtual bool selfdestruct (const address &addr, const address &beneficiary) noexcept=0
 Selfdestruct callback function.
 
virtual Result call (const evmc_message &msg) noexcept=0
 Call callback function.
 
virtual evmc_tx_context get_tx_context () const noexcept=0
 Get transaction context callback function.
 
virtual bytes32 get_block_hash (int64_t block_number) const noexcept=0
 Get block hash callback function.
 
virtual void emit_log (const address &addr, const uint8_t *data, size_t data_size, const bytes32 topics[], size_t num_topics) noexcept=0
 Emit log callback function.
 
virtual evmc_access_status access_account (const address &addr) noexcept=0
 Access account callback function.
 
virtual evmc_access_status access_storage (const address &addr, const bytes32 &key) noexcept=0
 Access storage callback function.
 
virtual bytes32 get_transient_storage (const address &addr, const bytes32 &key) const noexcept=0
 Get transient storage callback function.
 
virtual void set_transient_storage (const address &addr, const bytes32 &key, const bytes32 &value) noexcept=0
 Set transient storage callback function.
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Attributes

std::unordered_map< address, MockedAccountaccounts
 The set of all accounts in the Host, organized by their addresses.
 
evmc_tx_context tx_context = {}
 The EVMC transaction context to be returned by get_tx_context().
 
bytes32 block_hash = {}
 The block header hash value to be returned by get_block_hash().
 
evmc_result call_result = {}
 The call result to be returned by the call() method.
 
std::vector< int64_t > recorded_blockhashes
 The record of all block numbers for which get_block_hash() was called.
 
std::vector< addressrecorded_account_accesses
 The record of all account accesses.
 
std::vector< evmc_messagerecorded_calls
 The record of all call messages requested in the call() method.
 
std::vector< log_recordrecorded_logs
 The record of all LOGs passed to the emit_log() method.
 
std::unordered_map< address, std::vector< address > > recorded_selfdestructs
 The record of all SELFDESTRUCTs from the selfdestruct() method as a map selfdestructed_address => [beneficiary1, beneficiary2, ...].
 
+ + + + + + + +

+Static Public Attributes

static constexpr auto max_recorded_account_accesses = 200
 The maximum number of entries in recorded_account_accesses record.
 
static constexpr auto max_recorded_calls = 100
 The maximum number of entries in recorded_calls record.
 
+ + + + + + + + + +

+Additional Inherited Members

- Static Public Member Functions inherited from evmc::Host
static const evmc_host_interfaceget_interface () noexcept
 Provides access to the global host interface.
 
template<typename DerivedClass = Host>
static DerivedClass * from_context (evmc_host_context *context) noexcept
 Converts the opaque host context pointer back to the original Host object.
 
+

Detailed Description

+

Mocked EVMC Host implementation.

+ +

Definition at line 75 of file mocked_host.hpp.

+

Member Function Documentation

+ +

◆ access_account()

+ +
+
+ + + + + +
+ + + + + + + + +
evmc_access_status evmc::MockedHost::access_account (const addressaddr)
+
+inlineoverridevirtualnoexcept
+
+ +

Record an account access.

+

This method is required by EIP-2929 introduced in EVMC_BERLIN. It will record the account access in MockedHost::recorded_account_accesses and return previous access status. This methods returns EVMC_ACCESS_WARM for known addresses of precompiles. The EIP-2929 specifies that evmc_message::sender and evmc_message::recipient are always EVMC_ACCESS_WARM. Therefore, you should init the MockedHost with:

mocked_host.access_account(msg.sender);
+mocked_host.access_account(msg.recipient);
+

The same way you can mock transaction access list (EIP-2930) for account addresses.

+
Parameters
+ + +
addrThe address of the accessed account.
+
+
+
Returns
The EVMC_ACCESS_WARM if the account has been accessed before, the EVMC_ACCESS_COLD otherwise.
+ +

Implements evmc::HostInterface.

+ +

Definition at line 440 of file mocked_host.hpp.

+
441 {
+
442 // Check if the address have been already accessed.
+
443 const auto already_accessed =
+
444 std::find(recorded_account_accesses.begin(), recorded_account_accesses.end(), addr) !=
+ +
446
+
447 record_account_access(addr);
+
448
+
449 // Accessing precompiled contracts is always warm.
+
450 if (addr >= 0x0000000000000000000000000000000000000001_address &&
+
451 addr <= 0x0000000000000000000000000000000000000009_address)
+
452 return EVMC_ACCESS_WARM;
+
453
+
454 return already_accessed ? EVMC_ACCESS_WARM : EVMC_ACCESS_COLD;
+
455 }
+
std::vector< address > recorded_account_accesses
The record of all account accesses.
+
@ EVMC_ACCESS_COLD
The entry hasn't been accessed before – it's the first access.
Definition: evmc.h:788
+
@ EVMC_ACCESS_WARM
The entry is already in accessed_addresses or accessed_storage_keys.
Definition: evmc.h:793
+
+
+
+ +

◆ access_storage()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
evmc_access_status evmc::MockedHost::access_storage (const addressaddr,
const bytes32key 
)
+
+inlineoverridevirtualnoexcept
+
+ +

Access the account's storage value at the given key.

+

This method is required by EIP-2929 introduced in EVMC_BERLIN. In records that the given account's storage key has been access and returns the previous access status. To mock storage access list (EIP-2930), you can pre-init account's storage values with the EVMC_ACCESS_WARM flag:

mocked_host.accounts[msg.recipient].storage[key] = {value,
+EVMC_ACCESS_WARM};
+
Parameters
+ + + +
addrThe account address.
keyThe account's storage key.
+
+
+
Returns
The EVMC_ACCESS_WARM if the storage key has been accessed before, the EVMC_ACCESS_COLD otherwise.
+ +

Implements evmc::HostInterface.

+ +

Definition at line 471 of file mocked_host.hpp.

+
472 {
+
473 auto& value = accounts[addr].storage[key];
+
474 const auto access_status = value.access_status;
+
475 value.access_status = EVMC_ACCESS_WARM;
+
476 return access_status;
+
477 }
+
std::unordered_map< address, MockedAccount > accounts
The set of all accounts in the Host, organized by their addresses.
Definition: mocked_host.hpp:98
+
+
+
+ +

◆ account_exists()

+ +
+
+ + + + + +
+ + + + + + + + +
bool evmc::MockedHost::account_exists (const addressaddr) const
+
+inlineoverridevirtualnoexcept
+
+ +

Returns true if an account exists (EVMC Host method).

+ +

Implements evmc::HostInterface.

+ +

Definition at line 150 of file mocked_host.hpp.

+
151 {
+
152 record_account_access(addr);
+
153 return accounts.count(addr) != 0;
+
154 }
+
+
+
+ +

◆ call()

+ +
+
+ + + + + +
+ + + + + + + + +
Result evmc::MockedHost::call (const evmc_messagemsg)
+
+inlineoverridevirtualnoexcept
+
+ +

Call/create other contract (EVMC host method).

+ +

Implements evmc::HostInterface.

+ +

Definition at line 380 of file mocked_host.hpp.

+
381 {
+
382 record_account_access(msg.recipient);
+
383
+
384 if (recorded_calls.empty())
+
385 {
+ +
387 m_recorded_calls_inputs.reserve(max_recorded_calls); // Iterators will not invalidate.
+
388 }
+
389
+ +
391 {
+
392 recorded_calls.emplace_back(msg);
+
393 auto& call_msg = recorded_calls.back();
+
394 if (call_msg.input_size > 0)
+
395 {
+
396 m_recorded_calls_inputs.emplace_back(call_msg.input_data, call_msg.input_size);
+
397 const auto& input_copy = m_recorded_calls_inputs.back();
+
398 call_msg.input_data = input_copy.data();
+
399 }
+
400 }
+
401 return Result{call_result};
+
402 }
+
evmc_result call_result
The call result to be returned by the call() method.
+
static constexpr auto max_recorded_calls
The maximum number of entries in recorded_calls record.
+
std::vector< evmc_message > recorded_calls
The record of all call messages requested in the call() method.
+
evmc_address recipient
The recipient of the message.
Definition: evmc.h:133
+
+
+
+ +

◆ copy_code()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
size_t evmc::MockedHost::copy_code (const addressaddr,
size_t code_offset,
uint8_t * buffer_data,
size_t buffer_size 
) const
+
+inlineoverridevirtualnoexcept
+
+ +

Copy the account's code to the given buffer (EVMC host method).

+ +

Implements evmc::HostInterface.

+ +

Definition at line 348 of file mocked_host.hpp.

+
352 {
+
353 record_account_access(addr);
+
354 const auto it = accounts.find(addr);
+
355 if (it == accounts.end())
+
356 return 0;
+
357
+
358 const auto& code = it->second.code;
+
359
+
360 if (code_offset >= code.size())
+
361 return 0;
+
362
+
363 const auto n = std::min(buffer_size, code.size() - code_offset);
+
364
+
365 if (n > 0)
+
366 std::copy_n(&code[code_offset], n, buffer_data);
+
367 return n;
+
368 }
+
+
+
+ +

◆ emit_log()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void evmc::MockedHost::emit_log (const addressaddr,
const uint8_t * data,
size_t data_size,
const bytes32 topics[],
size_t topics_count 
)
+
+inlineoverridevirtualnoexcept
+
+ +

Emit LOG (EVMC host method).

+ +

Implements evmc::HostInterface.

+ +

Definition at line 415 of file mocked_host.hpp.

+
420 {
+
421 recorded_logs.push_back({addr, {data, data_size}, {topics, topics + topics_count}});
+
422 }
+
std::vector< log_record > recorded_logs
The record of all LOGs passed to the emit_log() method.
+
+
+
+ +

◆ get_balance()

+ +
+
+ + + + + +
+ + + + + + + + +
uint256be evmc::MockedHost::get_balance (const addressaddr) const
+
+inlineoverridevirtualnoexcept
+
+ +

Get the account's balance (EVMC Host method).

+ +

Implements evmc::HostInterface.

+ +

Definition at line 317 of file mocked_host.hpp.

+
318 {
+
319 record_account_access(addr);
+
320 const auto it = accounts.find(addr);
+
321 if (it == accounts.end())
+
322 return {};
+
323
+
324 return it->second.balance;
+
325 }
+
+
+
+ +

◆ get_block_hash()

+ +
+
+ + + + + +
+ + + + + + + + +
bytes32 evmc::MockedHost::get_block_hash (int64_t block_number) const
+
+inlineoverridevirtualnoexcept
+
+ +

Get the block header hash (EVMC host method).

+ +

Implements evmc::HostInterface.

+ +

Definition at line 408 of file mocked_host.hpp.

+
409 {
+
410 recorded_blockhashes.emplace_back(block_number);
+
411 return block_hash;
+
412 }
+
bytes32 block_hash
The block header hash value to be returned by get_block_hash().
+
std::vector< int64_t > recorded_blockhashes
The record of all block numbers for which get_block_hash() was called.
+
+
+
+ +

◆ get_code_hash()

+ +
+
+ + + + + +
+ + + + + + + + +
bytes32 evmc::MockedHost::get_code_hash (const addressaddr) const
+
+inlineoverridevirtualnoexcept
+
+ +

Get the account's code hash (EVMC host method).

+ +

Implements evmc::HostInterface.

+ +

Definition at line 338 of file mocked_host.hpp.

+
339 {
+
340 record_account_access(addr);
+
341 const auto it = accounts.find(addr);
+
342 if (it == accounts.end())
+
343 return {};
+
344 return it->second.codehash;
+
345 }
+
+
+
+ +

◆ get_code_size()

+ +
+
+ + + + + +
+ + + + + + + + +
size_t evmc::MockedHost::get_code_size (const addressaddr) const
+
+inlineoverridevirtualnoexcept
+
+ +

Get the account's code size (EVMC host method).

+ +

Implements evmc::HostInterface.

+ +

Definition at line 328 of file mocked_host.hpp.

+
329 {
+
330 record_account_access(addr);
+
331 const auto it = accounts.find(addr);
+
332 if (it == accounts.end())
+
333 return 0;
+
334 return it->second.code.size();
+
335 }
+
+
+
+ +

◆ get_storage()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bytes32 evmc::MockedHost::get_storage (const addressaddr,
const bytes32key 
) const
+
+inlineoverridevirtualnoexcept
+
+ +

Get the account's storage value at the given key (EVMC Host method).

+ +

Implements evmc::HostInterface.

+ +

Definition at line 157 of file mocked_host.hpp.

+
158 {
+
159 record_account_access(addr);
+
160
+
161 const auto account_iter = accounts.find(addr);
+
162 if (account_iter == accounts.end())
+
163 return {};
+
164
+
165 const auto storage_iter = account_iter->second.storage.find(key);
+
166 if (storage_iter != account_iter->second.storage.end())
+
167 return storage_iter->second.current;
+
168 return {};
+
169 }
+
+
+
+ +

◆ get_transient_storage()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bytes32 evmc::MockedHost::get_transient_storage (const addressaddr,
const bytes32key 
) const
+
+inlineoverridevirtualnoexcept
+
+ +

Get account's transient storage.

+
Parameters
+ + + +
addrThe account address.
keyThe account's transient storage key.
+
+
+
Returns
The transient storage value. Null value in case the account does not exist.
+ +

Implements evmc::HostInterface.

+ +

Definition at line 484 of file mocked_host.hpp.

+
485 {
+
486 record_account_access(addr);
+
487
+
488 const auto account_iter = accounts.find(addr);
+
489 if (account_iter == accounts.end())
+
490 return {};
+
491
+
492 const auto storage_iter = account_iter->second.transient_storage.find(key);
+
493 if (storage_iter != account_iter->second.transient_storage.end())
+
494 return storage_iter->second;
+
495 return {};
+
496 }
+
+
+
+ +

◆ get_tx_context()

+ +
+
+ + + + + +
+ + + + + + + +
evmc_tx_context evmc::MockedHost::get_tx_context () const
+
+inlineoverridevirtualnoexcept
+
+ +

Get transaction context (EVMC host method).

+ +

Implements evmc::HostInterface.

+ +

Definition at line 405 of file mocked_host.hpp.

+
405{ return tx_context; }
+
evmc_tx_context tx_context
The EVMC transaction context to be returned by get_tx_context().
+
+
+
+ +

◆ selfdestruct()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool evmc::MockedHost::selfdestruct (const addressaddr,
const addressbeneficiary 
)
+
+inlineoverridevirtualnoexcept
+
+ +

Selfdestruct the account (EVMC host method).

+ +

Implements evmc::HostInterface.

+ +

Definition at line 371 of file mocked_host.hpp.

+
372 {
+
373 record_account_access(addr);
+
374 auto& beneficiaries = recorded_selfdestructs[addr];
+
375 beneficiaries.emplace_back(beneficiary);
+
376 return beneficiaries.size() == 1;
+
377 }
+
std::unordered_map< address, std::vector< address > > recorded_selfdestructs
The record of all SELFDESTRUCTs from the selfdestruct() method as a map selfdestructed_address => [be...
+
+
+
+ +

◆ set_storage()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
evmc_storage_status evmc::MockedHost::set_storage (const addressaddr,
const bytes32key,
const bytes32value 
)
+
+inlineoverridevirtualnoexcept
+
+ +

Set the account's storage value (EVMC Host method).

+ +

Implements evmc::HostInterface.

+ +

Definition at line 172 of file mocked_host.hpp.

+
175 {
+
176 record_account_access(addr);
+
177
+
178 // Get the reference to the storage entry value.
+
179 // This will create the account in case it was not present.
+
180 // This is convenient for unit testing and standalone EVM execution to preserve the
+
181 // storage values after the execution terminates.
+
182 auto& s = accounts[addr].storage[key];
+
183
+
184 // Follow the EIP-2200 specification as closely as possible.
+
185 // https://eips.ethereum.org/EIPS/eip-2200
+
186 // Warning: this is not the most efficient implementation. The storage status can be
+
187 // figured out by combining only 4 checks:
+
188 // - original != current (dirty)
+
189 // - original == value (restored)
+
190 // - current != 0
+
191 // - value != 0
+
192 const auto status = [&original = s.original, &current = s.current, &value]() {
+
193 // Clause 1 is irrelevant:
+
194 // 1. "If gasleft is less than or equal to gas stipend,
+
195 // fail the current call frame with ‘out of gas’ exception"
+
196
+
197 // 2. "If current value equals new value (this is a no-op)"
+
198 if (current == value)
+
199 {
+
200 // "SLOAD_GAS is deducted"
+ +
202 }
+
203 // 3. "If current value does not equal new value"
+
204 else
+
205 {
+
206 // 3.1. "If original value equals current value
+
207 // (this storage slot has not been changed by the current execution context)"
+
208 if (original == current)
+
209 {
+
210 // 3.1.1 "If original value is 0"
+
211 if (is_zero(original))
+
212 {
+
213 // "SSTORE_SET_GAS is deducted"
+
214 return EVMC_STORAGE_ADDED;
+
215 }
+
216 // 3.1.2 "Otherwise"
+
217 else
+
218 {
+
219 // "SSTORE_RESET_GAS gas is deducted"
+
220 auto st = EVMC_STORAGE_MODIFIED;
+
221
+
222 // "If new value is 0"
+
223 if (is_zero(value))
+
224 {
+
225 // "add SSTORE_CLEARS_SCHEDULE gas to refund counter"
+ +
227 }
+
228
+
229 return st;
+
230 }
+
231 }
+
232 // 3.2. "If original value does not equal current value
+
233 // (this storage slot is dirty),
+
234 // SLOAD_GAS gas is deducted.
+
235 // Apply both of the following clauses."
+
236 else
+
237 {
+
238 // Because we need to apply "both following clauses"
+
239 // we first collect information which clause is triggered
+
240 // then assign status code to combination of these clauses.
+
241 enum
+
242 {
+
243 None = 0,
+
244 RemoveClearsSchedule = 1 << 0,
+
245 AddClearsSchedule = 1 << 1,
+
246 RestoredBySet = 1 << 2,
+
247 RestoredByReset = 1 << 3,
+
248 };
+
249 int triggered_clauses = None;
+
250
+
251 // 3.2.1. "If original value is not 0"
+
252 if (!is_zero(original))
+
253 {
+
254 // 3.2.1.1. "If current value is 0"
+
255 if (is_zero(current))
+
256 {
+
257 // "(also means that new value is not 0)"
+
258 assert(!is_zero(value));
+
259 // "remove SSTORE_CLEARS_SCHEDULE gas from refund counter"
+
260 triggered_clauses |= RemoveClearsSchedule;
+
261 }
+
262 // 3.2.1.2. "If new value is 0"
+
263 if (is_zero(value))
+
264 {
+
265 // "(also means that current value is not 0)"
+
266 assert(!is_zero(current));
+
267 // "add SSTORE_CLEARS_SCHEDULE gas to refund counter"
+
268 triggered_clauses |= AddClearsSchedule;
+
269 }
+
270 }
+
271
+
272 // 3.2.2. "If original value equals new value (this storage slot is reset)"
+
273 // Except: we use term 'storage slot restored'.
+
274 if (original == value)
+
275 {
+
276 // 3.2.2.1. "If original value is 0"
+
277 if (is_zero(original))
+
278 {
+
279 // "add SSTORE_SET_GAS - SLOAD_GAS to refund counter"
+
280 triggered_clauses |= RestoredBySet;
+
281 }
+
282 // 3.2.2.2. "Otherwise"
+
283 else
+
284 {
+
285 // "add SSTORE_RESET_GAS - SLOAD_GAS gas to refund counter"
+
286 triggered_clauses |= RestoredByReset;
+
287 }
+
288 }
+
289
+
290 switch (triggered_clauses)
+
291 {
+
292 case RemoveClearsSchedule:
+ +
294 case AddClearsSchedule:
+ +
296 case RemoveClearsSchedule | RestoredByReset:
+ +
298 case RestoredBySet:
+ +
300 case RestoredByReset:
+ +
302 case None:
+ +
304 default:
+
305 assert(false); // Other combinations are impossible.
+
306 return evmc_storage_status{};
+
307 }
+
308 }
+
309 }
+
310 }();
+
311
+
312 s.current = value; // Finally update the current storage value.
+
313 return status;
+
314 }
+
evmc_storage_status
The effect of an attempt to modify a contract storage item.
Definition: evmc.h:569
+
@ EVMC_STORAGE_ADDED_DELETED
A storage item is deleted by changing the current dirty nonzero to the original zero value.
Definition: evmc.h:633
+
@ EVMC_STORAGE_MODIFIED_RESTORED
A storage item is modified by changing the current dirty nonzero to the original nonzero value other ...
Definition: evmc.h:640
+
@ EVMC_STORAGE_DELETED_RESTORED
A storage item is added by changing the current dirty zero to the original value.
Definition: evmc.h:626
+
@ EVMC_STORAGE_ADDED
A new storage item is added by changing the current clean zero to a nonzero value.
Definition: evmc.h:591
+
@ EVMC_STORAGE_MODIFIED_DELETED
A storage item is deleted by changing the current dirty nonzero to the zero value and the original va...
Definition: evmc.h:619
+
@ EVMC_STORAGE_ASSIGNED
The new/same value is assigned to the storage item without affecting the cost structure.
Definition: evmc.h:584
+
@ EVMC_STORAGE_DELETED
A storage item is deleted by changing the current clean nonzero to the zero value.
Definition: evmc.h:598
+
@ EVMC_STORAGE_DELETED_ADDED
A storage item is added by changing the current dirty zero to a nonzero value other than the original...
Definition: evmc.h:612
+
@ EVMC_STORAGE_MODIFIED
A storage item is modified by changing the current clean nonzero to other nonzero value.
Definition: evmc.h:605
+
constexpr bool is_zero(const address &a) noexcept
Checks if the given address is the zero address.
Definition: evmc.hpp:258
+
+
+
+ +

◆ set_transient_storage()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void evmc::MockedHost::set_transient_storage (const addressaddr,
const bytes32key,
const bytes32value 
)
+
+inlineoverridevirtualnoexcept
+
+ +

Set account's transient storage.

+
Parameters
+ + + + +
addrThe account address.
keyThe account's transient storage key.
valueThe value to be stored.
+
+
+ +

Implements evmc::HostInterface.

+ +

Definition at line 503 of file mocked_host.hpp.

+
506 {
+
507 record_account_access(addr);
+
508 accounts[addr].transient_storage[key] = value;
+
509 }
+
+
+
+

Member Data Documentation

+ +

◆ accounts

+ +
+
+ + + + +
std::unordered_map<address, MockedAccount> evmc::MockedHost::accounts
+
+ +

The set of all accounts in the Host, organized by their addresses.

+ +

Definition at line 98 of file mocked_host.hpp.

+ +
+
+ +

◆ block_hash

+ +
+
+ + + + +
bytes32 evmc::MockedHost::block_hash = {}
+
+ +

The block header hash value to be returned by get_block_hash().

+ +

Definition at line 104 of file mocked_host.hpp.

+ +
+
+ +

◆ call_result

+ +
+
+ + + + +
evmc_result evmc::MockedHost::call_result = {}
+
+ +

The call result to be returned by the call() method.

+ +

Definition at line 107 of file mocked_host.hpp.

+ +
+
+ +

◆ max_recorded_account_accesses

+ +
+
+ + + + + +
+ + + + +
constexpr auto evmc::MockedHost::max_recorded_account_accesses = 200
+
+staticconstexpr
+
+ +

The maximum number of entries in recorded_account_accesses record.

+

This is arbitrary value useful in fuzzing when we don't want the record to explode.

+ +

Definition at line 117 of file mocked_host.hpp.

+ +
+
+ +

◆ max_recorded_calls

+ +
+
+ + + + + +
+ + + + +
constexpr auto evmc::MockedHost::max_recorded_calls = 100
+
+staticconstexpr
+
+ +

The maximum number of entries in recorded_calls record.

+

This is arbitrary value useful in fuzzing when we don't want the record to explode.

+ +

Definition at line 124 of file mocked_host.hpp.

+ +
+
+ +

◆ recorded_account_accesses

+ +
+
+ + + + + +
+ + + + +
std::vector<address> evmc::MockedHost::recorded_account_accesses
+
+mutable
+
+ +

The record of all account accesses.

+ +

Definition at line 113 of file mocked_host.hpp.

+ +
+
+ +

◆ recorded_blockhashes

+ +
+
+ + + + + +
+ + + + +
std::vector<int64_t> evmc::MockedHost::recorded_blockhashes
+
+mutable
+
+ +

The record of all block numbers for which get_block_hash() was called.

+ +

Definition at line 110 of file mocked_host.hpp.

+ +
+
+ +

◆ recorded_calls

+ +
+
+ + + + +
std::vector<evmc_message> evmc::MockedHost::recorded_calls
+
+ +

The record of all call messages requested in the call() method.

+ +

Definition at line 120 of file mocked_host.hpp.

+ +
+
+ +

◆ recorded_logs

+ +
+
+ + + + +
std::vector<log_record> evmc::MockedHost::recorded_logs
+
+ +

The record of all LOGs passed to the emit_log() method.

+ +

Definition at line 127 of file mocked_host.hpp.

+ +
+
+ +

◆ recorded_selfdestructs

+ +
+
+ + + + +
std::unordered_map<address, std::vector<address> > evmc::MockedHost::recorded_selfdestructs
+
+ +

The record of all SELFDESTRUCTs from the selfdestruct() method as a map selfdestructed_address => [beneficiary1, beneficiary2, ...].

+ +

Definition at line 131 of file mocked_host.hpp.

+ +
+
+ +

◆ tx_context

+ +
+
+ + + + +
evmc_tx_context evmc::MockedHost::tx_context = {}
+
+ +

The EVMC transaction context to be returned by get_tx_context().

+ +

Definition at line 101 of file mocked_host.hpp.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/classevmc_1_1MockedHost.js b/classevmc_1_1MockedHost.js new file mode 100644 index 000000000..5b3bcfab7 --- /dev/null +++ b/classevmc_1_1MockedHost.js @@ -0,0 +1,31 @@ +var classevmc_1_1MockedHost = +[ + [ "log_record", "structevmc_1_1MockedHost_1_1log__record.html", "structevmc_1_1MockedHost_1_1log__record" ], + [ "access_account", "classevmc_1_1MockedHost.html#a51f9acf40acec535549d32c7ab079b9e", null ], + [ "access_storage", "classevmc_1_1MockedHost.html#a759d289a03d7ebeac0b727938d9ee521", null ], + [ "account_exists", "classevmc_1_1MockedHost.html#a53a463e19e4908022137ce53715c2dce", null ], + [ "call", "classevmc_1_1MockedHost.html#a5d71e832152fb67e179a2b7ec0c1d617", null ], + [ "copy_code", "classevmc_1_1MockedHost.html#a2679f00109fab1c027fb789b83a25d20", null ], + [ "emit_log", "classevmc_1_1MockedHost.html#a4263c29b321dbecfcbb4357a469a3bee", null ], + [ "get_balance", "classevmc_1_1MockedHost.html#a401e74178baba9772638e6b4309e9bee", null ], + [ "get_block_hash", "classevmc_1_1MockedHost.html#ace3ba78141acc06849d3b34382466e36", null ], + [ "get_code_hash", "classevmc_1_1MockedHost.html#a776687379553c67540c8c16df9e8f226", null ], + [ "get_code_size", "classevmc_1_1MockedHost.html#a0ecf2503e3af4ed98cce8eff45385a33", null ], + [ "get_storage", "classevmc_1_1MockedHost.html#a6336919efaf07ad1e9e4f725a86ebdca", null ], + [ "get_transient_storage", "classevmc_1_1MockedHost.html#a7a98cc94d7d653aeb700138d930d2ffe", null ], + [ "get_tx_context", "classevmc_1_1MockedHost.html#a45187586bde530ca7beb157467c12733", null ], + [ "selfdestruct", "classevmc_1_1MockedHost.html#aadd9e743e86e99fb700471e9a7589cee", null ], + [ "set_storage", "classevmc_1_1MockedHost.html#aad63cd61357052ab1fa87e6ff372b3d7", null ], + [ "set_transient_storage", "classevmc_1_1MockedHost.html#ae5544410286c84d07ebe04a939b922da", null ], + [ "accounts", "classevmc_1_1MockedHost.html#a5bc5bfc2b23104dc5554f87c51383b47", null ], + [ "block_hash", "classevmc_1_1MockedHost.html#a4cdb6de6b81f9845eb6079f5729e0805", null ], + [ "call_result", "classevmc_1_1MockedHost.html#a473ec63bcb8b786c5fb1b097cfcfb8c0", null ], + [ "max_recorded_account_accesses", "classevmc_1_1MockedHost.html#a5ab49cfd8bc76f9dab117946a5c12efa", null ], + [ "max_recorded_calls", "classevmc_1_1MockedHost.html#a78ad202959aa8d416faf715ab6f7f687", null ], + [ "recorded_account_accesses", "classevmc_1_1MockedHost.html#aee945d218d656a7788d4fce5f30db3ca", null ], + [ "recorded_blockhashes", "classevmc_1_1MockedHost.html#ac4acf299c63beb5134fede0d0a5f7c1f", null ], + [ "recorded_calls", "classevmc_1_1MockedHost.html#af4487c7cb827ef8ce54da187d109189a", null ], + [ "recorded_logs", "classevmc_1_1MockedHost.html#a6f6b51ddda349341a158456a180f7d9e", null ], + [ "recorded_selfdestructs", "classevmc_1_1MockedHost.html#ac1fc2d692202a6e916684640ea1d3f5a", null ], + [ "tx_context", "classevmc_1_1MockedHost.html#addf01838d4c15228e746caa0a645a3b1", null ] +]; \ No newline at end of file diff --git a/classevmc_1_1MockedHost.png b/classevmc_1_1MockedHost.png new file mode 100644 index 000000000..17ecdb488 Binary files /dev/null and b/classevmc_1_1MockedHost.png differ diff --git a/classevmc_1_1Result-members.html b/classevmc_1_1Result-members.html new file mode 100644 index 000000000..6229e1358 --- /dev/null +++ b/classevmc_1_1Result-members.html @@ -0,0 +1,93 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
evmc::Result Member List
+
+
+ +

This is the complete list of members for evmc::Result, including all inherited members.

+ + + + + + + + + + + + + + + + + +
create_addressevmc::Result
gas_leftevmc::Result
gas_refundevmc::Result
operator=(Result &&other) noexceptevmc::Resultinline
output_dataevmc::Result
output_sizeevmc::Result
raw() noexceptevmc::Resultinline
raw() const noexceptevmc::Resultinline
release_raw() noexceptevmc::Resultinline
Result(evmc_status_code _status_code, int64_t _gas_left, int64_t _gas_refund, const uint8_t *_output_data, size_t _output_size) noexceptevmc::Resultinlineexplicit
Result(evmc_status_code _status_code=EVMC_INTERNAL_ERROR, int64_t _gas_left=0, int64_t _gas_refund=0) noexceptevmc::Resultinlineexplicit
Result(evmc_status_code _status_code, int64_t _gas_left, int64_t _gas_refund, const evmc_address &_create_address) noexceptevmc::Resultinlineexplicit
Result(const evmc_result &res) noexceptevmc::Resultinlineexplicit
Result(Result &&other) noexceptevmc::Resultinline
status_codeevmc::Result
~Result() noexceptevmc::Resultinline
+
+ + + + diff --git a/classevmc_1_1Result.html b/classevmc_1_1Result.html new file mode 100644 index 000000000..89dc1ec17 --- /dev/null +++ b/classevmc_1_1Result.html @@ -0,0 +1,710 @@ + + + + + + + +EVMC: evmc::Result Class Reference + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ +
evmc::Result Class Reference
+
+
+ +

The EVM code execution result. + More...

+ +

#include <evmc.hpp>

+
+Inheritance diagram for evmc::Result:
+
+
+ + +evmc_result + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 Result (evmc_status_code _status_code, int64_t _gas_left, int64_t _gas_refund, const uint8_t *_output_data, size_t _output_size) noexcept
 Creates the result from the provided arguments.
 
 Result (evmc_status_code _status_code=EVMC_INTERNAL_ERROR, int64_t _gas_left=0, int64_t _gas_refund=0) noexcept
 Creates the result without output.
 
 Result (evmc_status_code _status_code, int64_t _gas_left, int64_t _gas_refund, const evmc_address &_create_address) noexcept
 Creates the result of contract creation.
 
 Result (const evmc_result &res) noexcept
 Converting constructor from raw evmc_result.
 
 ~Result () noexcept
 Destructor responsible for automatically releasing attached resources.
 
 Result (Result &&other) noexcept
 Move constructor.
 
Resultoperator= (Result &&other) noexcept
 Move assignment operator.
 
evmc_resultraw () noexcept
 Access the result object as a referenced to evmc_result.
 
const evmc_resultraw () const noexcept
 Access the result object as a const referenced to evmc_result.
 
evmc_result release_raw () noexcept
 Releases the ownership and returns the raw copy of evmc_result.
 
+ + + + + + + + + + + + + + + + + + + +

+Public Attributes

evmc_address create_address
 The address of the possibly created contract.
 
int64_t gas_left
 The amount of gas left after the execution.
 
int64_t gas_refund
 The refunded gas accumulated from this execution and its sub-calls.
 
const uint8_t * output_data
 The reference to output data.
 
size_t output_size
 The size of the output data.
 
enum evmc_status_code status_code
 The execution status code.
 
+

Detailed Description

+

The EVM code execution result.

+

This is a RAII wrapper for evmc_result and objects of this type automatically release attached resources.

+ +

Definition at line 328 of file evmc.hpp.

+

Constructor & Destructor Documentation

+ +

◆ Result() [1/5]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
evmc::Result::Result (evmc_status_code _status_code,
int64_t _gas_left,
int64_t _gas_refund,
const uint8_t * _output_data,
size_t _output_size 
)
+
+inlineexplicitnoexcept
+
+ +

Creates the result from the provided arguments.

+

The provided output is copied to memory allocated with malloc() and the evmc_result::release function is set to one invoking free().

+
Parameters
+ + + + + + +
_status_codeThe status code.
_gas_leftThe amount of gas left.
_gas_refundThe amount of refunded gas.
_output_dataThe pointer to the output.
_output_sizeThe output size.
+
+
+ +

Definition at line 348 of file evmc.hpp.

+
353 : evmc_result{make_result(_status_code, _gas_left, _gas_refund, _output_data, _output_size)}
+
354 {}
+
constexpr auto make_result
Alias for evmc_make_result().
Definition: evmc.hpp:322
+
The EVM code execution result.
Definition: evmc.h:416
+
+
+
+ +

◆ Result() [2/5]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
evmc::Result::Result (evmc_status_code _status_code = EVMC_INTERNAL_ERROR,
int64_t _gas_left = 0,
int64_t _gas_refund = 0 
)
+
+inlineexplicitnoexcept
+
+ +

Creates the result without output.

+
Parameters
+ + + + +
_status_codeThe status code.
_gas_leftThe amount of gas left.
_gas_refundThe amount of refunded gas.
+
+
+ +

Definition at line 361 of file evmc.hpp.

+
364 : evmc_result{make_result(_status_code, _gas_left, _gas_refund, nullptr, 0)}
+
365 {}
+
+
+
+ +

◆ Result() [3/5]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
evmc::Result::Result (evmc_status_code _status_code,
int64_t _gas_left,
int64_t _gas_refund,
const evmc_address_create_address 
)
+
+inlineexplicitnoexcept
+
+ +

Creates the result of contract creation.

+
Parameters
+ + + + + +
_status_codeThe status code.
_gas_leftThe amount of gas left.
_gas_refundThe amount of refunded gas.
_create_addressThe address of the possibly created account.
+
+
+ +

Definition at line 373 of file evmc.hpp.

+
377 : evmc_result{make_result(_status_code, _gas_left, _gas_refund, nullptr, 0)}
+
378 {
+
379 create_address = _create_address;
+
380 }
+
evmc_address create_address
The address of the possibly created contract.
Definition: evmc.h:486
+
+
+
+ +

◆ Result() [4/5]

+ +
+
+ + + + + +
+ + + + + + + + +
evmc::Result::Result (const evmc_resultres)
+
+inlineexplicitnoexcept
+
+ +

Converting constructor from raw evmc_result.

+

This object takes ownership of the resources of res.

+ +

Definition at line 385 of file evmc.hpp.

+
385: evmc_result{res} {}
+
+
+
+ +

◆ ~Result()

+ +
+
+ + + + + +
+ + + + + + + +
evmc::Result::~Result ()
+
+inlinenoexcept
+
+ +

Destructor responsible for automatically releasing attached resources.

+ +

Definition at line 388 of file evmc.hpp.

+
389 {
+
390 if (release != nullptr)
+
391 release(this);
+
392 }
+
evmc_release_result_fn release
The method releasing all resources associated with the result object.
Definition: evmc.h:476
+
+
+
+ +

◆ Result() [5/5]

+ +
+
+ + + + + +
+ + + + + + + + +
evmc::Result::Result (Result && other)
+
+inlinenoexcept
+
+ +

Move constructor.

+ +

Definition at line 395 of file evmc.hpp.

+
395 : evmc_result{other}
+
396 {
+
397 other.release = nullptr; // Disable releasing of the rvalue object.
+
398 }
+
+
+
+

Member Function Documentation

+ +

◆ operator=()

+ +
+
+ + + + + +
+ + + + + + + + +
Result & evmc::Result::operator= (Result && other)
+
+inlinenoexcept
+
+ +

Move assignment operator.

+

The self-assignment MUST never happen.

+
Parameters
+ + +
otherThe other result object.
+
+
+
Returns
The reference to the left-hand side object.
+ +

Definition at line 406 of file evmc.hpp.

+
407 {
+
408 this->~Result(); // Release this object.
+
409 static_cast<evmc_result&>(*this) = other; // Copy data.
+
410 other.release = nullptr; // Disable releasing of the rvalue object.
+
411 return *this;
+
412 }
+
~Result() noexcept
Destructor responsible for automatically releasing attached resources.
Definition: evmc.hpp:388
+
+
+
+ +

◆ raw() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
const evmc_result & evmc::Result::raw () const
+
+inlinenoexcept
+
+ +

Access the result object as a const referenced to evmc_result.

+ +

Definition at line 418 of file evmc.hpp.

+
418{ return *this; }
+
+
+
+ +

◆ raw() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
evmc_result & evmc::Result::raw ()
+
+inlinenoexcept
+
+ +

Access the result object as a referenced to evmc_result.

+ +

Definition at line 415 of file evmc.hpp.

+
415{ return *this; }
+
+
+
+ +

◆ release_raw()

+ +
+
+ + + + + +
+ + + + + + + +
evmc_result evmc::Result::release_raw ()
+
+inlinenoexcept
+
+ +

Releases the ownership and returns the raw copy of evmc_result.

+

This method drops the ownership of the result (result's resources are not going to be released when this object is destructed). It is the caller's responsibility having the returned copy of the result to release it. This object MUST NOT be used after this method is invoked.

+
Returns
The copy of this object converted to raw evmc_result.
+ +

Definition at line 428 of file evmc.hpp.

+
429 {
+
430 const auto out = evmc_result{*this}; // Copy data.
+
431 this->release = nullptr; // Disable releasing of this object.
+
432 return out;
+
433 }
+
+
+
+

Member Data Documentation

+ +

◆ create_address

+ +
+
+ + + + +
evmc_address evmc_result::create_address
+
+ +

The address of the possibly created contract.

+

The create address may be provided even though the contract creation has failed (evmc_result::status_code is not EVMC_SUCCESS). This is useful in situations when the address is observable, e.g. access to it remains warm. In all other cases the address MUST be null bytes.

+ +

Definition at line 486 of file evmc.h.

+ +
+
+ +

◆ gas_left

+ +
+
+ + + + +
int64_t evmc_result::gas_left
+
+ +

The amount of gas left after the execution.

+

If evmc_result::status_code is neither EVMC_SUCCESS nor EVMC_REVERT the value MUST be 0.

+ +

Definition at line 426 of file evmc.h.

+ +
+
+ +

◆ gas_refund

+ +
+
+ + + + +
int64_t evmc_result::gas_refund
+
+ +

The refunded gas accumulated from this execution and its sub-calls.

+

The transaction gas refund limit is not applied. If evmc_result::status_code is other than EVMC_SUCCESS the value MUST be 0.

+ +

Definition at line 434 of file evmc.h.

+ +
+
+ +

◆ output_data

+ +
+
+ + + + +
const uint8_t* evmc_result::output_data
+
+ +

The reference to output data.

+

The output contains data coming from RETURN opcode (iff evmc_result::code field is EVMC_SUCCESS) or from REVERT opcode.

+

The memory containing the output data is owned by EVM and has to be freed with evmc_result::release().

+

This pointer MAY be NULL. If evmc_result::output_size is 0 this pointer MUST NOT be dereferenced.

+ +

Definition at line 448 of file evmc.h.

+ +
+
+ +

◆ output_size

+ +
+
+ + + + +
size_t evmc_result::output_size
+
+ +

The size of the output data.

+

If evmc_result::output_data is NULL this MUST be 0.

+ +

Definition at line 455 of file evmc.h.

+ +
+
+ +

◆ status_code

+ +
+
+ + + + +
enum evmc_status_code evmc_result::status_code
+
+ +

The execution status code.

+ +

Definition at line 418 of file evmc.h.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/classevmc_1_1Result.js b/classevmc_1_1Result.js new file mode 100644 index 000000000..7acce3e01 --- /dev/null +++ b/classevmc_1_1Result.js @@ -0,0 +1,19 @@ +var classevmc_1_1Result = +[ + [ "Result", "classevmc_1_1Result.html#a21e879ce7a690aba0028e7ef91e9f863", null ], + [ "Result", "classevmc_1_1Result.html#aa37603ba2ebaf1014925f06429452c18", null ], + [ "Result", "classevmc_1_1Result.html#ac9c19c9a8170bd5020fe8ddb50e5e537", null ], + [ "Result", "classevmc_1_1Result.html#aae63ab0def71eae3c0d6e5e60627d399", null ], + [ "~Result", "classevmc_1_1Result.html#a4d78e0a5f1e1a32be7fa630fd2936072", null ], + [ "Result", "classevmc_1_1Result.html#ac14e374491419ec30615d65946b4e454", null ], + [ "operator=", "classevmc_1_1Result.html#aee4c7f118ae382fd5942eca613b83292", null ], + [ "raw", "classevmc_1_1Result.html#afdd82369b2f63b753379b8e011ef0e2d", null ], + [ "raw", "classevmc_1_1Result.html#a92adbea9254c34f5a9ce5e904ef749b5", null ], + [ "release_raw", "classevmc_1_1Result.html#ae24d5817726937dd9412861de6dcbdaf", null ], + [ "create_address", "classevmc_1_1Result.html#ae7f37ff7c9cfa3b58af2c89f4d610522", null ], + [ "gas_left", "classevmc_1_1Result.html#af8478c93dbcc3cb2876037c5a5afd4c0", null ], + [ "gas_refund", "classevmc_1_1Result.html#a8b68e61d8fbbeb59f8bc0770aaf94e9d", null ], + [ "output_data", "classevmc_1_1Result.html#a61978e85f9d795a7b9695b9cbf1748d6", null ], + [ "output_size", "classevmc_1_1Result.html#a93bb7419aff492cdef754421c6d74e26", null ], + [ "status_code", "classevmc_1_1Result.html#a759c4aaa4a1c002f5a8be09ccb0b6a1c", null ] +]; \ No newline at end of file diff --git a/classevmc_1_1Result.png b/classevmc_1_1Result.png new file mode 100644 index 000000000..4dc564b21 Binary files /dev/null and b/classevmc_1_1Result.png differ diff --git a/classevmc_1_1VM-members.html b/classevmc_1_1VM-members.html new file mode 100644 index 000000000..b58d9d7d1 --- /dev/null +++ b/classevmc_1_1VM-members.html @@ -0,0 +1,96 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
evmc::VM Member List
+
+
+ +

This is the complete list of members for evmc::VM, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + +
execute(const evmc_host_interface &host, evmc_host_context *ctx, evmc_revision rev, const evmc_message &msg, const uint8_t *code, size_t code_size) noexceptevmc::VMinline
execute(Host &host, evmc_revision rev, const evmc_message &msg, const uint8_t *code, size_t code_size) noexceptevmc::VMinline
execute(evmc_revision rev, const evmc_message &msg, const uint8_t *code, size_t code_size) noexceptevmc::VMinline
get_capabilities() const noexceptevmc::VMinline
get_raw_pointer() const noexceptevmc::VMinline
has_capability(evmc_capabilities capability) const noexceptevmc::VMinline
is_abi_compatible() const noexceptevmc::VMinline
name() const noexceptevmc::VMinline
operator bool() const noexceptevmc::VMinlineexplicit
operator=(const VM &)=delete (defined in evmc::VM)evmc::VM
operator=(VM &&other) noexceptevmc::VMinline
set_option(const char name[], const char value[]) noexceptevmc::VMinline
version() const noexceptevmc::VMinline
VM() noexcept=default (defined in evmc::VM)evmc::VM
VM(evmc_vm *vm) noexceptevmc::VMinlineexplicit
VM(const VM &)=delete (defined in evmc::VM)evmc::VM
VM(VM &&other) noexceptevmc::VMinline
VM(evmc_vm *vm, std::initializer_list< std::pair< const char *, const char * > > options) noexceptevmc::VMinline
~VM() noexceptevmc::VMinline
+
+ + + + diff --git a/classevmc_1_1VM.html b/classevmc_1_1VM.html new file mode 100644 index 000000000..2ca17a14a --- /dev/null +++ b/classevmc_1_1VM.html @@ -0,0 +1,796 @@ + + + + + + + +EVMC: evmc::VM Class Reference + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ +
evmc::VM Class Reference
+
+
+ +

The VM instance. + More...

+ +

#include <evmc.hpp>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 VM (evmc_vm *vm) noexcept
 Converting constructor from evmc_vm.
 
 ~VM () noexcept
 Destructor responsible for automatically destroying the VM instance.
 
VM (const VM &)=delete
 
+VMoperator= (const VM &)=delete
 
 VM (VM &&other) noexcept
 Move constructor.
 
VMoperator= (VM &&other) noexcept
 Move assignment operator.
 
 VM (evmc_vm *vm, std::initializer_list< std::pair< const char *, const char * > > options) noexcept
 The constructor that captures a VM instance and configures the instance with the provided list of options.
 
 operator bool () const noexcept
 Checks if contains a valid pointer to the VM instance.
 
bool is_abi_compatible () const noexcept
 Checks whenever the VM instance is ABI compatible with the current EVMC API.
 
char const * name () const noexcept
 The name of the EVMC VM implementation.
 
char const * version () const noexcept
 The version of the EVMC VM implementation, e.g.
 
bool has_capability (evmc_capabilities capability) const noexcept
 Checks if the VM has the given capability.
 
evmc_capabilities_flagset get_capabilities () const noexcept
 A method returning capabilities supported by the VM instance.
 
evmc_set_option_result set_option (const char name[], const char value[]) noexcept
 Sets the option for the VM, if the feature is supported by the VM.
 
Result execute (const evmc_host_interface &host, evmc_host_context *ctx, evmc_revision rev, const evmc_message &msg, const uint8_t *code, size_t code_size) noexcept
 Executes code in the VM instance.
 
Result execute (Host &host, evmc_revision rev, const evmc_message &msg, const uint8_t *code, size_t code_size) noexcept
 Convenient variant of the VM::execute() that takes reference to evmc::Host class.
 
Result execute (evmc_revision rev, const evmc_message &msg, const uint8_t *code, size_t code_size) noexcept
 Executes code without the Host context.
 
evmc_vmget_raw_pointer () const noexcept
 Returns the pointer to C EVMC struct representing the VM.
 
+

Detailed Description

+

The VM instance.

+

This is a RAII wrapper for evmc_vm, and object of this type automatically destroys the VM instance.

+ +

Definition at line 651 of file evmc.hpp.

+

Constructor & Destructor Documentation

+ +

◆ VM() [1/3]

+ +
+
+ + + + + +
+ + + + + + + + +
evmc::VM::VM (evmc_vmvm)
+
+inlineexplicitnoexcept
+
+ +

Converting constructor from evmc_vm.

+ +

Definition at line 657 of file evmc.hpp.

+
657: m_instance{vm} {}
+
+
+
+ +

◆ ~VM()

+ +
+
+ + + + + +
+ + + + + + + +
evmc::VM::~VM ()
+
+inlinenoexcept
+
+ +

Destructor responsible for automatically destroying the VM instance.

+ +

Definition at line 660 of file evmc.hpp.

+
661 {
+
662 if (m_instance != nullptr)
+
663 m_instance->destroy(m_instance);
+
664 }
+
evmc_destroy_fn destroy
Pointer to function destroying the VM instance.
Definition: evmc.h:1170
+
+
+
+ +

◆ VM() [2/3]

+ +
+
+ + + + + +
+ + + + + + + + +
evmc::VM::VM (VM && other)
+
+inlinenoexcept
+
+ +

Move constructor.

+ +

Definition at line 670 of file evmc.hpp.

+
670: m_instance{other.m_instance} { other.m_instance = nullptr; }
+
+
+
+ +

◆ VM() [3/3]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
evmc::VM::VM (evmc_vmvm,
std::initializer_list< std::pair< const char *, const char * > > options 
)
+
+inlinenoexcept
+
+ +

The constructor that captures a VM instance and configures the instance with the provided list of options.

+ +

Definition at line 765 of file evmc.hpp.

+
767 : m_instance{vm}
+
768{
+
769 // This constructor is implemented outside of the class definition to workaround a doxygen bug.
+
770 for (const auto& option : options)
+
771 set_option(option.first, option.second);
+
772}
+
evmc_set_option_result set_option(const char name[], const char value[]) noexcept
Sets the option for the VM, if the feature is supported by the VM.
Definition: evmc.hpp:711
+
+
+
+

Member Function Documentation

+ +

◆ execute() [1/3]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Result evmc::VM::execute (const evmc_host_interfacehost,
evmc_host_contextctx,
evmc_revision rev,
const evmc_messagemsg,
const uint8_t * code,
size_t code_size 
)
+
+inlinenoexcept
+
+ +

Executes code in the VM instance.

+
See also
evmc_execute_fn.
+ +

Definition at line 717 of file evmc.hpp.

+
723 {
+
724 return Result{m_instance->execute(m_instance, &host, ctx, rev, &msg, code, code_size)};
+
725 }
+
evmc_execute_fn execute
Pointer to function executing a code by the VM instance.
Definition: evmc.h:1177
+
+
+
+ +

◆ execute() [2/3]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Result evmc::VM::execute (evmc_revision rev,
const evmc_messagemsg,
const uint8_t * code,
size_t code_size 
)
+
+inlinenoexcept
+
+ +

Executes code without the Host context.

+

The same as execute(const evmc_host_interface&, evmc_host_context*, evmc_revision, + const evmc_message&, const uint8_t*, size_t), but without providing the Host context and interface. This method is for experimental precompiles support where execution is guaranteed not to require any Host access.

+ +

Definition at line 745 of file evmc.hpp.

+
749 {
+
750 return Result{
+
751 m_instance->execute(m_instance, nullptr, nullptr, rev, &msg, code, code_size)};
+
752 }
+
+
+
+ +

◆ execute() [3/3]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Result evmc::VM::execute (Hosthost,
evmc_revision rev,
const evmc_messagemsg,
const uint8_t * code,
size_t code_size 
)
+
+inlinenoexcept
+
+ +

Convenient variant of the VM::execute() that takes reference to evmc::Host class.

+ +

Definition at line 728 of file evmc.hpp.

+
733 {
+
734 return execute(Host::get_interface(), host.to_context(), rev, msg, code, code_size);
+
735 }
+
static const evmc_host_interface & get_interface() noexcept
Provides access to the global host interface.
Definition: evmc.hpp:882
+
Result execute(const evmc_host_interface &host, evmc_host_context *ctx, evmc_revision rev, const evmc_message &msg, const uint8_t *code, size_t code_size) noexcept
Executes code in the VM instance.
Definition: evmc.hpp:717
+
+
+
+ +

◆ get_capabilities()

+ +
+
+ + + + + +
+ + + + + + + +
evmc_capabilities_flagset evmc::VM::get_capabilities () const
+
+inlinenoexcept
+
+ +

A method returning capabilities supported by the VM instance.

+

The value returned MAY change when different options are set via the set_option() method.

+

A Client SHOULD only rely on the value returned if it has queried it after it has called the set_option().

+

This is a mandatory method and MUST NOT be set to NULL.

+ +

Definition at line 705 of file evmc.hpp.

+
706 {
+
707 return m_instance->get_capabilities(m_instance);
+
708 }
+
evmc_get_capabilities_fn get_capabilities
A method returning capabilities supported by the VM instance.
Definition: evmc.h:1189
+
+
+
+ +

◆ get_raw_pointer()

+ +
+
+ + + + + +
+ + + + + + + +
evmc_vm * evmc::VM::get_raw_pointer () const
+
+inlinenoexcept
+
+ +

Returns the pointer to C EVMC struct representing the VM.

+

Gives access to the C EVMC VM struct to allow advanced interaction with the VM not supported by the C++ interface. Use as the last resort. This object still owns the VM after returning the pointer. The returned pointer MAY be null.

+ +

Definition at line 759 of file evmc.hpp.

+
759{ return m_instance; }
+
+
+
+ +

◆ has_capability()

+ +
+
+ + + + + +
+ + + + + + + + +
bool evmc::VM::has_capability (evmc_capabilities capability) const
+
+inlinenoexcept
+
+ +

Checks if the VM has the given capability.

+ +

Definition at line 699 of file evmc.hpp.

+
700 {
+
701 return (get_capabilities() & static_cast<evmc_capabilities_flagset>(capability)) != 0;
+
702 }
+
evmc_capabilities_flagset get_capabilities() const noexcept
A method returning capabilities supported by the VM instance.
Definition: evmc.hpp:705
+
uint32_t evmc_capabilities_flagset
Alias for unsigned integer representing a set of bit flags of EVMC capabilities.
Definition: evmc.h:1120
+
+
+
+ +

◆ is_abi_compatible()

+ +
+
+ + + + + +
+ + + + + + + +
bool evmc::VM::is_abi_compatible () const
+
+inlinenoexcept
+
+ +

Checks whenever the VM instance is ABI compatible with the current EVMC API.

+ +

Definition at line 690 of file evmc.hpp.

+
690{ return m_instance->abi_version == EVMC_ABI_VERSION; }
+
@ EVMC_ABI_VERSION
The EVMC ABI version number of the interface declared in this file.
Definition: evmc.h:47
+
const int abi_version
EVMC ABI version implemented by the VM instance.
Definition: evmc.h:1147
+
+
+
+ +

◆ name()

+ +
+
+ + + + + +
+ + + + + + + +
char const * evmc::VM::name () const
+
+inlinenoexcept
+
+ +

The name of the EVMC VM implementation.

+

It MUST be a NULL-terminated not empty string. The content MUST be UTF-8 encoded (this implies ASCII encoding is also allowed).

+ +

Definition at line 693 of file evmc.hpp.

+
693{ return m_instance->name; }
+
const char * name
The name of the EVMC VM implementation.
Definition: evmc.h:1155
+
+
+
+ +

◆ operator bool()

+ +
+
+ + + + + +
+ + + + + + + +
evmc::VM::operator bool () const
+
+inlineexplicitnoexcept
+
+ +

Checks if contains a valid pointer to the VM instance.

+ +

Definition at line 687 of file evmc.hpp.

+
687{ return m_instance != nullptr; }
+
+
+
+ +

◆ operator=()

+ +
+
+ + + + + +
+ + + + + + + + +
VM & evmc::VM::operator= (VM && other)
+
+inlinenoexcept
+
+ +

Move assignment operator.

+ +

Definition at line 673 of file evmc.hpp.

+
674 {
+
675 this->~VM();
+
676 m_instance = other.m_instance;
+
677 other.m_instance = nullptr;
+
678 return *this;
+
679 }
+
~VM() noexcept
Destructor responsible for automatically destroying the VM instance.
Definition: evmc.hpp:660
+
+
+
+ +

◆ set_option()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
evmc_set_option_result evmc::VM::set_option (const char name[],
const char value[] 
)
+
+inlinenoexcept
+
+ +

Sets the option for the VM, if the feature is supported by the VM.

+
See also
evmc_set_option_fn
+ +

Definition at line 711 of file evmc.hpp.

+
712 {
+
713 return evmc_set_option(m_instance, name, value);
+
714 }
+
char const * name() const noexcept
The name of the EVMC VM implementation.
Definition: evmc.hpp:693
+
static enum evmc_set_option_result evmc_set_option(struct evmc_vm *vm, char const *name, char const *value)
Sets the option for the VM, if the feature is supported by the VM.
Definition: helpers.h:78
+
+
+
+ +

◆ version()

+ +
+
+ + + + + +
+ + + + + + + +
char const * evmc::VM::version () const
+
+inlinenoexcept
+
+ +

The version of the EVMC VM implementation, e.g.

+

"1.2.3b4".

+

It MUST be a NULL-terminated not empty string. The content MUST be UTF-8 encoded (this implies ASCII encoding is also allowed).

+ +

Definition at line 696 of file evmc.hpp.

+
696{ return m_instance->version; }
+
const char * version
The version of the EVMC VM implementation, e.g.
Definition: evmc.h:1163
+
+
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/classevmc_1_1VM.js b/classevmc_1_1VM.js new file mode 100644 index 000000000..5bcebdaac --- /dev/null +++ b/classevmc_1_1VM.js @@ -0,0 +1,19 @@ +var classevmc_1_1VM = +[ + [ "VM", "classevmc_1_1VM.html#af5cd9f6bcaced56a086d515b4f5faf69", null ], + [ "~VM", "classevmc_1_1VM.html#a6e8e28e22d24f5d6a0c6c3a8eb1346c3", null ], + [ "VM", "classevmc_1_1VM.html#a95954b9cd734a4d78a66e18457106c77", null ], + [ "VM", "classevmc_1_1VM.html#a169703435108680a12c3ed4aeefed574", null ], + [ "execute", "classevmc_1_1VM.html#abb2e9be3ee0b6526e7fb6b04a589d224", null ], + [ "execute", "classevmc_1_1VM.html#a084118d443794cda7641421d92a9559a", null ], + [ "execute", "classevmc_1_1VM.html#a718c342e39c25e5f14ed1031a19ce494", null ], + [ "get_capabilities", "classevmc_1_1VM.html#ad08fc10da254a640703044ed7b92a814", null ], + [ "get_raw_pointer", "classevmc_1_1VM.html#ab2c7d2d9f55863c5baba06505348d7c6", null ], + [ "has_capability", "classevmc_1_1VM.html#a8ee88b1b96be2a2f47c8ecd7893b8511", null ], + [ "is_abi_compatible", "classevmc_1_1VM.html#a8cee9f8a5a406b52f2bdd99d6e534c08", null ], + [ "name", "classevmc_1_1VM.html#ab5f7c5bce52ba427093eeed24b9b7282", null ], + [ "operator bool", "classevmc_1_1VM.html#a24c7c914fff957be50c1e664357c50dd", null ], + [ "operator=", "classevmc_1_1VM.html#a2da09c30242ed78bbd724cc14d261ce8", null ], + [ "set_option", "classevmc_1_1VM.html#a3e118af16cec04356833a6ce0e9e947f", null ], + [ "version", "classevmc_1_1VM.html#acc45a833c7ae521726aaed2cc3626b5a", null ] +]; \ No newline at end of file diff --git a/closed.png b/closed.png new file mode 100644 index 000000000..98cc2c909 Binary files /dev/null and b/closed.png differ diff --git a/dir_49e56c817e5e54854c35e136979f97ca.html b/dir_49e56c817e5e54854c35e136979f97ca.html new file mode 100644 index 000000000..498e28684 --- /dev/null +++ b/dir_49e56c817e5e54854c35e136979f97ca.html @@ -0,0 +1,75 @@ + + + + + + + +EVMC: docs Directory Reference + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
docs Directory Reference
+
+
+
+
+ + + + diff --git a/dir_5298d49f5985e350bcac49a99c9a871c.html b/dir_5298d49f5985e350bcac49a99c9a871c.html new file mode 100644 index 000000000..2449c1899 --- /dev/null +++ b/dir_5298d49f5985e350bcac49a99c9a871c.html @@ -0,0 +1,102 @@ + + + + + + + +EVMC: include/evmc Directory Reference + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
evmc Directory Reference
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +

+Files

file  bytes.hpp [code]
 
file  evmc.h [code]
 
file  evmc.hpp [code]
 
file  filter_iterator.hpp [code]
 
file  helpers.h [code]
 
file  hex.hpp [code]
 
file  instructions.h [code]
 
file  loader.h [code]
 
file  mocked_host.hpp [code]
 
file  tooling.hpp [code]
 
file  utils.h [code]
 A collection of helper macros to handle some non-portable features of C/C++ compilers.
 
+
+
+ + + + diff --git a/dir_5298d49f5985e350bcac49a99c9a871c.js b/dir_5298d49f5985e350bcac49a99c9a871c.js new file mode 100644 index 000000000..e7f881942 --- /dev/null +++ b/dir_5298d49f5985e350bcac49a99c9a871c.js @@ -0,0 +1,14 @@ +var dir_5298d49f5985e350bcac49a99c9a871c = +[ + [ "bytes.hpp", "bytes_8hpp_source.html", null ], + [ "evmc.h", "evmc_8h.html", "evmc_8h" ], + [ "evmc.hpp", "evmc_8hpp.html", "evmc_8hpp" ], + [ "filter_iterator.hpp", "filter__iterator_8hpp_source.html", null ], + [ "helpers.h", "helpers_8h.html", "helpers_8h" ], + [ "hex.hpp", "hex_8hpp_source.html", null ], + [ "instructions.h", "instructions_8h.html", "instructions_8h" ], + [ "loader.h", "loader_8h.html", "loader_8h" ], + [ "mocked_host.hpp", "mocked__host_8hpp_source.html", null ], + [ "tooling.hpp", "tooling_8hpp_source.html", null ], + [ "utils.h", "utils_8h.html", "utils_8h" ] +]; \ No newline at end of file diff --git a/dir_a4c70ffacb2f8014d25282b0828660d1.html b/dir_a4c70ffacb2f8014d25282b0828660d1.html new file mode 100644 index 000000000..314265162 --- /dev/null +++ b/dir_a4c70ffacb2f8014d25282b0828660d1.html @@ -0,0 +1,82 @@ + + + + + + + +EVMC: examples/example_vm Directory Reference + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
example_vm Directory Reference
+
+
+ + + + + +

+Files

file  example_vm.cpp [code]
 Example implementation of the EVMC VM interface.
 
+
+
+ + + + diff --git a/dir_a4c70ffacb2f8014d25282b0828660d1.js b/dir_a4c70ffacb2f8014d25282b0828660d1.js new file mode 100644 index 000000000..0ce5271dc --- /dev/null +++ b/dir_a4c70ffacb2f8014d25282b0828660d1.js @@ -0,0 +1,4 @@ +var dir_a4c70ffacb2f8014d25282b0828660d1 = +[ + [ "example_vm.cpp", "example__vm_8cpp.html", "example__vm_8cpp" ] +]; \ No newline at end of file diff --git a/dir_d28a4824dc47e487b107a5db32ef43c4.html b/dir_d28a4824dc47e487b107a5db32ef43c4.html new file mode 100644 index 000000000..c8aa6b38f --- /dev/null +++ b/dir_d28a4824dc47e487b107a5db32ef43c4.html @@ -0,0 +1,81 @@ + + + + + + + +EVMC: examples Directory Reference + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
examples Directory Reference
+
+
+ + + + +

+Directories

directory  example_vm
 
+
+
+ + + + diff --git a/dir_d28a4824dc47e487b107a5db32ef43c4.js b/dir_d28a4824dc47e487b107a5db32ef43c4.js new file mode 100644 index 000000000..44753b33f --- /dev/null +++ b/dir_d28a4824dc47e487b107a5db32ef43c4.js @@ -0,0 +1,4 @@ +var dir_d28a4824dc47e487b107a5db32ef43c4 = +[ + [ "example_vm", "dir_a4c70ffacb2f8014d25282b0828660d1.html", "dir_a4c70ffacb2f8014d25282b0828660d1" ] +]; \ No newline at end of file diff --git a/dir_d44c64559bbebec7f509842c48db8b23.html b/dir_d44c64559bbebec7f509842c48db8b23.html new file mode 100644 index 000000000..06299cb6e --- /dev/null +++ b/dir_d44c64559bbebec7f509842c48db8b23.html @@ -0,0 +1,81 @@ + + + + + + + +EVMC: include Directory Reference + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
include Directory Reference
+
+
+ + + + +

+Directories

directory  evmc
 
+
+
+ + + + diff --git a/dir_d44c64559bbebec7f509842c48db8b23.js b/dir_d44c64559bbebec7f509842c48db8b23.js new file mode 100644 index 000000000..7ea6a660f --- /dev/null +++ b/dir_d44c64559bbebec7f509842c48db8b23.js @@ -0,0 +1,4 @@ +var dir_d44c64559bbebec7f509842c48db8b23 = +[ + [ "evmc", "dir_5298d49f5985e350bcac49a99c9a871c.html", "dir_5298d49f5985e350bcac49a99c9a871c" ] +]; \ No newline at end of file diff --git a/doc.png b/doc.png new file mode 100644 index 000000000..17edabff9 Binary files /dev/null and b/doc.png differ diff --git a/docd.png b/docd.png new file mode 100644 index 000000000..d7c94fda9 Binary files /dev/null and b/docd.png differ diff --git a/doxygen.css b/doxygen.css new file mode 100644 index 000000000..08cc53ab5 --- /dev/null +++ b/doxygen.css @@ -0,0 +1,2007 @@ +/* The standard CSS for doxygen 1.9.6*/ + +html { +/* page base colors */ +--page-background-color: white; +--page-foreground-color: black; +--page-link-color: #3D578C; +--page-visited-link-color: #4665A2; + +/* index */ +--index-odd-item-bg-color: #F8F9FC; +--index-even-item-bg-color: white; +--index-header-color: black; +--index-separator-color: #A0A0A0; + +/* header */ +--header-background-color: #F9FAFC; +--header-separator-color: #C4CFE5; +--header-gradient-image: url('nav_h.png'); +--group-header-separator-color: #879ECB; +--group-header-color: #354C7B; +--inherit-header-color: gray; + +--footer-foreground-color: #2A3D61; +--footer-logo-width: 104px; +--citation-label-color: #334975; +--glow-color: cyan; + +--title-background-color: white; +--title-separator-color: #5373B4; +--directory-separator-color: #9CAFD4; +--separator-color: #4A6AAA; + +--blockquote-background-color: #F7F8FB; +--blockquote-border-color: #9CAFD4; + +--scrollbar-thumb-color: #9CAFD4; +--scrollbar-background-color: #F9FAFC; + +--icon-background-color: #728DC1; +--icon-foreground-color: white; +--icon-doc-image: url('doc.png'); + +/* brief member declaration list */ +--memdecl-background-color: #F9FAFC; +--memdecl-separator-color: #DEE4F0; +--memdecl-foreground-color: #555; +--memdecl-template-color: #4665A2; + +/* detailed member list */ +--memdef-border-color: #A8B8D9; +--memdef-title-background-color: #E2E8F2; +--memdef-title-gradient-image: url('nav_f.png'); +--memdef-proto-background-color: #DFE5F1; +--memdef-proto-text-color: #253555; +--memdef-proto-text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); +--memdef-doc-background-color: white; +--memdef-param-name-color: #602020; +--memdef-template-color: #4665A2; + +/* tables */ +--table-cell-border-color: #2D4068; +--table-header-background-color: #374F7F; +--table-header-foreground-color: #FFFFFF; + +/* labels */ +--label-background-color: #728DC1; +--label-left-top-border-color: #5373B4; +--label-right-bottom-border-color: #C4CFE5; +--label-foreground-color: white; + +/** navigation bar/tree/menu */ +--nav-background-color: #F9FAFC; +--nav-foreground-color: #364D7C; +--nav-gradient-image: url('tab_b.png'); +--nav-gradient-hover-image: url('tab_h.png'); +--nav-gradient-active-image: url('tab_a.png'); +--nav-gradient-active-image-parent: url("../tab_a.png"); +--nav-separator-image: url('tab_s.png'); +--nav-breadcrumb-image: url('bc_s.png'); +--nav-breadcrumb-border-color: #C2CDE4; +--nav-splitbar-image: url('splitbar.png'); +--nav-font-size-level1: 13px; +--nav-font-size-level2: 10px; +--nav-font-size-level3: 9px; +--nav-text-normal-color: #283A5D; +--nav-text-hover-color: white; +--nav-text-active-color: white; +--nav-text-normal-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); +--nav-text-hover-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-text-active-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-menu-button-color: #364D7C; +--nav-menu-background-color: white; +--nav-menu-foreground-color: #555555; +--nav-menu-toggle-color: rgba(255, 255, 255, 0.5); +--nav-arrow-color: #9CAFD4; +--nav-arrow-selected-color: #9CAFD4; + +/* table of contents */ +--toc-background-color: #F4F6FA; +--toc-border-color: #D8DFEE; +--toc-header-color: #4665A2; + +/** search field */ +--search-background-color: white; +--search-foreground-color: #909090; +--search-magnification-image: url('mag.svg'); +--search-magnification-select-image: url('mag_sel.svg'); +--search-active-color: black; +--search-filter-background-color: #F9FAFC; +--search-filter-foreground-color: black; +--search-filter-border-color: #90A5CE; +--search-filter-highlight-text-color: white; +--search-filter-highlight-bg-color: #3D578C; +--search-results-foreground-color: #425E97; +--search-results-background-color: #EEF1F7; +--search-results-border-color: black; +--search-box-shadow: inset 0.5px 0.5px 3px 0px #555; + +/** code fragments */ +--code-keyword-color: #008000; +--code-type-keyword-color: #604020; +--code-flow-keyword-color: #E08000; +--code-comment-color: #800000; +--code-preprocessor-color: #806020; +--code-string-literal-color: #002080; +--code-char-literal-color: #008080; +--code-vhdl-digit-color: #FF00FF; +--code-vhdl-char-color: #000000; +--code-vhdl-keyword-color: #700070; +--code-vhdl-logic-color: #FF0000; +--code-link-color: #4665A2; +--code-external-link-color: #4665A2; +--fragment-foreground-color: black; +--fragment-background-color: #FBFCFD; +--fragment-border-color: #C4CFE5; +--fragment-lineno-border-color: #00FF00; +--fragment-lineno-background-color: #E8E8E8; +--fragment-lineno-foreground-color: black; +--fragment-lineno-link-fg-color: #4665A2; +--fragment-lineno-link-bg-color: #D8D8D8; +--fragment-lineno-link-hover-fg-color: #4665A2; +--fragment-lineno-link-hover-bg-color: #C8C8C8; +--tooltip-foreground-color: black; +--tooltip-background-color: white; +--tooltip-border-color: gray; +--tooltip-doc-color: grey; +--tooltip-declaration-color: #006318; +--tooltip-link-color: #4665A2; +--tooltip-shadow: 1px 1px 7px gray; + +/** font-family */ +--font-family-normal: Roboto,sans-serif; +--font-family-monospace: monospace,fixed; +--font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +--font-family-title: Tahoma,Arial,sans-serif; +--font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; +--font-family-search: Arial,Verdana,sans-serif; +--font-family-icon: Arial,Helvetica; +--font-family-tooltip: Roboto,sans-serif; + +} + +@media (prefers-color-scheme: dark) { + html:not(.dark-mode) { + color-scheme: dark; + +/* page base colors */ +--page-background-color: black; +--page-foreground-color: #C9D1D9; +--page-link-color: #90A5CE; +--page-visited-link-color: #A3B4D7; + +/* index */ +--index-odd-item-bg-color: #0B101A; +--index-even-item-bg-color: black; +--index-header-color: #C4CFE5; +--index-separator-color: #334975; + +/* header */ +--header-background-color: #070B11; +--header-separator-color: #141C2E; +--header-gradient-image: url('nav_hd.png'); +--group-header-separator-color: #283A5D; +--group-header-color: #90A5CE; +--inherit-header-color: #A0A0A0; + +--footer-foreground-color: #5B7AB7; +--footer-logo-width: 60px; +--citation-label-color: #90A5CE; +--glow-color: cyan; + +--title-background-color: #090D16; +--title-separator-color: #354C79; +--directory-separator-color: #283A5D; +--separator-color: #283A5D; + +--blockquote-background-color: #101826; +--blockquote-border-color: #283A5D; + +--scrollbar-thumb-color: #283A5D; +--scrollbar-background-color: #070B11; + +--icon-background-color: #334975; +--icon-foreground-color: #C4CFE5; +--icon-doc-image: url('docd.png'); + +/* brief member declaration list */ +--memdecl-background-color: #0B101A; +--memdecl-separator-color: #2C3F65; +--memdecl-foreground-color: #BBB; +--memdecl-template-color: #7C95C6; + +/* detailed member list */ +--memdef-border-color: #233250; +--memdef-title-background-color: #1B2840; +--memdef-title-gradient-image: url('nav_fd.png'); +--memdef-proto-background-color: #19243A; +--memdef-proto-text-color: #9DB0D4; +--memdef-proto-text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.9); +--memdef-doc-background-color: black; +--memdef-param-name-color: #D28757; +--memdef-template-color: #7C95C6; + +/* tables */ +--table-cell-border-color: #283A5D; +--table-header-background-color: #283A5D; +--table-header-foreground-color: #C4CFE5; + +/* labels */ +--label-background-color: #354C7B; +--label-left-top-border-color: #4665A2; +--label-right-bottom-border-color: #283A5D; +--label-foreground-color: #CCCCCC; + +/** navigation bar/tree/menu */ +--nav-background-color: #101826; +--nav-foreground-color: #364D7C; +--nav-gradient-image: url('tab_bd.png'); +--nav-gradient-hover-image: url('tab_hd.png'); +--nav-gradient-active-image: url('tab_ad.png'); +--nav-gradient-active-image-parent: url("../tab_ad.png"); +--nav-separator-image: url('tab_sd.png'); +--nav-breadcrumb-image: url('bc_sd.png'); +--nav-breadcrumb-border-color: #2A3D61; +--nav-splitbar-image: url('splitbard.png'); +--nav-font-size-level1: 13px; +--nav-font-size-level2: 10px; +--nav-font-size-level3: 9px; +--nav-text-normal-color: #B6C4DF; +--nav-text-hover-color: #DCE2EF; +--nav-text-active-color: #DCE2EF; +--nav-text-normal-shadow: 0px 1px 1px black; +--nav-text-hover-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-text-active-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-menu-button-color: #B6C4DF; +--nav-menu-background-color: #05070C; +--nav-menu-foreground-color: #BBBBBB; +--nav-menu-toggle-color: rgba(255, 255, 255, 0.2); +--nav-arrow-color: #334975; +--nav-arrow-selected-color: #90A5CE; + +/* table of contents */ +--toc-background-color: #151E30; +--toc-border-color: #202E4A; +--toc-header-color: #A3B4D7; + +/** search field */ +--search-background-color: black; +--search-foreground-color: #C5C5C5; +--search-magnification-image: url('mag_d.svg'); +--search-magnification-select-image: url('mag_seld.svg'); +--search-active-color: #C5C5C5; +--search-filter-background-color: #101826; +--search-filter-foreground-color: #90A5CE; +--search-filter-border-color: #7C95C6; +--search-filter-highlight-text-color: #BCC9E2; +--search-filter-highlight-bg-color: #283A5D; +--search-results-background-color: #101826; +--search-results-foreground-color: #90A5CE; +--search-results-border-color: #7C95C6; +--search-box-shadow: inset 0.5px 0.5px 3px 0px #2F436C; + +/** code fragments */ +--code-keyword-color: #CC99CD; +--code-type-keyword-color: #AB99CD; +--code-flow-keyword-color: #E08000; +--code-comment-color: #717790; +--code-preprocessor-color: #65CABE; +--code-string-literal-color: #7EC699; +--code-char-literal-color: #00E0F0; +--code-vhdl-digit-color: #FF00FF; +--code-vhdl-char-color: #000000; +--code-vhdl-keyword-color: #700070; +--code-vhdl-logic-color: #FF0000; +--code-link-color: #79C0FF; +--code-external-link-color: #79C0FF; +--fragment-foreground-color: #C9D1D9; +--fragment-background-color: black; +--fragment-border-color: #30363D; +--fragment-lineno-border-color: #30363D; +--fragment-lineno-background-color: black; +--fragment-lineno-foreground-color: #6E7681; +--fragment-lineno-link-fg-color: #6E7681; +--fragment-lineno-link-bg-color: #303030; +--fragment-lineno-link-hover-fg-color: #8E96A1; +--fragment-lineno-link-hover-bg-color: #505050; +--tooltip-foreground-color: #C9D1D9; +--tooltip-background-color: #202020; +--tooltip-border-color: #C9D1D9; +--tooltip-doc-color: #D9E1E9; +--tooltip-declaration-color: #20C348; +--tooltip-link-color: #79C0FF; +--tooltip-shadow: none; + +/** font-family */ +--font-family-normal: Roboto,sans-serif; +--font-family-monospace: monospace,fixed; +--font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +--font-family-title: Tahoma,Arial,sans-serif; +--font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; +--font-family-search: Arial,Verdana,sans-serif; +--font-family-icon: Arial,Helvetica; +--font-family-tooltip: Roboto,sans-serif; + +}} +body { + background-color: var(--page-background-color); + color: var(--page-foreground-color); +} + +body, table, div, p, dl { + font-weight: 400; + font-size: 14px; + font-family: var(--font-family-normal); + line-height: 22px; +} + +/* @group Heading Levels */ + +.title { + font-weight: 400; + font-size: 14px; + font-family: var(--font-family-normal); + line-height: 28px; + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h1.groupheader { + font-size: 150%; +} + +h2.groupheader { + border-bottom: 1px solid var(--group-header-separator-color); + color: var(--group-header-color); + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; +} + +h3.groupheader { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px var(--glow-color); +} + +dt { + font-weight: bold; +} + +p.startli, p.startdd { + margin-top: 2px; +} + +th p.starttd, th p.intertd, th p.endtd { + font-size: 100%; + font-weight: 700; +} + +p.starttd { + margin-top: 0px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +p.interli { +} + +p.interdd { +} + +p.intertd { +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.navtab { + padding-right: 15px; + text-align: right; + line-height: 110%; +} + +div.navtab table { + border-spacing: 0; +} + +td.navtab { + padding-right: 6px; + padding-left: 6px; +} + +td.navtabHL { + background-image: var(--nav-gradient-active-image); + background-repeat:repeat-x; + padding-right: 6px; + padding-left: 6px; +} + +td.navtabHL a, td.navtabHL a:visited { + color: var(--nav-text-hover-color); + text-shadow: var(--nav-text-hover-shadow); +} + +a.navtab { + font-weight: bold; +} + +div.qindex{ + text-align: center; + width: 100%; + line-height: 140%; + font-size: 130%; + color: var(--index-separator-color); +} + +dt.alphachar{ + font-size: 180%; + font-weight: bold; +} + +.alphachar a{ + color: var(--index-header-color); +} + +.alphachar a:hover, .alphachar a:visited{ + text-decoration: none; +} + +.classindex dl { + padding: 25px; + column-count:1 +} + +.classindex dd { + display:inline-block; + margin-left: 50px; + width: 90%; + line-height: 1.15em; +} + +.classindex dl.even { + background-color: var(--index-even-item-bg-color); +} + +.classindex dl.odd { + background-color: var(--index-odd-item-bg-color); +} + +@media(min-width: 1120px) { + .classindex dl { + column-count:2 + } +} + +@media(min-width: 1320px) { + .classindex dl { + column-count:3 + } +} + + +/* @group Link Styling */ + +a { + color: var(--page-link-color); + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: var(--page-visited-link-color); +} + +a:hover { + text-decoration: underline; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited, a.line, a.line:visited { + color: var(--code-link-color); +} + +a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { + color: var(--code-external-link-color); +} + +a.code.hl_class { /* style for links to class names in code snippets */ } +a.code.hl_struct { /* style for links to struct names in code snippets */ } +a.code.hl_union { /* style for links to union names in code snippets */ } +a.code.hl_interface { /* style for links to interface names in code snippets */ } +a.code.hl_protocol { /* style for links to protocol names in code snippets */ } +a.code.hl_category { /* style for links to category names in code snippets */ } +a.code.hl_exception { /* style for links to exception names in code snippets */ } +a.code.hl_service { /* style for links to service names in code snippets */ } +a.code.hl_singleton { /* style for links to singleton names in code snippets */ } +a.code.hl_concept { /* style for links to concept names in code snippets */ } +a.code.hl_namespace { /* style for links to namespace names in code snippets */ } +a.code.hl_package { /* style for links to package names in code snippets */ } +a.code.hl_define { /* style for links to macro names in code snippets */ } +a.code.hl_function { /* style for links to function names in code snippets */ } +a.code.hl_variable { /* style for links to variable names in code snippets */ } +a.code.hl_typedef { /* style for links to typedef names in code snippets */ } +a.code.hl_enumvalue { /* style for links to enum value names in code snippets */ } +a.code.hl_enumeration { /* style for links to enumeration names in code snippets */ } +a.code.hl_signal { /* style for links to Qt signal names in code snippets */ } +a.code.hl_slot { /* style for links to Qt slot names in code snippets */ } +a.code.hl_friend { /* style for links to friend names in code snippets */ } +a.code.hl_dcop { /* style for links to KDE3 DCOP names in code snippets */ } +a.code.hl_property { /* style for links to property names in code snippets */ } +a.code.hl_event { /* style for links to event names in code snippets */ } +a.code.hl_sequence { /* style for links to sequence names in code snippets */ } +a.code.hl_dictionary { /* style for links to dictionary names in code snippets */ } + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +ul { + overflow: visible; +} + +ul.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; + column-count: 3; + list-style-type: none; +} + +#side-nav ul { + overflow: visible; /* reset ul rule for scroll bar in GENERATE_TREEVIEW window */ +} + +#main-nav ul { + overflow: visible; /* reset ul rule for the navigation bar drop down lists */ +} + +.fragment { + text-align: left; + direction: ltr; + overflow-x: auto; /*Fixed: fragment lines overlap floating elements*/ + overflow-y: hidden; +} + +pre.fragment { + border: 1px solid var(--fragment-border-color); + background-color: var(--fragment-background-color); + color: var(--fragment-foreground-color); + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: var(--font-family-monospace); + font-size: 105%; +} + +div.fragment { + padding: 0 0 1px 0; /*Fixed: last line underline overlap border*/ + margin: 4px 8px 4px 2px; + color: var(--fragment-foreground-color); + background-color: var(--fragment-background-color); + border: 1px solid var(--fragment-border-color); +} + +div.line { + font-family: var(--font-family-monospace); + font-size: 13px; + min-height: 13px; + line-height: 1.0; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line:after { + content:"\000A"; + white-space: pre; +} + +div.line.glow { + background-color: var(--glow-color); + box-shadow: 0 0 10px var(--glow-color); +} + + +span.lineno { + padding-right: 4px; + margin-right: 9px; + text-align: right; + border-right: 2px solid var(--fragment-lineno-border-color); + color: var(--fragment-lineno-foreground-color); + background-color: var(--fragment-lineno-background-color); + white-space: pre; +} +span.lineno a, span.lineno a:visited { + color: var(--fragment-lineno-link-fg-color); + background-color: var(--fragment-lineno-link-bg-color); +} + +span.lineno a:hover { + color: var(--fragment-lineno-link-hover-fg-color); + background-color: var(--fragment-lineno-link-hover-bg-color); +} + +.lineno { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +div.classindex ul { + list-style: none; + padding-left: 0; +} + +div.classindex span.ai { + display: inline-block; +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + color: var(--page-foreground-color); + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} + +p.formulaDsp { + text-align: center; +} + +img.dark-mode-visible { + display: none; +} +img.light-mode-visible { + display: none; +} + +img.formulaDsp { + +} + +img.formulaInl, img.inline { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; + width: var(--footer-logo-width); +} + +.compoundTemplParams { + color: var(--memdecl-template-color); + font-size: 80%; + line-height: 120%; +} + +/* @group Code Colorization */ + +span.keyword { + color: var(--code-keyword-color); +} + +span.keywordtype { + color: var(--code-type-keyword-color); +} + +span.keywordflow { + color: var(--code-flow-keyword-color); +} + +span.comment { + color: var(--code-comment-color); +} + +span.preprocessor { + color: var(--code-preprocessor-color); +} + +span.stringliteral { + color: var(--code-string-literal-color); +} + +span.charliteral { + color: var(--code-char-literal-color); +} + +span.vhdldigit { + color: var(--code-vhdl-digit-color); +} + +span.vhdlchar { + color: var(--code-vhdl-char-color); +} + +span.vhdlkeyword { + color: var(--code-vhdl-keyword-color); +} + +span.vhdllogic { + color: var(--code-vhdl-logic-color); +} + +blockquote { + background-color: var(--blockquote-background-color); + border-left: 2px solid var(--blockquote-border-color); + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +/* @end */ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid var(--table-cell-border-color); +} + +th.dirtab { + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid var(--separator-color); +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td, .fieldtable tr { + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: var(--glow-color); + box-shadow: 0 0 15px var(--glow-color); +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: var(--memdecl-background-color); + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: var(--memdecl-foreground-color); +} + +.memSeparator { + border-bottom: 1px solid var(--memdecl-separator-color); + line-height: 1px; + margin: 0px; + padding: 0px; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight, .memTemplItemRight { + width: 100%; +} + +.memTemplParams { + color: var(--memdecl-template-color); + white-space: nowrap; + font-size: 80%; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtitle { + padding: 8px; + border-top: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); + border-top-right-radius: 4px; + border-top-left-radius: 4px; + margin-bottom: -1px; + background-image: var(--memdef-title-gradient-image); + background-repeat: repeat-x; + background-color: var(--memdef-title-background-color); + line-height: 1.25; + font-weight: 300; + float:left; +} + +.permalink +{ + font-size: 65%; + display: inline-block; + vertical-align: middle; +} + +.memtemplate { + font-size: 80%; + color: var(--memdef-template-color); + font-weight: normal; + margin-left: 9px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; + display: table !important; + width: 100%; +} + +.memitem.glow { + box-shadow: 0 0 15px var(--glow-color); +} + +.memname { + font-weight: 400; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); + padding: 6px 0px 6px 0px; + color: var(--memdef-proto-text-color); + font-weight: bold; + text-shadow: var(--memdef-proto-text-shadow); + background-color: var(--memdef-proto-background-color); + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; +} + +.overload { + font-family: var(--font-family-monospace); + font-size: 65%; +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); + padding: 6px 10px 2px 10px; + border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: var(--memdef-doc-background-color); + /* opera specific markup */ + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: var(--memdef-param-name-color); + white-space: nowrap; +} +.paramname em { + font-style: normal; +} +.paramname code { + line-height: 14px; +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname, .tparams .paramname, .exception .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype, .tparams .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir, .tparams .paramdir { + font-family: var(--font-family-monospace); + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: var(--label-background-color); + border-top:1px solid var(--label-left-top-border-color); + border-left:1px solid var(--label-left-top-border-color); + border-right:1px solid var(--label-right-bottom-border-color); + border-bottom:1px solid var(--label-right-bottom-border-color); + text-shadow: none; + color: var(--label-foreground-color); + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; + vertical-align: middle; +} + + + +/* @end */ + +/* these are for tree view inside a (index) page */ + +div.directory { + margin: 10px 0px; + border-top: 1px solid var(--directory-separator-color); + border-bottom: 1px solid var(--directory-separator-color); + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; + padding-top: 3px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.odd { + padding-left: 6px; + background-color: var(--index-odd-item-bg-color); +} + +.directory tr.even { + padding-left: 6px; + background-color: var(--index-even-item-bg-color); +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: var(--page-link-color); +} + +.arrow { + color: var(--nav-arrow-color); + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + font-size: 80%; + display: inline-block; + width: 16px; + height: 22px; +} + +.icon { + font-family: var(--font-family-icon); + line-height: normal; + font-weight: bold; + font-size: 12px; + height: 14px; + width: 16px; + display: inline-block; + background-color: var(--icon-background-color); + color: var(--icon-foreground-color); + text-align: center; + border-radius: 4px; + margin-left: 2px; + margin-right: 2px; +} + +.icona { + width: 24px; + height: 22px; + display: inline-block; +} + +.iconfopen { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderopen.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.iconfclosed { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderclosed.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.icondoc { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:var(--icon-doc-image); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +address { + font-style: normal; + color: var(--footer-foreground-color); +} + +table.doxtable caption { + caption-side: top; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid var(--table-cell-border-color); + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + margin-bottom: 10px; + border: 1px solid var(--memdef-border-color); + border-spacing: 0px; + border-radius: 4px; + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid var(--memdef-border-color); + border-bottom: 1px solid var(--memdef-border-color); + vertical-align: top; +} + +.fieldtable td.fieldname { + padding-top: 3px; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid var(--memdef-border-color); +} + +.fieldtable td.fielddoc p:first-child { + margin-top: 0px; +} + +.fieldtable td.fielddoc p:last-child { + margin-bottom: 2px; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image: var(--memdef-title-gradient-image); + background-repeat:repeat-x; + background-color: var(--memdef-title-background-color); + font-size: 90%; + color: var(--memdef-proto-text-color); + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + font-weight: 400; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid var(--memdef-border-color); +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: var(--nav-gradient-image); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image: var(--nav-gradient-image); + background-repeat:repeat-x; + background-position: 0 -5px; + height:30px; + line-height:30px; + color:var(--nav-text-normal-color); + border:solid 1px var(--nav-breadcrumb-border-color); + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:var(--nav-breadcrumb-image); + background-repeat:no-repeat; + background-position:right; + color: var(--nav-foreground-color); +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; + color: var(--nav-text-normal-color); + font-family: var(--font-family-nav); + text-shadow: var(--nav-text-normal-shadow); + text-decoration: none; +} + +.navpath li.navelem a:hover +{ + color: var(--nav-text-hover-color); + text-shadow: var(--nav-text-hover-shadow); +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color: var(--footer-foreground-color); + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +table.classindex +{ + margin: 10px; + white-space: nowrap; + margin-left: 3%; + margin-right: 3%; + width: 94%; + border: 0; + border-spacing: 0; + padding: 0; +} + +div.ingroups +{ + font-size: 8pt; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image: var(--header-gradient-image); + background-repeat:repeat-x; + background-color: var(--header-background-color); + margin: 0px; + border-bottom: 1px solid var(--header-separator-color); +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +.PageDocRTL-title div.headertitle { + text-align: right; + direction: rtl; +} + +dl { + padding: 0 0 0 0; +} + +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug, dl.examples */ +dl.section { + margin-left: 0px; + padding-left: 0px; +} + +dl.note { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #D0C000; +} + +dl.warning, dl.attention { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00D000; +} + +dl.deprecated { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #505050; +} + +dl.todo { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00C0E0; +} + +dl.test { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #3030E0; +} + +dl.bug { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #C08050; +} + +dl.section dd { + margin-bottom: 6px; +} + + +#projectrow +{ + height: 56px; +} + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectalign +{ + vertical-align: middle; + padding-left: 0.5em; +} + +#projectname +{ + font-size: 200%; + font-family: var(--font-family-title); + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font-size: 90%; + font-family: var(--font-family-title); + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font-size: 50%; + font-family: 50% var(--font-family-title); + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid var(--title-separator-color); + background-color: var(--title-background-color); +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.plantumlgraph +{ + text-align: center; +} + +.diagraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:var(--citation-label-color); + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; + text-align:right; + width:52px; +} + +dl.citelist dd { + margin:2px 0 2px 72px; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: var(--toc-background-color); + border: 1px solid var(--toc-border-color); + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 8px 10px 10px; + width: 200px; +} + +div.toc li { + background: url("bdwn.png") no-repeat scroll 0 5px transparent; + font: 10px/1.2 var(--font-family-toc); + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +div.toc h3 { + font: bold 12px/1.2 var(--font-family-toc); + color: var(--toc-header-color); + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.level2 { + margin-left: 15px; +} + +div.toc li.level3 { + margin-left: 30px; +} + +div.toc li.level4 { + margin-left: 45px; +} + +span.emoji { + /* font family used at the site: https://unicode.org/emoji/charts/full-emoji-list.html + * font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", Times, Symbola, Aegyptus, Code2000, Code2001, Code2002, Musica, serif, LastResort; + */ +} + +span.obfuscator { + display: none; +} + +.inherit_header { + font-weight: bold; + color: var(--inherit-header-color); + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +/* tooltip related style info */ + +.ttc { + position: absolute; + display: none; +} + +#powerTip { + cursor: default; + /*white-space: nowrap;*/ + color: var(--tooltip-foreground-color); + background-color: var(--tooltip-background-color); + border: 1px solid var(--tooltip-border-color); + border-radius: 4px 4px 4px 4px; + box-shadow: var(--tooltip-shadow); + display: none; + font-size: smaller; + max-width: 80%; + opacity: 0.9; + padding: 1ex 1em 1em; + position: absolute; + z-index: 2147483647; +} + +#powerTip div.ttdoc { + color: var(--tooltip-doc-color); + font-style: italic; +} + +#powerTip div.ttname a { + font-weight: bold; +} + +#powerTip a { + color: var(--tooltip-link-color); +} + +#powerTip div.ttname { + font-weight: bold; +} + +#powerTip div.ttdeci { + color: var(--tooltip-declaration-color); +} + +#powerTip div { + margin: 0px; + padding: 0px; + font-size: 12px; + font-family: var(--font-family-tooltip); + line-height: 16px; +} + +#powerTip:before, #powerTip:after { + content: ""; + position: absolute; + margin: 0px; +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.s:after, #powerTip.s:before, +#powerTip.w:after, #powerTip.w:before, +#powerTip.e:after, #powerTip.e:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.nw:after, #powerTip.nw:before, +#powerTip.sw:after, #powerTip.sw:before { + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; +} + +#powerTip.n:after, #powerTip.s:after, +#powerTip.w:after, #powerTip.e:after, +#powerTip.nw:after, #powerTip.ne:after, +#powerTip.sw:after, #powerTip.se:after { + border-color: rgba(255, 255, 255, 0); +} + +#powerTip.n:before, #powerTip.s:before, +#powerTip.w:before, #powerTip.e:before, +#powerTip.nw:before, #powerTip.ne:before, +#powerTip.sw:before, #powerTip.se:before { + border-color: rgba(128, 128, 128, 0); +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.nw:after, #powerTip.nw:before { + top: 100%; +} + +#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { + border-top-color: var(--tooltip-background-color); + border-width: 10px; + margin: 0px -10px; +} +#powerTip.n:before, #powerTip.ne:before, #powerTip.nw:before { + border-top-color: var(--tooltip-border-color); + border-width: 11px; + margin: 0px -11px; +} +#powerTip.n:after, #powerTip.n:before { + left: 50%; +} + +#powerTip.nw:after, #powerTip.nw:before { + right: 14px; +} + +#powerTip.ne:after, #powerTip.ne:before { + left: 14px; +} + +#powerTip.s:after, #powerTip.s:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.sw:after, #powerTip.sw:before { + bottom: 100%; +} + +#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { + border-bottom-color: var(--tooltip-background-color); + border-width: 10px; + margin: 0px -10px; +} + +#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { + border-bottom-color: var(--tooltip-border-color); + border-width: 11px; + margin: 0px -11px; +} + +#powerTip.s:after, #powerTip.s:before { + left: 50%; +} + +#powerTip.sw:after, #powerTip.sw:before { + right: 14px; +} + +#powerTip.se:after, #powerTip.se:before { + left: 14px; +} + +#powerTip.e:after, #powerTip.e:before { + left: 100%; +} +#powerTip.e:after { + border-left-color: var(--tooltip-border-color); + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.e:before { + border-left-color: var(--tooltip-border-color); + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +#powerTip.w:after, #powerTip.w:before { + right: 100%; +} +#powerTip.w:after { + border-right-color: var(--tooltip-border-color); + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.w:before { + border-right-color: var(--tooltip-border-color); + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + +/* @group Markdown */ + +table.markdownTable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.markdownTable td, table.markdownTable th { + border: 1px solid var(--table-cell-border-color); + padding: 3px 7px 2px; +} + +table.markdownTable tr { +} + +th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +th.markdownTableHeadLeft, td.markdownTableBodyLeft { + text-align: left +} + +th.markdownTableHeadRight, td.markdownTableBodyRight { + text-align: right +} + +th.markdownTableHeadCenter, td.markdownTableBodyCenter { + text-align: center +} + +tt, code, kbd, samp +{ + display: inline-block; +} +/* @end */ + +u { + text-decoration: underline; +} + +details>summary { + list-style-type: none; +} + +details > summary::-webkit-details-marker { + display: none; +} + +details>summary::before { + content: "\25ba"; + padding-right:4px; + font-size: 80%; +} + +details[open]>summary::before { + content: "\25bc"; + padding-right:4px; + font-size: 80%; +} + +body { + scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-background-color); +} + +::-webkit-scrollbar { + background-color: var(--scrollbar-background-color); + height: 12px; + width: 12px; +} +::-webkit-scrollbar-thumb { + border-radius: 6px; + box-shadow: inset 0 0 12px 12px var(--scrollbar-thumb-color); + border: solid 2px transparent; +} +::-webkit-scrollbar-corner { + background-color: var(--scrollbar-background-color); +} + diff --git a/doxygen.svg b/doxygen.svg new file mode 100644 index 000000000..d42dad52d --- /dev/null +++ b/doxygen.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dynsections.js b/dynsections.js new file mode 100644 index 000000000..1f4cd14a6 --- /dev/null +++ b/dynsections.js @@ -0,0 +1,130 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +function toggleVisibility(linkObj) +{ + var base = $(linkObj).attr('id'); + var summary = $('#'+base+'-summary'); + var content = $('#'+base+'-content'); + var trigger = $('#'+base+'-trigger'); + var src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; +} + +function updateStripes() +{ + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); + $('table.directory tr'). + removeClass('odd').filter(':visible:odd').addClass('odd'); +} + +function toggleLevel(level) +{ + $('table.directory tr').each(function() { + var l = this.id.split('_').length-1; + var i = $('#img'+this.id.substring(3)); + var a = $('#arr'+this.id.substring(3)); + if (l + + + + + + +EVMC: include/evmc/evmc.h File Reference + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ +
evmc.h File Reference
+
+
+
#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+
+

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Classes

struct  evmc_bytes32
 The fixed size array of 32 bytes. More...
 
struct  evmc_address
 Big-endian 160-bit hash suitable for keeping an Ethereum address. More...
 
struct  evmc_message
 The message describing an EVM call, including a zero-depth calls from a transaction origin. More...
 
struct  evmc_tx_initcode
 The hashed initcode used for TXCREATE instruction. More...
 
struct  evmc_tx_context
 The transaction and block data for execution. More...
 
struct  evmc_result
 The EVM code execution result. More...
 
struct  evmc_host_interface
 The Host interface. More...
 
struct  evmc_vm
 The VM instance. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Typedefs

typedef struct evmc_bytes32 evmc_bytes32
 The fixed size array of 32 bytes.
 
typedef struct evmc_bytes32 evmc_uint256be
 The alias for evmc_bytes32 to represent a big-endian 256-bit integer.
 
+typedef struct evmc_address evmc_address
 Big-endian 160-bit hash suitable for keeping an Ethereum address.
 
+typedef struct evmc_tx_initcode evmc_tx_initcode
 The hashed initcode used for TXCREATE instruction.
 
typedef struct evmc_tx_context(* evmc_get_tx_context_fn) (struct evmc_host_context *context)
 Get transaction context callback function.
 
typedef evmc_bytes32(* evmc_get_block_hash_fn) (struct evmc_host_context *context, int64_t number)
 Get block hash callback function.
 
typedef void(* evmc_release_result_fn) (const struct evmc_result *result)
 Releases resources assigned to an execution result.
 
typedef bool(* evmc_account_exists_fn) (struct evmc_host_context *context, const evmc_address *address)
 Check account existence callback function.
 
typedef evmc_bytes32(* evmc_get_storage_fn) (struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key)
 Get storage callback function.
 
typedef evmc_bytes32(* evmc_get_transient_storage_fn) (struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key)
 Get transient storage callback function.
 
typedef enum evmc_storage_status(* evmc_set_storage_fn) (struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key, const evmc_bytes32 *value)
 Set storage callback function.
 
typedef void(* evmc_set_transient_storage_fn) (struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key, const evmc_bytes32 *value)
 Set transient storage callback function.
 
typedef evmc_uint256be(* evmc_get_balance_fn) (struct evmc_host_context *context, const evmc_address *address)
 Get balance callback function.
 
typedef size_t(* evmc_get_code_size_fn) (struct evmc_host_context *context, const evmc_address *address)
 Get code size callback function.
 
typedef evmc_bytes32(* evmc_get_code_hash_fn) (struct evmc_host_context *context, const evmc_address *address)
 Get code hash callback function.
 
typedef size_t(* evmc_copy_code_fn) (struct evmc_host_context *context, const evmc_address *address, size_t code_offset, uint8_t *buffer_data, size_t buffer_size)
 Copy code callback function.
 
typedef bool(* evmc_selfdestruct_fn) (struct evmc_host_context *context, const evmc_address *address, const evmc_address *beneficiary)
 Selfdestruct callback function.
 
typedef void(* evmc_emit_log_fn) (struct evmc_host_context *context, const evmc_address *address, const uint8_t *data, size_t data_size, const evmc_bytes32 topics[], size_t topics_count)
 Log callback function.
 
typedef enum evmc_access_status(* evmc_access_account_fn) (struct evmc_host_context *context, const evmc_address *address)
 Access account callback function.
 
typedef enum evmc_access_status(* evmc_access_storage_fn) (struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key)
 Access storage callback function.
 
typedef struct evmc_result(* evmc_call_fn) (struct evmc_host_context *context, const struct evmc_message *msg)
 Pointer to the callback function supporting EVM calls.
 
typedef void(* evmc_destroy_fn) (struct evmc_vm *vm)
 Destroys the VM instance.
 
typedef enum evmc_set_option_result(* evmc_set_option_fn) (struct evmc_vm *vm, char const *name, char const *value)
 Configures the VM instance.
 
typedef struct evmc_result(* evmc_execute_fn) (struct evmc_vm *vm, const struct evmc_host_interface *host, struct evmc_host_context *context, enum evmc_revision rev, const struct evmc_message *msg, uint8_t const *code, size_t code_size)
 Executes the given code using the input from the message.
 
typedef uint32_t evmc_capabilities_flagset
 Alias for unsigned integer representing a set of bit flags of EVMC capabilities.
 
typedef evmc_capabilities_flagset(* evmc_get_capabilities_fn) (struct evmc_vm *vm)
 Return the supported capabilities of the VM instance.
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Enumerations

enum  { EVMC_ABI_VERSION = 12 + }
 
enum  evmc_call_kind {
+  EVMC_CALL = 0 +, EVMC_DELEGATECALL = 1 +, EVMC_CALLCODE = 2 +, EVMC_CREATE = 3 +,
+  EVMC_CREATE2 = 4 +, EVMC_EOFCREATE = 5 +
+ }
 The kind of call-like instruction. More...
 
enum  evmc_flags { EVMC_STATIC = 1 + }
 The flags for evmc_message. More...
 
enum  evmc_status_code {
+  EVMC_SUCCESS = 0 +, EVMC_FAILURE = 1 +, EVMC_REVERT = 2 +, EVMC_OUT_OF_GAS = 3 +,
+  EVMC_INVALID_INSTRUCTION = 4 +, EVMC_UNDEFINED_INSTRUCTION = 5 +, EVMC_STACK_OVERFLOW = 6 +, EVMC_STACK_UNDERFLOW = 7 +,
+  EVMC_BAD_JUMP_DESTINATION = 8 +, EVMC_INVALID_MEMORY_ACCESS = 9 +, EVMC_CALL_DEPTH_EXCEEDED = 10 +, EVMC_STATIC_MODE_VIOLATION = 11 +,
+  EVMC_PRECOMPILE_FAILURE = 12 +, EVMC_CONTRACT_VALIDATION_FAILURE = 13 +, EVMC_ARGUMENT_OUT_OF_RANGE = 14 +, EVMC_WASM_UNREACHABLE_INSTRUCTION = 15 +,
+  EVMC_WASM_TRAP = 16 +, EVMC_INSUFFICIENT_BALANCE = 17 +, EVMC_INTERNAL_ERROR = -1 +, EVMC_REJECTED = -2 +,
+  EVMC_OUT_OF_MEMORY = -3 +
+ }
 The execution status code. More...
 
enum  evmc_storage_status {
+  EVMC_STORAGE_ASSIGNED = 0 +, EVMC_STORAGE_ADDED = 1 +, EVMC_STORAGE_DELETED = 2 +, EVMC_STORAGE_MODIFIED = 3 +,
+  EVMC_STORAGE_DELETED_ADDED = 4 +, EVMC_STORAGE_MODIFIED_DELETED = 5 +, EVMC_STORAGE_DELETED_RESTORED = 6 +, EVMC_STORAGE_ADDED_DELETED = 7 +,
+  EVMC_STORAGE_MODIFIED_RESTORED = 8 +
+ }
 The effect of an attempt to modify a contract storage item. More...
 
enum  evmc_access_status { EVMC_ACCESS_COLD = 0 +, EVMC_ACCESS_WARM = 1 + }
 Access status per EIP-2929: Gas cost increases for state access opcodes. More...
 
enum  evmc_set_option_result { EVMC_SET_OPTION_SUCCESS = 0 +, EVMC_SET_OPTION_INVALID_NAME = 1 +, EVMC_SET_OPTION_INVALID_VALUE = 2 + }
 Possible outcomes of evmc_set_option. More...
 
enum  evmc_revision {
+  EVMC_FRONTIER = 0 +, EVMC_HOMESTEAD = 1 +, EVMC_TANGERINE_WHISTLE = 2 +, EVMC_SPURIOUS_DRAGON = 3 +,
+  EVMC_BYZANTIUM = 4 +, EVMC_CONSTANTINOPLE = 5 +, EVMC_PETERSBURG = 6 +, EVMC_ISTANBUL = 7 +,
+  EVMC_BERLIN = 8 +, EVMC_LONDON = 9 +, EVMC_PARIS = 10 +, EVMC_SHANGHAI = 11 +,
+  EVMC_CANCUN = 12 +, EVMC_PRAGUE = 13 +, EVMC_OSAKA = 14 +, EVMC_MAX_REVISION = EVMC_OSAKA +,
+  EVMC_LATEST_STABLE_REVISION = EVMC_CANCUN +
+ }
 EVM revision. More...
 
enum  evmc_capabilities { EVMC_CAPABILITY_EVM1 = (1u << 0) +, EVMC_CAPABILITY_EWASM = (1u << 1) +, EVMC_CAPABILITY_PRECOMPILES = (1u << 2) + }
 Possible capabilities of a VM. More...
 
+ + + + +

+Functions

struct evmc_vmevmc_create_example_vm (void)
 Example of a function creating an instance of an example EVM implementation.
 
+

Detailed Description

+

EVMC: Ethereum Client-VM Connector API.

+ +

+Terms

+
    +
  1. VM – An Ethereum Virtual Machine instance/implementation.
  2. +
  3. Host – An entity controlling the VM. The Host requests code execution and responses to VM queries by callback functions. This usually represents an Ethereum Client.
  4. +
+

+Responsibilities

+

+VM

+
    +
  • Executes the code (obviously).
  • +
  • Calculates the running gas cost and manages the gas counter except the refund counter.
  • +
  • Controls the call depth, including the exceptional termination of execution in case the maximum depth is reached.
  • +
+

+Host

+
    +
  • Provides access to State.
  • +
  • Creates new accounts (with code being a result of VM execution).
  • +
  • Handles refunds entirely.
  • +
  • Manages the set of precompiled contracts and handles execution of messages coming to them.
  • +
+ +

Definition in file evmc.h.

+
+
+ + + + diff --git a/evmc_8h.js b/evmc_8h.js new file mode 100644 index 000000000..d261a107b --- /dev/null +++ b/evmc_8h.js @@ -0,0 +1,108 @@ +var evmc_8h = +[ + [ "evmc_access_account_fn", "group__EVMC.html#ga8eb6233115c660f8d779eb9b132e93c5", null ], + [ "evmc_access_storage_fn", "group__EVMC.html#gac33551d757c3762e4cc3dd9bdfeee356", null ], + [ "evmc_account_exists_fn", "group__EVMC.html#ga4c5464305402bf2a10d94bf2d828d82b", null ], + [ "evmc_address", "group__EVMC.html#ga0a566da7d9e3c337abf4ef4045d8f5c5", null ], + [ "evmc_bytes32", "group__EVMC.html#gab19677b7977fc98a8d1182256486c8e9", null ], + [ "evmc_call_fn", "group__EVMC.html#ga54f569386b52be6eee15ca9e14ed1ef8", null ], + [ "evmc_capabilities_flagset", "group__EVMC.html#ga714bc8ca946adc759403fe072bdd2aa0", null ], + [ "evmc_copy_code_fn", "group__EVMC.html#ga7dc696d1491951200ac5dc4f852a4499", null ], + [ "evmc_destroy_fn", "group__EVMC.html#ga1f54475fc7dc20a0c4d370272e39d755", null ], + [ "evmc_emit_log_fn", "group__EVMC.html#gaab96621b67d653758b3da15c2b596938", null ], + [ "evmc_execute_fn", "group__EVMC.html#gaed9a4ab5609b55c5e3272d6d37d84ff7", null ], + [ "evmc_get_balance_fn", "group__EVMC.html#ga5208ee08734b69bb0a28793f0ecfbc48", null ], + [ "evmc_get_block_hash_fn", "group__EVMC.html#ga97c2981658d797d3031720a54740a4b3", null ], + [ "evmc_get_capabilities_fn", "group__EVMC.html#ga9bac25459c5a09d42606e7bd9320445c", null ], + [ "evmc_get_code_hash_fn", "group__EVMC.html#ga7971754ea6e237ffb9e9b7ab102fa16e", null ], + [ "evmc_get_code_size_fn", "group__EVMC.html#ga38e37a3a70dec828829cccb461e99de2", null ], + [ "evmc_get_storage_fn", "group__EVMC.html#ga7aff77bf67e8fad5819807b8aafff7cb", null ], + [ "evmc_get_transient_storage_fn", "group__EVMC.html#gaf9d05d52083ede06470147205d695224", null ], + [ "evmc_get_tx_context_fn", "group__EVMC.html#ga7b403c029b5b9ad627ffafb8c41ac84b", null ], + [ "evmc_release_result_fn", "group__EVMC.html#ga297c7c7ca966c82296a54683143157b1", null ], + [ "evmc_selfdestruct_fn", "group__EVMC.html#ga1aa9fa657b3f0de375e2f07e53b65bcc", null ], + [ "evmc_set_option_fn", "group__EVMC.html#ga5531cee5b83d76c71b06475454f4633b", null ], + [ "evmc_set_storage_fn", "group__EVMC.html#gaf7481ac7c3f1071d5d4d8256d0687e83", null ], + [ "evmc_set_transient_storage_fn", "group__EVMC.html#gae1980210d9b43a72f8aae55a8577d9cd", null ], + [ "evmc_tx_initcode", "group__EVMC.html#ga33f5d46f46db823948037dd4365de859", null ], + [ "evmc_uint256be", "group__EVMC.html#ga260738d59f9a23d039dc7a290e0c0a3b", null ], + [ "evmc_access_status", "group__EVMC.html#ga9f71195f3873f9979d81d7a5e1b3aaf0", [ + [ "EVMC_ACCESS_COLD", "group__EVMC.html#gga9f71195f3873f9979d81d7a5e1b3aaf0a3a719b69a4c3f9d6b9913b47312b5a76", null ], + [ "EVMC_ACCESS_WARM", "group__EVMC.html#gga9f71195f3873f9979d81d7a5e1b3aaf0a584ba0f1ab5c1e5e8a126fdcdde5d994", null ] + ] ], + [ "evmc_call_kind", "group__EVMC.html#gab2fa68a92a6828064a61e46060abc634", [ + [ "EVMC_CALL", "group__EVMC.html#ggab2fa68a92a6828064a61e46060abc634abcf3ae29d9a88ff70b98374fc665694a", null ], + [ "EVMC_DELEGATECALL", "group__EVMC.html#ggab2fa68a92a6828064a61e46060abc634a6face22070bace91b429297e88d3ab1a", null ], + [ "EVMC_CALLCODE", "group__EVMC.html#ggab2fa68a92a6828064a61e46060abc634ae9c5b431a0c823f368341c9f026642ef", null ], + [ "EVMC_CREATE", "group__EVMC.html#ggab2fa68a92a6828064a61e46060abc634a1d15450429f540677caea05143344d33", null ], + [ "EVMC_CREATE2", "group__EVMC.html#ggab2fa68a92a6828064a61e46060abc634a9ec7e0da8dde8e9bc420d806c621b418", null ], + [ "EVMC_EOFCREATE", "group__EVMC.html#ggab2fa68a92a6828064a61e46060abc634a35e57b99b5f6f11af16846c31a15dacc", null ] + ] ], + [ "evmc_capabilities", "group__EVMC.html#ga44f9ecb88cf6422a0072936494fd6ac7", [ + [ "EVMC_CAPABILITY_EVM1", "group__EVMC.html#gga44f9ecb88cf6422a0072936494fd6ac7a36fd3cfe936b9525eed7f88a7b43a2a8", null ], + [ "EVMC_CAPABILITY_EWASM", "group__EVMC.html#gga44f9ecb88cf6422a0072936494fd6ac7af1240f950b5b9ca4369bcac424443e54", null ], + [ "EVMC_CAPABILITY_PRECOMPILES", "group__EVMC.html#gga44f9ecb88cf6422a0072936494fd6ac7a43ea2aa7b099a2d67bc53c118ff3683d", null ] + ] ], + [ "evmc_flags", "group__EVMC.html#ga187a3a658849da19a0c4e8f7b51fa70d", [ + [ "EVMC_STATIC", "group__EVMC.html#gga187a3a658849da19a0c4e8f7b51fa70da1d8bef8b2bd39a6bd1936e87b18e95bf", null ] + ] ], + [ "evmc_revision", "group__EVMC.html#gae5759b1590071966ccf6a505b52a0ef7", [ + [ "EVMC_FRONTIER", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a622480509359764aa2a258b074812a5f", null ], + [ "EVMC_HOMESTEAD", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a04f0bf686d2b1c50612f9a96480f70a9", null ], + [ "EVMC_TANGERINE_WHISTLE", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a8305858ab32b80a6eced7bf177d6dee2", null ], + [ "EVMC_SPURIOUS_DRAGON", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7abbbcae1af73ad1efc570b40bb0363879", null ], + [ "EVMC_BYZANTIUM", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7ac4b0c9cfb5d408f17255a15e26938ea6", null ], + [ "EVMC_CONSTANTINOPLE", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a7a2ed5cf3d25c8c4a68691721bb969fc", null ], + [ "EVMC_PETERSBURG", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a6d913d4917e87b1fc798b450735acdeb", null ], + [ "EVMC_ISTANBUL", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a5f0e287935fd0afd65afea34b51dcf8c", null ], + [ "EVMC_BERLIN", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7af53e0cb0d793d60b5fb07c6b4c3c6ab7", null ], + [ "EVMC_LONDON", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7acfe86739fa2a0882d49cf19a94d8ee09", null ], + [ "EVMC_PARIS", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7adaa40f0a556842b0339aedc61ec332f7", null ], + [ "EVMC_SHANGHAI", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7ac79d6325f9e74fd00a6b98eaea3e30a5", null ], + [ "EVMC_CANCUN", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7ac503f2602c39827e09476616ac785a21", null ], + [ "EVMC_PRAGUE", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a23a210788296b4a859585a4cac639cf3", null ], + [ "EVMC_OSAKA", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a04e6977f757a1a3e7a64c041fff1b63a", null ], + [ "EVMC_MAX_REVISION", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a8b67f41f15bc079b8ad40dcd7156f576", null ], + [ "EVMC_LATEST_STABLE_REVISION", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a0dd8bdd55816359290e8fb8648aeb03e", null ] + ] ], + [ "evmc_set_option_result", "group__EVMC.html#ga28d9f527bda67277bccccc100e32260a", [ + [ "EVMC_SET_OPTION_SUCCESS", "group__EVMC.html#gga28d9f527bda67277bccccc100e32260aa4e458cfd9a8d5da0ed5e93a3d3ad5d3b", null ], + [ "EVMC_SET_OPTION_INVALID_NAME", "group__EVMC.html#gga28d9f527bda67277bccccc100e32260aa462712eea718b1a9088aaaf995bcb80e", null ], + [ "EVMC_SET_OPTION_INVALID_VALUE", "group__EVMC.html#gga28d9f527bda67277bccccc100e32260aa7be8628edb4ac9b2d195894f112d0924", null ] + ] ], + [ "evmc_status_code", "group__EVMC.html#ga4c0be97f333c050ff45321fcaa34d920", [ + [ "EVMC_SUCCESS", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a4bc3069fec2bab2a55355a72b7db68b7", null ], + [ "EVMC_FAILURE", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920aed5b2a4afa5a47af732569445920a4a9", null ], + [ "EVMC_REVERT", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920aed708e84d49cc1270e54ec20b0ca0a05", null ], + [ "EVMC_OUT_OF_GAS", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920abfc47f75656c996c0b29c0553c00fc18", null ], + [ "EVMC_INVALID_INSTRUCTION", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a8ea4f35a269f5fd3a722f2054c993637", null ], + [ "EVMC_UNDEFINED_INSTRUCTION", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a443084a263a2325f1e4c629e97685367", null ], + [ "EVMC_STACK_OVERFLOW", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920ae1a613949fe1c994a36488b0bc4c86c4", null ], + [ "EVMC_STACK_UNDERFLOW", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a640106fdec78d04a1098c512898d4efc", null ], + [ "EVMC_BAD_JUMP_DESTINATION", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a6acf000dfa802a949063a87046f4bb26", null ], + [ "EVMC_INVALID_MEMORY_ACCESS", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a2981ec30896486ac69bab7c0a1be591b", null ], + [ "EVMC_CALL_DEPTH_EXCEEDED", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920ac139d631ff852379d566c8a60f86ddc0", null ], + [ "EVMC_STATIC_MODE_VIOLATION", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a92ccaaeb3fd1ee5aa1ad022678c13bac", null ], + [ "EVMC_PRECOMPILE_FAILURE", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920ab960d50047f87925e540bee6230aafb7", null ], + [ "EVMC_CONTRACT_VALIDATION_FAILURE", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920ac0e1bf525f51da5b3d34d4f67ca549e1", null ], + [ "EVMC_ARGUMENT_OUT_OF_RANGE", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a1cc537c5875de1b42aa5d556f33223d8", null ], + [ "EVMC_WASM_UNREACHABLE_INSTRUCTION", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920ac99fbd9645011663df070ae3c367eb4e", null ], + [ "EVMC_WASM_TRAP", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920aaf0c6c7a736ec498bd390884f143e57b", null ], + [ "EVMC_INSUFFICIENT_BALANCE", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a12f7061f20d077ce0d14ca86b2d5975d", null ], + [ "EVMC_INTERNAL_ERROR", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920abb1dcac202eac2ed8fd3025645a2fb28", null ], + [ "EVMC_REJECTED", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a2f3e0d8777f8d974ead27ae2a6eb2005", null ], + [ "EVMC_OUT_OF_MEMORY", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a63aa9b3ac3af61c39c20562509347b86", null ] + ] ], + [ "evmc_storage_status", "group__EVMC.html#gae012fd6b8e5c23806b507c2d3e9fb1aa", [ + [ "EVMC_STORAGE_ASSIGNED", "group__EVMC.html#ggae012fd6b8e5c23806b507c2d3e9fb1aaad073aa65057b9bc304b9e723e6b7cfaa", null ], + [ "EVMC_STORAGE_ADDED", "group__EVMC.html#ggae012fd6b8e5c23806b507c2d3e9fb1aaa8afd1741edf799d44264654d9f04a5a9", null ], + [ "EVMC_STORAGE_DELETED", "group__EVMC.html#ggae012fd6b8e5c23806b507c2d3e9fb1aaae5b6ea5ec988f3b3ceb323ce3c0fa53f", null ], + [ "EVMC_STORAGE_MODIFIED", "group__EVMC.html#ggae012fd6b8e5c23806b507c2d3e9fb1aaaf102ce749767d5277923c221089da2c6", null ], + [ "EVMC_STORAGE_DELETED_ADDED", "group__EVMC.html#ggae012fd6b8e5c23806b507c2d3e9fb1aaaecee2e651cdfa14f1686903b10796b8a", null ], + [ "EVMC_STORAGE_MODIFIED_DELETED", "group__EVMC.html#ggae012fd6b8e5c23806b507c2d3e9fb1aaa9def8aed9b4498385904ea37fad8a228", null ], + [ "EVMC_STORAGE_DELETED_RESTORED", "group__EVMC.html#ggae012fd6b8e5c23806b507c2d3e9fb1aaa88a893f304c7d0c0bbf6c82254544e28", null ], + [ "EVMC_STORAGE_ADDED_DELETED", "group__EVMC.html#ggae012fd6b8e5c23806b507c2d3e9fb1aaa095d061ef441491e494b124582bd1e2e", null ], + [ "EVMC_STORAGE_MODIFIED_RESTORED", "group__EVMC.html#ggae012fd6b8e5c23806b507c2d3e9fb1aaa7dddf323f6fe21b15dfec07740e8038e", null ] + ] ], + [ "evmc_create_example_vm", "group__EVMC.html#ga4ba5aae5d0250d9c4f6987a78602e795", null ] +]; \ No newline at end of file diff --git a/evmc_8h_source.html b/evmc_8h_source.html new file mode 100644 index 000000000..0f22a2db1 --- /dev/null +++ b/evmc_8h_source.html @@ -0,0 +1,651 @@ + + + + + + + +EVMC: include/evmc/evmc.h Source File + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
evmc.h
+
+
+Go to the documentation of this file.
1
+
11#ifndef EVMC_H
+
12#define EVMC_H
+
13
+
14#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 6)
+
21#define EVMC_DEPRECATED __attribute__((deprecated))
+
22#else
+
23#define EVMC_DEPRECATED
+
24#endif
+
25
+
26
+
27#include <stdbool.h> /* Definition of bool, true and false. */
+
28#include <stddef.h> /* Definition of size_t. */
+
29#include <stdint.h> /* Definition of int64_t, uint64_t. */
+
30
+
31#ifdef __cplusplus
+
32extern "C" {
+
33#endif
+
34
+
35/* BEGIN Python CFFI declarations */
+
36
+
37enum
+
38{
+ +
48};
+
49
+
50
+
56typedef struct evmc_bytes32
+
57{
+
59 uint8_t bytes[32];
+ +
61
+ +
66
+
68typedef struct evmc_address
+
69{
+
71 uint8_t bytes[20];
+ +
73
+ +
76{
+ + + + + + +
84};
+
85
+ +
88{
+
89 EVMC_STATIC = 1
+
90};
+
91
+ +
98{
+ +
101
+
106 uint32_t flags;
+
107
+
113 int32_t depth;
+
114
+
120 int64_t gas;
+
121
+ +
134
+ +
144
+
152 const uint8_t* input_data;
+
153
+ +
160
+ +
168
+ +
177
+ +
192
+
196 const uint8_t* code;
+
197
+
201 size_t code_size;
+
202};
+
203
+
205typedef struct evmc_tx_initcode
+
206{
+ +
208 const uint8_t* code;
+
209 size_t code_size;
+ +
211
+ +
214{
+ + + +
218 int64_t block_number;
+ + + + + + + + + + +
229};
+
230
+
236struct evmc_host_context;
+
237
+
247typedef struct evmc_tx_context (*evmc_get_tx_context_fn)(struct evmc_host_context* context);
+
248
+
261typedef evmc_bytes32 (*evmc_get_block_hash_fn)(struct evmc_host_context* context, int64_t number);
+
262
+ +
284{
+ +
287
+ +
290
+ +
298
+ +
301
+ +
311
+ +
314
+ +
320
+ +
323
+ +
326
+ +
333
+ +
336
+ +
339
+ +
346
+ +
352
+ +
358
+ +
363
+ +
369
+ +
372
+ +
375
+ +
388
+ + +
392
+
393/* Forward declaration. */
+
394struct evmc_result;
+
395
+
412typedef void (*evmc_release_result_fn)(const struct evmc_result* result);
+
413
+ +
416{
+ +
419
+
426 int64_t gas_left;
+
427
+
434 int64_t gas_refund;
+
435
+
448 const uint8_t* output_data;
+
449
+ +
456
+ +
477
+ +
487
+
499 uint8_t padding[4];
+
500};
+
501
+
502
+
512typedef bool (*evmc_account_exists_fn)(struct evmc_host_context* context,
+
513 const evmc_address* address);
+
514
+ +
527 const evmc_address* address,
+
528 const evmc_bytes32* key);
+
529
+ +
543 const evmc_address* address,
+
544 const evmc_bytes32* key);
+
545
+
546
+ +
569{
+ +
585
+ +
592
+ +
599
+ +
606
+ +
613
+ +
620
+ +
627
+ +
634
+ + +
642
+
643
+
658typedef enum evmc_storage_status (*evmc_set_storage_fn)(struct evmc_host_context* context,
+
659 const evmc_address* address,
+
660 const evmc_bytes32* key,
+
661 const evmc_bytes32* value);
+
662
+
677typedef void (*evmc_set_transient_storage_fn)(struct evmc_host_context* context,
+
678 const evmc_address* address,
+
679 const evmc_bytes32* key,
+
680 const evmc_bytes32* value);
+
681
+ +
692 const evmc_address* address);
+
693
+
704typedef size_t (*evmc_get_code_size_fn)(struct evmc_host_context* context,
+
705 const evmc_address* address);
+
706
+ +
719 const evmc_address* address);
+
720
+
738typedef size_t (*evmc_copy_code_fn)(struct evmc_host_context* context,
+
739 const evmc_address* address,
+
740 size_t code_offset,
+
741 uint8_t* buffer_data,
+
742 size_t buffer_size);
+
743
+
756typedef bool (*evmc_selfdestruct_fn)(struct evmc_host_context* context,
+
757 const evmc_address* address,
+
758 const evmc_address* beneficiary);
+
759
+
773typedef void (*evmc_emit_log_fn)(struct evmc_host_context* context,
+
774 const evmc_address* address,
+
775 const uint8_t* data,
+
776 size_t data_size,
+
777 const evmc_bytes32 topics[],
+
778 size_t topics_count);
+
779
+ +
784{
+ +
789
+ + +
795
+
807typedef enum evmc_access_status (*evmc_access_account_fn)(struct evmc_host_context* context,
+
808 const evmc_address* address);
+
809
+
822typedef enum evmc_access_status (*evmc_access_storage_fn)(struct evmc_host_context* context,
+
823 const evmc_address* address,
+
824 const evmc_bytes32* key);
+
825
+
833typedef struct evmc_result (*evmc_call_fn)(struct evmc_host_context* context,
+
834 const struct evmc_message* msg);
+
835
+ +
845{
+ +
848
+ +
851
+ +
854
+ +
857
+ +
860
+ +
863
+ +
866
+ +
869
+ +
872
+ +
875
+ +
878
+ +
881
+ +
884
+ +
887
+ +
890
+ +
893};
+
894
+
895
+
896/* Forward declaration. */
+
897struct evmc_vm;
+
898
+
904typedef void (*evmc_destroy_fn)(struct evmc_vm* vm);
+
905
+ +
910{
+
911 EVMC_SET_OPTION_SUCCESS = 0,
+
912 EVMC_SET_OPTION_INVALID_NAME = 1,
+
913 EVMC_SET_OPTION_INVALID_VALUE = 2
+
914};
+
915
+
929typedef enum evmc_set_option_result (*evmc_set_option_fn)(struct evmc_vm* vm,
+
930 char const* name,
+
931 char const* value);
+
932
+
933
+ +
941{
+ +
948
+ +
955
+ +
962
+ +
969
+ +
976
+ +
983
+ +
992
+ +
999
+ +
1006
+ +
1013
+ +
1020
+ +
1027
+ +
1034
+ +
1041
+ +
1048
+ +
1051
+ + +
1059
+
1060
+
1079typedef struct evmc_result (*evmc_execute_fn)(struct evmc_vm* vm,
+
1080 const struct evmc_host_interface* host,
+
1081 struct evmc_host_context* context,
+
1082 enum evmc_revision rev,
+
1083 const struct evmc_message* msg,
+
1084 uint8_t const* code,
+
1085 size_t code_size);
+
1086
+ +
1091{
+ +
1096
+ +
1101
+
1112 EVMC_CAPABILITY_PRECOMPILES = (1u << 2)
+ +
1114
+ +
1121
+ +
1132
+
1133
+ +
1140{
+
1147 const int abi_version;
+
1148
+
1155 const char* name;
+
1156
+
1163 const char* version;
+
1164
+ +
1171
+ +
1178
+ +
1190
+ +
1197};
+
1198
+
1199/* END Python CFFI declarations */
+
1200
+
1201#ifdef EVMC_DOCUMENTATION
+
1217struct evmc_vm* evmc_create_example_vm(void);
+
1218#endif
+
1219
+
1220#ifdef __cplusplus
+
1221}
+
1222#endif
+
1223
+
1224#endif
+
evmc_flags
The flags for evmc_message.
Definition: evmc.h:88
+
bool(* evmc_selfdestruct_fn)(struct evmc_host_context *context, const evmc_address *address, const evmc_address *beneficiary)
Selfdestruct callback function.
Definition: evmc.h:756
+
void(* evmc_destroy_fn)(struct evmc_vm *vm)
Destroys the VM instance.
Definition: evmc.h:904
+
struct evmc_bytes32 evmc_uint256be
The alias for evmc_bytes32 to represent a big-endian 256-bit integer.
Definition: evmc.h:65
+
evmc_set_option_result
Possible outcomes of evmc_set_option.
Definition: evmc.h:910
+
void(* evmc_release_result_fn)(const struct evmc_result *result)
Releases resources assigned to an execution result.
Definition: evmc.h:412
+
size_t(* evmc_get_code_size_fn)(struct evmc_host_context *context, const evmc_address *address)
Get code size callback function.
Definition: evmc.h:704
+
evmc_capabilities
Possible capabilities of a VM.
Definition: evmc.h:1091
+
struct evmc_vm * evmc_create_example_vm(void)
Example of a function creating an instance of an example EVM implementation.
Definition: example_vm.cpp:392
+
evmc_status_code
The execution status code.
Definition: evmc.h:284
+
bool(* evmc_account_exists_fn)(struct evmc_host_context *context, const evmc_address *address)
Check account existence callback function.
Definition: evmc.h:512
+
evmc_uint256be(* evmc_get_balance_fn)(struct evmc_host_context *context, const evmc_address *address)
Get balance callback function.
Definition: evmc.h:691
+
struct evmc_result(* evmc_call_fn)(struct evmc_host_context *context, const struct evmc_message *msg)
Pointer to the callback function supporting EVM calls.
Definition: evmc.h:833
+
enum evmc_set_option_result(* evmc_set_option_fn)(struct evmc_vm *vm, char const *name, char const *value)
Configures the VM instance.
Definition: evmc.h:929
+
uint32_t evmc_capabilities_flagset
Alias for unsigned integer representing a set of bit flags of EVMC capabilities.
Definition: evmc.h:1120
+
evmc_bytes32(* evmc_get_code_hash_fn)(struct evmc_host_context *context, const evmc_address *address)
Get code hash callback function.
Definition: evmc.h:718
+
evmc_bytes32(* evmc_get_storage_fn)(struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key)
Get storage callback function.
Definition: evmc.h:526
+
struct evmc_tx_context(* evmc_get_tx_context_fn)(struct evmc_host_context *context)
Get transaction context callback function.
Definition: evmc.h:247
+
size_t(* evmc_copy_code_fn)(struct evmc_host_context *context, const evmc_address *address, size_t code_offset, uint8_t *buffer_data, size_t buffer_size)
Copy code callback function.
Definition: evmc.h:738
+
enum evmc_access_status(* evmc_access_account_fn)(struct evmc_host_context *context, const evmc_address *address)
Access account callback function.
Definition: evmc.h:807
+
evmc_bytes32(* evmc_get_block_hash_fn)(struct evmc_host_context *context, int64_t number)
Get block hash callback function.
Definition: evmc.h:261
+
evmc_capabilities_flagset(* evmc_get_capabilities_fn)(struct evmc_vm *vm)
Return the supported capabilities of the VM instance.
Definition: evmc.h:1131
+
evmc_access_status
Access status per EIP-2929: Gas cost increases for state access opcodes.
Definition: evmc.h:784
+
void(* evmc_emit_log_fn)(struct evmc_host_context *context, const evmc_address *address, const uint8_t *data, size_t data_size, const evmc_bytes32 topics[], size_t topics_count)
Log callback function.
Definition: evmc.h:773
+
evmc_call_kind
The kind of call-like instruction.
Definition: evmc.h:76
+
enum evmc_access_status(* evmc_access_storage_fn)(struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key)
Access storage callback function.
Definition: evmc.h:822
+
evmc_storage_status
The effect of an attempt to modify a contract storage item.
Definition: evmc.h:569
+
void(* evmc_set_transient_storage_fn)(struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key, const evmc_bytes32 *value)
Set transient storage callback function.
Definition: evmc.h:677
+
evmc_revision
EVM revision.
Definition: evmc.h:941
+
struct evmc_result(* evmc_execute_fn)(struct evmc_vm *vm, const struct evmc_host_interface *host, struct evmc_host_context *context, enum evmc_revision rev, const struct evmc_message *msg, uint8_t const *code, size_t code_size)
Executes the given code using the input from the message.
Definition: evmc.h:1079
+
enum evmc_storage_status(* evmc_set_storage_fn)(struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key, const evmc_bytes32 *value)
Set storage callback function.
Definition: evmc.h:658
+
evmc_bytes32(* evmc_get_transient_storage_fn)(struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key)
Get transient storage callback function.
Definition: evmc.h:542
+
@ EVMC_ABI_VERSION
The EVMC ABI version number of the interface declared in this file.
Definition: evmc.h:47
+
@ EVMC_STATIC
Static call mode.
Definition: evmc.h:89
+
@ EVMC_CAPABILITY_EVM1
The VM is capable of executing EVM1 bytecode.
Definition: evmc.h:1095
+
@ EVMC_CAPABILITY_PRECOMPILES
The VM is capable of executing the precompiled contracts defined for the range of code addresses.
Definition: evmc.h:1112
+
@ EVMC_CAPABILITY_EWASM
The VM is capable of executing ewasm bytecode.
Definition: evmc.h:1100
+
@ EVMC_INSUFFICIENT_BALANCE
The caller does not have enough funds for value transfer.
Definition: evmc.h:371
+
@ EVMC_ARGUMENT_OUT_OF_RANGE
An argument to a state accessing method has a value outside of the accepted range of values.
Definition: evmc.h:357
+
@ EVMC_INVALID_MEMORY_ACCESS
Tried to read outside memory bounds.
Definition: evmc.h:332
+
@ EVMC_REJECTED
The execution of the given code and/or message has been rejected by the EVM implementation.
Definition: evmc.h:387
+
@ EVMC_UNDEFINED_INSTRUCTION
An undefined instruction has been encountered.
Definition: evmc.h:313
+
@ EVMC_SUCCESS
Execution finished with success.
Definition: evmc.h:286
+
@ EVMC_OUT_OF_MEMORY
The VM failed to allocate the amount of memory needed for execution.
Definition: evmc.h:390
+
@ EVMC_STACK_UNDERFLOW
Execution of an opcode has required more items on the EVM stack.
Definition: evmc.h:322
+
@ EVMC_BAD_JUMP_DESTINATION
Execution has violated the jump destination restrictions.
Definition: evmc.h:325
+
@ EVMC_INVALID_INSTRUCTION
The designated INVALID instruction has been hit during execution.
Definition: evmc.h:310
+
@ EVMC_STATIC_MODE_VIOLATION
Tried to execute an operation which is restricted in static mode.
Definition: evmc.h:338
+
@ EVMC_WASM_TRAP
A WebAssembly trap has been hit during execution.
Definition: evmc.h:368
+
@ EVMC_PRECOMPILE_FAILURE
A call to a precompiled or system contract has ended with a failure.
Definition: evmc.h:345
+
@ EVMC_INTERNAL_ERROR
EVM implementation generic internal error.
Definition: evmc.h:374
+
@ EVMC_OUT_OF_GAS
The execution has run out of gas.
Definition: evmc.h:300
+
@ EVMC_CONTRACT_VALIDATION_FAILURE
Contract validation has failed (e.g.
Definition: evmc.h:351
+
@ EVMC_CALL_DEPTH_EXCEEDED
Call depth has exceeded the limit (if any)
Definition: evmc.h:335
+
@ EVMC_WASM_UNREACHABLE_INSTRUCTION
A WebAssembly unreachable instruction has been hit during execution.
Definition: evmc.h:362
+
@ EVMC_STACK_OVERFLOW
The execution has attempted to put more items on the EVM stack than the specified limit.
Definition: evmc.h:319
+
@ EVMC_FAILURE
Generic execution failure.
Definition: evmc.h:289
+
@ EVMC_REVERT
Execution terminated with REVERT opcode.
Definition: evmc.h:297
+
@ EVMC_ACCESS_COLD
The entry hasn't been accessed before – it's the first access.
Definition: evmc.h:788
+
@ EVMC_ACCESS_WARM
The entry is already in accessed_addresses or accessed_storage_keys.
Definition: evmc.h:793
+
@ EVMC_CREATE
Request CREATE.
Definition: evmc.h:81
+
@ EVMC_EOFCREATE
Request EOFCREATE.
Definition: evmc.h:83
+
@ EVMC_DELEGATECALL
Request DELEGATECALL.
Definition: evmc.h:78
+
@ EVMC_CREATE2
Request CREATE2.
Definition: evmc.h:82
+
@ EVMC_CALL
Request CALL.
Definition: evmc.h:77
+
@ EVMC_CALLCODE
Request CALLCODE.
Definition: evmc.h:80
+
@ EVMC_STORAGE_ADDED_DELETED
A storage item is deleted by changing the current dirty nonzero to the original zero value.
Definition: evmc.h:633
+
@ EVMC_STORAGE_MODIFIED_RESTORED
A storage item is modified by changing the current dirty nonzero to the original nonzero value other ...
Definition: evmc.h:640
+
@ EVMC_STORAGE_DELETED_RESTORED
A storage item is added by changing the current dirty zero to the original value.
Definition: evmc.h:626
+
@ EVMC_STORAGE_ADDED
A new storage item is added by changing the current clean zero to a nonzero value.
Definition: evmc.h:591
+
@ EVMC_STORAGE_MODIFIED_DELETED
A storage item is deleted by changing the current dirty nonzero to the zero value and the original va...
Definition: evmc.h:619
+
@ EVMC_STORAGE_ASSIGNED
The new/same value is assigned to the storage item without affecting the cost structure.
Definition: evmc.h:584
+
@ EVMC_STORAGE_DELETED
A storage item is deleted by changing the current clean nonzero to the zero value.
Definition: evmc.h:598
+
@ EVMC_STORAGE_DELETED_ADDED
A storage item is added by changing the current dirty zero to a nonzero value other than the original...
Definition: evmc.h:612
+
@ EVMC_STORAGE_MODIFIED
A storage item is modified by changing the current clean nonzero to other nonzero value.
Definition: evmc.h:605
+
@ EVMC_OSAKA
The Osaka revision.
Definition: evmc.h:1047
+
@ EVMC_HOMESTEAD
The Homestead revision.
Definition: evmc.h:954
+
@ EVMC_LATEST_STABLE_REVISION
The latest known EVM revision with finalized specification.
Definition: evmc.h:1057
+
@ EVMC_PRAGUE
The Prague revision.
Definition: evmc.h:1040
+
@ EVMC_ISTANBUL
The Istanbul revision.
Definition: evmc.h:998
+
@ EVMC_FRONTIER
The Frontier revision.
Definition: evmc.h:947
+
@ EVMC_PETERSBURG
The Petersburg revision.
Definition: evmc.h:991
+
@ EVMC_CONSTANTINOPLE
The Constantinople revision.
Definition: evmc.h:982
+
@ EVMC_TANGERINE_WHISTLE
The Tangerine Whistle revision.
Definition: evmc.h:961
+
@ EVMC_MAX_REVISION
The maximum EVM revision supported.
Definition: evmc.h:1050
+
@ EVMC_SPURIOUS_DRAGON
The Spurious Dragon revision.
Definition: evmc.h:968
+
@ EVMC_BYZANTIUM
The Byzantium revision.
Definition: evmc.h:975
+
@ EVMC_CANCUN
The Cancun revision.
Definition: evmc.h:1033
+
@ EVMC_SHANGHAI
The Shanghai revision.
Definition: evmc.h:1026
+
@ EVMC_LONDON
The London revision.
Definition: evmc.h:1012
+
@ EVMC_PARIS
The Paris revision (aka The Merge).
Definition: evmc.h:1019
+
@ EVMC_BERLIN
The Berlin revision.
Definition: evmc.h:1005
+
Big-endian 160-bit hash suitable for keeping an Ethereum address.
Definition: evmc.h:69
+
uint8_t bytes[20]
The 20 bytes of the hash.
Definition: evmc.h:71
+
The fixed size array of 32 bytes.
Definition: evmc.h:57
+
uint8_t bytes[32]
The 32 bytes.
Definition: evmc.h:59
+
The opaque data type representing the Host execution context.
+
The Host interface.
Definition: evmc.h:845
+
evmc_get_code_hash_fn get_code_hash
Get code hash callback function.
Definition: evmc.h:862
+
evmc_call_fn call
Call callback function.
Definition: evmc.h:871
+
evmc_selfdestruct_fn selfdestruct
Selfdestruct callback function.
Definition: evmc.h:868
+
evmc_get_storage_fn get_storage
Get storage callback function.
Definition: evmc.h:850
+
evmc_copy_code_fn copy_code
Copy code callback function.
Definition: evmc.h:865
+
evmc_get_code_size_fn get_code_size
Get code size callback function.
Definition: evmc.h:859
+
evmc_get_transient_storage_fn get_transient_storage
Get transient storage callback function.
Definition: evmc.h:889
+
evmc_set_transient_storage_fn set_transient_storage
Set transient storage callback function.
Definition: evmc.h:892
+
evmc_get_block_hash_fn get_block_hash
Get block hash callback function.
Definition: evmc.h:877
+
evmc_emit_log_fn emit_log
Emit log callback function.
Definition: evmc.h:880
+
evmc_account_exists_fn account_exists
Check account existence callback function.
Definition: evmc.h:847
+
evmc_access_account_fn access_account
Access account callback function.
Definition: evmc.h:883
+
evmc_get_balance_fn get_balance
Get balance callback function.
Definition: evmc.h:856
+
evmc_set_storage_fn set_storage
Set storage callback function.
Definition: evmc.h:853
+
evmc_get_tx_context_fn get_tx_context
Get transaction context callback function.
Definition: evmc.h:874
+
evmc_access_storage_fn access_storage
Access storage callback function.
Definition: evmc.h:886
+
The message describing an EVM call, including a zero-depth calls from a transaction origin.
Definition: evmc.h:98
+
const uint8_t * input_data
The message input data.
Definition: evmc.h:152
+
evmc_bytes32 create2_salt
The optional value used in new contract address construction.
Definition: evmc.h:176
+
const uint8_t * code
The code to be executed.
Definition: evmc.h:196
+
size_t input_size
The size of the message input data.
Definition: evmc.h:159
+
evmc_address recipient
The recipient of the message.
Definition: evmc.h:133
+
enum evmc_call_kind kind
The kind of the call.
Definition: evmc.h:100
+
int32_t depth
The present depth of the message call stack.
Definition: evmc.h:113
+
uint32_t flags
Additional flags modifying the call execution behavior.
Definition: evmc.h:106
+
evmc_address code_address
The address of the code to be executed.
Definition: evmc.h:191
+
size_t code_size
The length of the code to be executed.
Definition: evmc.h:201
+
evmc_uint256be value
The amount of Ether transferred with the message.
Definition: evmc.h:167
+
evmc_address sender
The sender of the message.
Definition: evmc.h:143
+
int64_t gas
The amount of gas available to the message execution.
Definition: evmc.h:120
+
The EVM code execution result.
Definition: evmc.h:416
+
const uint8_t * output_data
The reference to output data.
Definition: evmc.h:448
+
enum evmc_status_code status_code
The execution status code.
Definition: evmc.h:418
+
evmc_release_result_fn release
The method releasing all resources associated with the result object.
Definition: evmc.h:476
+
int64_t gas_refund
The refunded gas accumulated from this execution and its sub-calls.
Definition: evmc.h:434
+
size_t output_size
The size of the output data.
Definition: evmc.h:455
+
uint8_t padding[4]
Reserved data that MAY be used by a evmc_result object creator.
Definition: evmc.h:499
+
evmc_address create_address
The address of the possibly created contract.
Definition: evmc.h:486
+
int64_t gas_left
The amount of gas left after the execution.
Definition: evmc.h:426
+
The transaction and block data for execution.
Definition: evmc.h:214
+
size_t initcodes_count
The number of transaction initcodes (TXCREATE).
Definition: evmc.h:228
+
evmc_address tx_origin
The transaction origin account.
Definition: evmc.h:216
+
evmc_uint256be block_base_fee
The block base fee per gas (EIP-1559, EIP-3198).
Definition: evmc.h:223
+
int64_t block_number
The block number.
Definition: evmc.h:218
+
int64_t block_timestamp
The block timestamp.
Definition: evmc.h:219
+
const evmc_bytes32 * blob_hashes
The array of blob hashes (EIP-4844).
Definition: evmc.h:225
+
evmc_uint256be tx_gas_price
The transaction gas price.
Definition: evmc.h:215
+
const evmc_tx_initcode * initcodes
The array of transaction initcodes (TXCREATE).
Definition: evmc.h:227
+
size_t blob_hashes_count
The number of blob hashes (EIP-4844).
Definition: evmc.h:226
+
evmc_uint256be chain_id
The blockchain's ChainID.
Definition: evmc.h:222
+
evmc_uint256be block_prev_randao
The block previous RANDAO (EIP-4399).
Definition: evmc.h:221
+
evmc_address block_coinbase
The miner of the block.
Definition: evmc.h:217
+
evmc_uint256be blob_base_fee
The blob base fee (EIP-7516).
Definition: evmc.h:224
+
int64_t block_gas_limit
The block gas limit.
Definition: evmc.h:220
+
The hashed initcode used for TXCREATE instruction.
Definition: evmc.h:206
+
size_t code_size
The length of the code.
Definition: evmc.h:209
+
evmc_bytes32 hash
The initcode hash.
Definition: evmc.h:207
+
const uint8_t * code
The code.
Definition: evmc.h:208
+
The VM instance.
Definition: evmc.h:1140
+
evmc_set_option_fn set_option
Optional pointer to function modifying VM's options.
Definition: evmc.h:1196
+
evmc_get_capabilities_fn get_capabilities
A method returning capabilities supported by the VM instance.
Definition: evmc.h:1189
+
evmc_execute_fn execute
Pointer to function executing a code by the VM instance.
Definition: evmc.h:1177
+
const char * name
The name of the EVMC VM implementation.
Definition: evmc.h:1155
+
evmc_destroy_fn destroy
Pointer to function destroying the VM instance.
Definition: evmc.h:1170
+
const int abi_version
EVMC ABI version implemented by the VM instance.
Definition: evmc.h:1147
+
const char * version
The version of the EVMC VM implementation, e.g.
Definition: evmc.h:1163
+
+
+ + + + diff --git a/evmc_8hpp.html b/evmc_8hpp.html new file mode 100644 index 000000000..2a54e34f0 --- /dev/null +++ b/evmc_8hpp.html @@ -0,0 +1,515 @@ + + + + + + + +EVMC: include/evmc/evmc.hpp File Reference + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ +
evmc.hpp File Reference
+
+
+
#include <evmc/evmc.h>
+#include <evmc/helpers.h>
+#include <evmc/hex.hpp>
+#include <functional>
+#include <initializer_list>
+#include <ostream>
+#include <string_view>
+#include <utility>
+
+

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + + + + +

+Classes

struct  evmc::address
 The big-endian 160-bit hash suitable for keeping an Ethereum address. More...
 
struct  evmc::bytes32
 The fixed size array of 32 bytes for storing 256-bit EVM values. More...
 
class  evmc::Result
 The EVM code execution result. More...
 
class  evmc::HostInterface
 The EVMC Host interface. More...
 
class  evmc::HostContext
 Wrapper around EVMC host context / host interface. More...
 
class  evmc::Host
 Abstract class to be used by Host implementations. More...
 
class  evmc::VM
 The VM instance. More...
 
+ + + + +

+Namespaces

namespace  evmc
 EVMC C++ API - wrappers and bindings for C++.
 
+ + + + +

+Typedefs

using evmc::uint256be = bytes32
 The alias for evmc::bytes32 to represent a big-endian 256-bit integer.
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

constexpr uint64_t evmc::load64be (const uint8_t *data) noexcept
 Loads 64 bits / 8 bytes of data from the given data array in big-endian order.
 
constexpr uint64_t evmc::load64le (const uint8_t *data) noexcept
 Loads 64 bits / 8 bytes of data from the given data array in little-endian order.
 
constexpr uint32_t evmc::load32be (const uint8_t *data) noexcept
 Loads 32 bits / 4 bytes of data from the given data array in big-endian order.
 
constexpr uint32_t evmc::load32le (const uint8_t *data) noexcept
 Loads 32 bits / 4 bytes of data from the given data array in little-endian order.
 
constexpr uint64_t evmc::fnv::fnv1a_by64 (uint64_t h, uint64_t x) noexcept
 The hashing transformation for 64-bit inputs based on the FNV-1a formula.
 
constexpr bool evmc::operator== (const address &a, const address &b) noexcept
 The "equal to" comparison operator for the evmc::address type.
 
constexpr bool evmc::operator!= (const address &a, const address &b) noexcept
 The "not equal to" comparison operator for the evmc::address type.
 
constexpr bool evmc::operator< (const address &a, const address &b) noexcept
 The "less than" comparison operator for the evmc::address type.
 
constexpr bool evmc::operator> (const address &a, const address &b) noexcept
 The "greater than" comparison operator for the evmc::address type.
 
constexpr bool evmc::operator<= (const address &a, const address &b) noexcept
 The "less than or equal to" comparison operator for the evmc::address type.
 
constexpr bool evmc::operator>= (const address &a, const address &b) noexcept
 The "greater than or equal to" comparison operator for the evmc::address type.
 
constexpr bool evmc::operator== (const bytes32 &a, const bytes32 &b) noexcept
 The "equal to" comparison operator for the evmc::bytes32 type.
 
constexpr bool evmc::operator!= (const bytes32 &a, const bytes32 &b) noexcept
 The "not equal to" comparison operator for the evmc::bytes32 type.
 
constexpr bool evmc::operator< (const bytes32 &a, const bytes32 &b) noexcept
 The "less than" comparison operator for the evmc::bytes32 type.
 
constexpr bool evmc::operator> (const bytes32 &a, const bytes32 &b) noexcept
 The "greater than" comparison operator for the evmc::bytes32 type.
 
constexpr bool evmc::operator<= (const bytes32 &a, const bytes32 &b) noexcept
 The "less than or equal to" comparison operator for the evmc::bytes32 type.
 
constexpr bool evmc::operator>= (const bytes32 &a, const bytes32 &b) noexcept
 The "greater than or equal to" comparison operator for the evmc::bytes32 type.
 
constexpr bool evmc::is_zero (const address &a) noexcept
 Checks if the given address is the zero address.
 
constexpr bool evmc::is_zero (const bytes32 &a) noexcept
 Checks if the given bytes32 object has all zero bytes.
 
template<typename T >
constexpr T evmc::literals::parse (std::string_view s) noexcept
 Converts a raw literal into value of type T.
 
constexpr address evmc::literals::operator""_address (const char *s) noexcept
 Literal for evmc::address.
 
constexpr bytes32 evmc::literals::operator""_bytes32 (const char *s) noexcept
 Literal for evmc::bytes32.
 
const char * evmc::to_string (evmc_status_code status_code) noexcept
 Returns text representation of the evmc_status_code.
 
const char * evmc::to_string (evmc_revision rev) noexcept
 Returns the name of the evmc_revision.
 
std::ostream & operator<< (std::ostream &os, evmc_status_code status_code)
 "Stream out" operator implementation for evmc_status_code.
 
std::ostream & operator<< (std::ostream &os, evmc_revision rev)
 "Stream out" operator implementation for evmc_revision.
 
+ + + + + + + + + + +

+Variables

constexpr auto evmc::fnv::prime = 0x100000001b3
 The 64-bit FNV prime number.
 
constexpr auto evmc::fnv::offset_basis = 0xcbf29ce484222325
 The 64-bit FNV offset basis.
 
constexpr auto evmc::make_result = evmc_make_result
 Alias for evmc_make_result().
 
+

Detailed Description

+

EVMC C++ API - wrappers and bindings for C++.

+ +

Definition in file evmc.hpp.

+

Function Documentation

+ +

◆ fnv1a_by64()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
constexpr uint64_t evmc::fnv::fnv1a_by64 (uint64_t h,
uint64_t x 
)
+
+inlineconstexprnoexcept
+
+ +

The hashing transformation for 64-bit inputs based on the FNV-1a formula.

+ +

Definition at line 163 of file evmc.hpp.

+
164{
+
165 return (h ^ x) * prime;
+
166}
+
constexpr auto prime
The 64-bit FNV prime number.
Definition: evmc.hpp:159
+
+
+
+ +

◆ operator""_address()

+ +
+
+ + + + + +
+ + + + + + + + +
constexpr address evmc::literals::operator""_address (const char * s)
+
+constexprnoexcept
+
+ +

Literal for evmc::address.

+ +

Definition at line 293 of file evmc.hpp.

+
294{
+
295 return parse<address>(s);
+
296}
+
+
+
+ +

◆ operator""_bytes32()

+ +
+
+ + + + + +
+ + + + + + + + +
constexpr bytes32 evmc::literals::operator""_bytes32 (const char * s)
+
+constexprnoexcept
+
+ +

Literal for evmc::bytes32.

+ +

Definition at line 299 of file evmc.hpp.

+
300{
+
301 return parse<bytes32>(s);
+
302}
+
+
+
+ +

◆ operator<<() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
std::ostream & operator<< (std::ostream & os,
evmc_revision rev 
)
+
+inline
+
+ +

"Stream out" operator implementation for evmc_revision.

+
Note
This is defined in global namespace to match evmc_revision definition and allow convenient operator overloading usage.
+ +

Definition at line 920 of file evmc.hpp.

+
921{
+
922 return os << evmc::to_string(rev);
+
923}
+
const char * to_string(evmc_status_code status_code) noexcept
Returns text representation of the evmc_status_code.
Definition: evmc.hpp:309
+
+
+
+ +

◆ operator<<() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
std::ostream & operator<< (std::ostream & os,
evmc_status_code status_code 
)
+
+inline
+
+ +

"Stream out" operator implementation for evmc_status_code.

+
Note
This is defined in global namespace to match evmc_status_code definition and allow convenient operator overloading usage.
+ +

Definition at line 911 of file evmc.hpp.

+
912{
+
913 return os << evmc::to_string(status_code);
+
914}
+
+
+
+ +

◆ parse()

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + + +
constexpr T evmc::literals::parse (std::string_view s)
+
+constexprnoexcept
+
+ +

Converts a raw literal into value of type T.

+

This function is expected to be used on literals in constexpr context only. In case the input is invalid the std::terminate() is called. TODO(c++20): Use consteval.

+ +

Definition at line 287 of file evmc.hpp.

+
288{
+
289 return from_hex<T>(s).value();
+
290}
+
+
+
+

Variable Documentation

+ +

◆ offset_basis

+ +
+
+ + + + + +
+ + + + +
constexpr auto evmc::fnv::offset_basis = 0xcbf29ce484222325
+
+constexpr
+
+ +

The 64-bit FNV offset basis.

+ +

Definition at line 160 of file evmc.hpp.

+ +
+
+ +

◆ prime

+ +
+
+ + + + + +
+ + + + +
constexpr auto evmc::fnv::prime = 0x100000001b3
+
+constexpr
+
+ +

The 64-bit FNV prime number.

+ +

Definition at line 159 of file evmc.hpp.

+ +
+
+
+
+ + + + diff --git a/evmc_8hpp.js b/evmc_8hpp.js new file mode 100644 index 000000000..c34324075 --- /dev/null +++ b/evmc_8hpp.js @@ -0,0 +1,40 @@ +var evmc_8hpp = +[ + [ "evmc::address", "structevmc_1_1address.html", "structevmc_1_1address" ], + [ "evmc::bytes32", "structevmc_1_1bytes32.html", "structevmc_1_1bytes32" ], + [ "evmc::Result", "classevmc_1_1Result.html", "classevmc_1_1Result" ], + [ "evmc::HostInterface", "classevmc_1_1HostInterface.html", "classevmc_1_1HostInterface" ], + [ "evmc::HostContext", "classevmc_1_1HostContext.html", "classevmc_1_1HostContext" ], + [ "evmc::Host", "classevmc_1_1Host.html", "classevmc_1_1Host" ], + [ "evmc::VM", "classevmc_1_1VM.html", "classevmc_1_1VM" ], + [ "uint256be", "evmc_8hpp.html#a92bc6b73f1ce3a2b2eea018cf902c4da", null ], + [ "fnv1a_by64", "evmc_8hpp.html#abd837c95e6df5b1f485f429e3b75050f", null ], + [ "is_zero", "evmc_8hpp.html#afc53d0e831bda94fbf31a64d224c8d24", null ], + [ "is_zero", "evmc_8hpp.html#a2277f8eca7df22f45a4476d3fe6342fe", null ], + [ "load32be", "evmc_8hpp.html#a2170432bbbef84b33ce6dda30904068e", null ], + [ "load32le", "evmc_8hpp.html#ada9ae3e2b40c36dbea8b6fe8ab70375b", null ], + [ "load64be", "evmc_8hpp.html#a1a253fea559bb97f713b91903ffc860e", null ], + [ "load64le", "evmc_8hpp.html#acd1275224a4eb5f6a672507d144065df", null ], + [ "operator!=", "evmc_8hpp.html#acef96efd7f9847cc089834dff73054bd", null ], + [ "operator!=", "evmc_8hpp.html#a5917d256b4c67912a47d3a54f849f751", null ], + [ "operator\"\"_address", "evmc_8hpp.html#a128bb7b0e024d8e14a08f0c317abe1e6", null ], + [ "operator\"\"_bytes32", "evmc_8hpp.html#a668cad5d0b53b8bb34937f53734e8e69", null ], + [ "operator<", "evmc_8hpp.html#a0a5557fb3dc3c04da6ef466ec3bb4d4c", null ], + [ "operator<", "evmc_8hpp.html#a4a0c61db81ebf11230c1506f7fc9e003", null ], + [ "operator<<", "evmc_8hpp.html#af12ec97e2945c75365b8ac7cc96495b7", null ], + [ "operator<<", "evmc_8hpp.html#a8fbdc72590b7f78fb2afa785dd30dc98", null ], + [ "operator<=", "evmc_8hpp.html#ac0dc436fe57925210dcd0481a79e9784", null ], + [ "operator<=", "evmc_8hpp.html#a8580df251c76ac9b0a1561cbfda93274", null ], + [ "operator==", "evmc_8hpp.html#a3f6b3b885e1053cebe81913583212e70", null ], + [ "operator==", "evmc_8hpp.html#a338b7c7a6dd5c12c0e37e5e8ef729100", null ], + [ "operator>", "evmc_8hpp.html#a44333e715985f766f2493b20ed665fbd", null ], + [ "operator>", "evmc_8hpp.html#a04835f698b6a2a5d2fbc3f8234518aed", null ], + [ "operator>=", "evmc_8hpp.html#aa1739e6e990dbd1fd3d30b249b1d0d58", null ], + [ "operator>=", "evmc_8hpp.html#ad830a8c519d4baf674a220480efc8ad3", null ], + [ "parse", "evmc_8hpp.html#acf6bc00a4ee7b67a06ae4b53cc369830", null ], + [ "to_string", "evmc_8hpp.html#a773edff68f6e013b3c809bb4c6ea33d3", null ], + [ "to_string", "evmc_8hpp.html#a44c9aad0ac3f324d817e18720a1e37de", null ], + [ "make_result", "evmc_8hpp.html#a9843b267dc279832b0ff9578b7dacdb7", null ], + [ "offset_basis", "evmc_8hpp.html#a5e866562fb1d26d46ec0bb750e762237", null ], + [ "prime", "evmc_8hpp.html#ae84e3cac71791be23e06c9a113f373d4", null ] +]; \ No newline at end of file diff --git a/evmc_8hpp_source.html b/evmc_8hpp_source.html new file mode 100644 index 000000000..a202433cb --- /dev/null +++ b/evmc_8hpp_source.html @@ -0,0 +1,992 @@ + + + + + + + +EVMC: include/evmc/evmc.hpp Source File + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
evmc.hpp
+
+
+Go to the documentation of this file.
1// EVMC: Ethereum Client-VM Connector API.
+
2// Copyright 2018 The EVMC Authors.
+
3// Licensed under the Apache License, Version 2.0.
+
4#pragma once
+
5
+
6#include <evmc/evmc.h>
+
7#include <evmc/helpers.h>
+
8#include <evmc/hex.hpp>
+
9
+
10#include <functional>
+
11#include <initializer_list>
+
12#include <ostream>
+
13#include <string_view>
+
14#include <utility>
+
15
+ +
17 "latest stable revision ill-defined");
+
18
+
21namespace evmc
+
22{
+ +
27{
+
31 constexpr address(evmc_address init = {}) noexcept : evmc_address{init} {}
+
32
+
37 constexpr explicit address(uint64_t v) noexcept
+
38 : evmc_address{{0,
+
39 0,
+
40 0,
+
41 0,
+
42 0,
+
43 0,
+
44 0,
+
45 0,
+
46 0,
+
47 0,
+
48 0,
+
49 0,
+
50 static_cast<uint8_t>(v >> 56),
+
51 static_cast<uint8_t>(v >> 48),
+
52 static_cast<uint8_t>(v >> 40),
+
53 static_cast<uint8_t>(v >> 32),
+
54 static_cast<uint8_t>(v >> 24),
+
55 static_cast<uint8_t>(v >> 16),
+
56 static_cast<uint8_t>(v >> 8),
+
57 static_cast<uint8_t>(v >> 0)}}
+
58 {}
+
59
+
61 inline constexpr explicit operator bool() const noexcept;
+
62
+
64 inline constexpr operator bytes_view() const noexcept { return {bytes, sizeof(bytes)}; }
+
65};
+
66
+ +
71{
+
75 constexpr bytes32(evmc_bytes32 init = {}) noexcept : evmc_bytes32{init} {}
+
76
+
81 constexpr explicit bytes32(uint64_t v) noexcept
+
82 : evmc_bytes32{{0,
+
83 0,
+
84 0,
+
85 0,
+
86 0,
+
87 0,
+
88 0,
+
89 0,
+
90 0,
+
91 0,
+
92 0,
+
93 0,
+
94 0,
+
95 0,
+
96 0,
+
97 0,
+
98 0,
+
99 0,
+
100 0,
+
101 0,
+
102 0,
+
103 0,
+
104 0,
+
105 0,
+
106 static_cast<uint8_t>(v >> 56),
+
107 static_cast<uint8_t>(v >> 48),
+
108 static_cast<uint8_t>(v >> 40),
+
109 static_cast<uint8_t>(v >> 32),
+
110 static_cast<uint8_t>(v >> 24),
+
111 static_cast<uint8_t>(v >> 16),
+
112 static_cast<uint8_t>(v >> 8),
+
113 static_cast<uint8_t>(v >> 0)}}
+
114 {}
+
115
+
117 inline constexpr explicit operator bool() const noexcept;
+
118
+
120 inline constexpr operator bytes_view() const noexcept { return {bytes, sizeof(bytes)}; }
+
121};
+
122
+ +
125
+
126
+
128inline constexpr uint64_t load64be(const uint8_t* data) noexcept
+
129{
+
130 return (uint64_t{data[0]} << 56) | (uint64_t{data[1]} << 48) | (uint64_t{data[2]} << 40) |
+
131 (uint64_t{data[3]} << 32) | (uint64_t{data[4]} << 24) | (uint64_t{data[5]} << 16) |
+
132 (uint64_t{data[6]} << 8) | uint64_t{data[7]};
+
133}
+
134
+
136inline constexpr uint64_t load64le(const uint8_t* data) noexcept
+
137{
+
138 return uint64_t{data[0]} | (uint64_t{data[1]} << 8) | (uint64_t{data[2]} << 16) |
+
139 (uint64_t{data[3]} << 24) | (uint64_t{data[4]} << 32) | (uint64_t{data[5]} << 40) |
+
140 (uint64_t{data[6]} << 48) | (uint64_t{data[7]} << 56);
+
141}
+
142
+
144inline constexpr uint32_t load32be(const uint8_t* data) noexcept
+
145{
+
146 return (uint32_t{data[0]} << 24) | (uint32_t{data[1]} << 16) | (uint32_t{data[2]} << 8) |
+
147 uint32_t{data[3]};
+
148}
+
149
+
151inline constexpr uint32_t load32le(const uint8_t* data) noexcept
+
152{
+
153 return uint32_t{data[0]} | (uint32_t{data[1]} << 8) | (uint32_t{data[2]} << 16) |
+
154 (uint32_t{data[3]} << 24);
+
155}
+
156
+
157namespace fnv
+
158{
+
159constexpr auto prime = 0x100000001b3;
+
160constexpr auto offset_basis = 0xcbf29ce484222325;
+
161
+
163inline constexpr uint64_t fnv1a_by64(uint64_t h, uint64_t x) noexcept
+
164{
+
165 return (h ^ x) * prime;
+
166}
+
167} // namespace fnv
+
168
+
169
+
171inline constexpr bool operator==(const address& a, const address& b) noexcept
+
172{
+
173 return load64le(&a.bytes[0]) == load64le(&b.bytes[0]) &&
+
174 load64le(&a.bytes[8]) == load64le(&b.bytes[8]) &&
+
175 load32le(&a.bytes[16]) == load32le(&b.bytes[16]);
+
176}
+
177
+
179inline constexpr bool operator!=(const address& a, const address& b) noexcept
+
180{
+
181 return !(a == b);
+
182}
+
183
+
185inline constexpr bool operator<(const address& a, const address& b) noexcept
+
186{
+
187 return load64be(&a.bytes[0]) < load64be(&b.bytes[0]) ||
+
188 (load64be(&a.bytes[0]) == load64be(&b.bytes[0]) &&
+
189 (load64be(&a.bytes[8]) < load64be(&b.bytes[8]) ||
+
190 (load64be(&a.bytes[8]) == load64be(&b.bytes[8]) &&
+
191 load32be(&a.bytes[16]) < load32be(&b.bytes[16]))));
+
192}
+
193
+
195inline constexpr bool operator>(const address& a, const address& b) noexcept
+
196{
+
197 return b < a;
+
198}
+
199
+
201inline constexpr bool operator<=(const address& a, const address& b) noexcept
+
202{
+
203 return !(b < a);
+
204}
+
205
+
207inline constexpr bool operator>=(const address& a, const address& b) noexcept
+
208{
+
209 return !(a < b);
+
210}
+
211
+
213inline constexpr bool operator==(const bytes32& a, const bytes32& b) noexcept
+
214{
+
215 return load64le(&a.bytes[0]) == load64le(&b.bytes[0]) &&
+
216 load64le(&a.bytes[8]) == load64le(&b.bytes[8]) &&
+
217 load64le(&a.bytes[16]) == load64le(&b.bytes[16]) &&
+
218 load64le(&a.bytes[24]) == load64le(&b.bytes[24]);
+
219}
+
220
+
222inline constexpr bool operator!=(const bytes32& a, const bytes32& b) noexcept
+
223{
+
224 return !(a == b);
+
225}
+
226
+
228inline constexpr bool operator<(const bytes32& a, const bytes32& b) noexcept
+
229{
+
230 return load64be(&a.bytes[0]) < load64be(&b.bytes[0]) ||
+
231 (load64be(&a.bytes[0]) == load64be(&b.bytes[0]) &&
+
232 (load64be(&a.bytes[8]) < load64be(&b.bytes[8]) ||
+
233 (load64be(&a.bytes[8]) == load64be(&b.bytes[8]) &&
+
234 (load64be(&a.bytes[16]) < load64be(&b.bytes[16]) ||
+
235 (load64be(&a.bytes[16]) == load64be(&b.bytes[16]) &&
+
236 load64be(&a.bytes[24]) < load64be(&b.bytes[24]))))));
+
237}
+
238
+
240inline constexpr bool operator>(const bytes32& a, const bytes32& b) noexcept
+
241{
+
242 return b < a;
+
243}
+
244
+
246inline constexpr bool operator<=(const bytes32& a, const bytes32& b) noexcept
+
247{
+
248 return !(b < a);
+
249}
+
250
+
252inline constexpr bool operator>=(const bytes32& a, const bytes32& b) noexcept
+
253{
+
254 return !(a < b);
+
255}
+
256
+
258inline constexpr bool is_zero(const address& a) noexcept
+
259{
+
260 return a == address{};
+
261}
+
262
+
263inline constexpr address::operator bool() const noexcept
+
264{
+
265 return !is_zero(*this);
+
266}
+
267
+
269inline constexpr bool is_zero(const bytes32& a) noexcept
+
270{
+
271 return a == bytes32{};
+
272}
+
273
+
274inline constexpr bytes32::operator bool() const noexcept
+
275{
+
276 return !is_zero(*this);
+
277}
+
278
+
279namespace literals
+
280{
+
286template <typename T>
+
287constexpr T parse(std::string_view s) noexcept
+
288{
+
289 return from_hex<T>(s).value();
+
290}
+
291
+
293constexpr address operator""_address(const char* s) noexcept
+
294{
+
295 return parse<address>(s);
+
296}
+
297
+
299constexpr bytes32 operator""_bytes32(const char* s) noexcept
+
300{
+
301 return parse<bytes32>(s);
+
302}
+
303} // namespace literals
+
304
+
305using namespace literals;
+
306
+
307
+
309inline const char* to_string(evmc_status_code status_code) noexcept
+
310{
+
311 return evmc_status_code_to_string(status_code);
+
312}
+
313
+
315inline const char* to_string(evmc_revision rev) noexcept
+
316{
+
317 return evmc_revision_to_string(rev);
+
318}
+
319
+
320
+ +
323
+
328class Result : private evmc_result
+
329{
+
330public:
+ + + + + + +
337
+
348 explicit Result(evmc_status_code _status_code,
+
349 int64_t _gas_left,
+
350 int64_t _gas_refund,
+
351 const uint8_t* _output_data,
+
352 size_t _output_size) noexcept
+
353 : evmc_result{make_result(_status_code, _gas_left, _gas_refund, _output_data, _output_size)}
+
354 {}
+
355
+ +
362 int64_t _gas_left = 0,
+
363 int64_t _gas_refund = 0) noexcept
+
364 : evmc_result{make_result(_status_code, _gas_left, _gas_refund, nullptr, 0)}
+
365 {}
+
366
+
373 explicit Result(evmc_status_code _status_code,
+
374 int64_t _gas_left,
+
375 int64_t _gas_refund,
+
376 const evmc_address& _create_address) noexcept
+
377 : evmc_result{make_result(_status_code, _gas_left, _gas_refund, nullptr, 0)}
+
378 {
+
379 create_address = _create_address;
+
380 }
+
381
+
385 explicit Result(const evmc_result& res) noexcept : evmc_result{res} {}
+
386
+
388 ~Result() noexcept
+
389 {
+
390 if (release != nullptr)
+
391 release(this);
+
392 }
+
393
+
395 Result(Result&& other) noexcept : evmc_result{other}
+
396 {
+
397 other.release = nullptr; // Disable releasing of the rvalue object.
+
398 }
+
399
+
406 Result& operator=(Result&& other) noexcept
+
407 {
+
408 this->~Result(); // Release this object.
+
409 static_cast<evmc_result&>(*this) = other; // Copy data.
+
410 other.release = nullptr; // Disable releasing of the rvalue object.
+
411 return *this;
+
412 }
+
413
+
415 evmc_result& raw() noexcept { return *this; }
+
416
+
418 const evmc_result& raw() const noexcept { return *this; }
+
419
+ +
429 {
+
430 const auto out = evmc_result{*this}; // Copy data.
+
431 this->release = nullptr; // Disable releasing of this object.
+
432 return out;
+
433 }
+
434};
+
435
+
436
+ +
439{
+
440public:
+
441 virtual ~HostInterface() noexcept = default;
+
442
+
444 virtual bool account_exists(const address& addr) const noexcept = 0;
+
445
+
447 virtual bytes32 get_storage(const address& addr, const bytes32& key) const noexcept = 0;
+
448
+ +
451 const bytes32& key,
+
452 const bytes32& value) noexcept = 0;
+
453
+
455 virtual uint256be get_balance(const address& addr) const noexcept = 0;
+
456
+
458 virtual size_t get_code_size(const address& addr) const noexcept = 0;
+
459
+
461 virtual bytes32 get_code_hash(const address& addr) const noexcept = 0;
+
462
+
464 virtual size_t copy_code(const address& addr,
+
465 size_t code_offset,
+
466 uint8_t* buffer_data,
+
467 size_t buffer_size) const noexcept = 0;
+
468
+
470 virtual bool selfdestruct(const address& addr, const address& beneficiary) noexcept = 0;
+
471
+
473 virtual Result call(const evmc_message& msg) noexcept = 0;
+
474
+
476 virtual evmc_tx_context get_tx_context() const noexcept = 0;
+
477
+
479 virtual bytes32 get_block_hash(int64_t block_number) const noexcept = 0;
+
480
+
482 virtual void emit_log(const address& addr,
+
483 const uint8_t* data,
+
484 size_t data_size,
+
485 const bytes32 topics[],
+
486 size_t num_topics) noexcept = 0;
+
487
+
489 virtual evmc_access_status access_account(const address& addr) noexcept = 0;
+
490
+
492 virtual evmc_access_status access_storage(const address& addr, const bytes32& key) noexcept = 0;
+
493
+ +
496 const bytes32& key) const noexcept = 0;
+
497
+
499 virtual void set_transient_storage(const address& addr,
+
500 const bytes32& key,
+
501 const bytes32& value) noexcept = 0;
+
502};
+
503
+
504
+ +
509{
+
510 const evmc_host_interface* host = nullptr;
+
511 evmc_host_context* context = nullptr;
+
512
+
513public:
+
515 HostContext() = default;
+
516
+
520 HostContext(const evmc_host_interface& interface, evmc_host_context* ctx) noexcept
+
521 : host{&interface}, context{ctx}
+
522 {}
+
523
+
524 bool account_exists(const address& address) const noexcept final
+
525 {
+
526 return host->account_exists(context, &address);
+
527 }
+
528
+
529 bytes32 get_storage(const address& address, const bytes32& key) const noexcept final
+
530 {
+
531 return host->get_storage(context, &address, &key);
+
532 }
+
533
+ +
535 const bytes32& key,
+
536 const bytes32& value) noexcept final
+
537 {
+
538 return host->set_storage(context, &address, &key, &value);
+
539 }
+
540
+
541 uint256be get_balance(const address& address) const noexcept final
+
542 {
+
543 return host->get_balance(context, &address);
+
544 }
+
545
+
546 size_t get_code_size(const address& address) const noexcept final
+
547 {
+
548 return host->get_code_size(context, &address);
+
549 }
+
550
+
551 bytes32 get_code_hash(const address& address) const noexcept final
+
552 {
+
553 return host->get_code_hash(context, &address);
+
554 }
+
555
+
556 size_t copy_code(const address& address,
+
557 size_t code_offset,
+
558 uint8_t* buffer_data,
+
559 size_t buffer_size) const noexcept final
+
560 {
+
561 return host->copy_code(context, &address, code_offset, buffer_data, buffer_size);
+
562 }
+
563
+
564 bool selfdestruct(const address& addr, const address& beneficiary) noexcept final
+
565 {
+
566 return host->selfdestruct(context, &addr, &beneficiary);
+
567 }
+
568
+
569 Result call(const evmc_message& message) noexcept final
+
570 {
+
571 return Result{host->call(context, &message)};
+
572 }
+
573
+
575 evmc_tx_context get_tx_context() const noexcept final { return host->get_tx_context(context); }
+
576
+
577 bytes32 get_block_hash(int64_t number) const noexcept final
+
578 {
+
579 return host->get_block_hash(context, number);
+
580 }
+
581
+
582 void emit_log(const address& addr,
+
583 const uint8_t* data,
+
584 size_t data_size,
+
585 const bytes32 topics[],
+
586 size_t topics_count) noexcept final
+
587 {
+
588 host->emit_log(context, &addr, data, data_size, topics, topics_count);
+
589 }
+
590
+ +
592 {
+
593 return host->access_account(context, &address);
+
594 }
+
595
+
596 evmc_access_status access_storage(const address& address, const bytes32& key) noexcept final
+
597 {
+
598 return host->access_storage(context, &address, &key);
+
599 }
+
600
+
601 bytes32 get_transient_storage(const address& address, const bytes32& key) const noexcept final
+
602 {
+
603 return host->get_transient_storage(context, &address, &key);
+
604 }
+
605
+ +
607 const bytes32& key,
+
608 const bytes32& value) noexcept final
+
609 {
+
610 host->set_transient_storage(context, &address, &key, &value);
+
611 }
+
612};
+
613
+
614
+
620class Host : public HostInterface
+
621{
+
622public:
+
625 static const evmc_host_interface& get_interface() noexcept;
+
626
+
629 evmc_host_context* to_context() noexcept { return reinterpret_cast<evmc_host_context*>(this); }
+
630
+
635 template <typename DerivedClass = Host>
+
636 static DerivedClass* from_context(evmc_host_context* context) noexcept
+
637 {
+
638 // Get pointer of the Host base class.
+
639 auto* h = reinterpret_cast<Host*>(context);
+
640
+
641 // Additional downcast, only possible if DerivedClass inherits from Host.
+
642 return static_cast<DerivedClass*>(h);
+
643 }
+
644};
+
645
+
646
+
651class VM
+
652{
+
653public:
+
654 VM() noexcept = default;
+
655
+
657 explicit VM(evmc_vm* vm) noexcept : m_instance{vm} {}
+
658
+
660 ~VM() noexcept
+
661 {
+
662 if (m_instance != nullptr)
+
663 m_instance->destroy(m_instance);
+
664 }
+
665
+
666 VM(const VM&) = delete;
+
667 VM& operator=(const VM&) = delete;
+
668
+
670 VM(VM&& other) noexcept : m_instance{other.m_instance} { other.m_instance = nullptr; }
+
671
+
673 VM& operator=(VM&& other) noexcept
+
674 {
+
675 this->~VM();
+
676 m_instance = other.m_instance;
+
677 other.m_instance = nullptr;
+
678 return *this;
+
679 }
+
680
+
683 inline VM(evmc_vm* vm,
+
684 std::initializer_list<std::pair<const char*, const char*>> options) noexcept;
+
685
+
687 explicit operator bool() const noexcept { return m_instance != nullptr; }
+
688
+
690 bool is_abi_compatible() const noexcept { return m_instance->abi_version == EVMC_ABI_VERSION; }
+
691
+
693 char const* name() const noexcept { return m_instance->name; }
+
694
+
696 char const* version() const noexcept { return m_instance->version; }
+
697
+
699 bool has_capability(evmc_capabilities capability) const noexcept
+
700 {
+
701 return (get_capabilities() & static_cast<evmc_capabilities_flagset>(capability)) != 0;
+
702 }
+
703
+ +
706 {
+
707 return m_instance->get_capabilities(m_instance);
+
708 }
+
709
+
711 evmc_set_option_result set_option(const char name[], const char value[]) noexcept
+
712 {
+
713 return evmc_set_option(m_instance, name, value);
+
714 }
+
715
+ + +
719 evmc_revision rev,
+
720 const evmc_message& msg,
+
721 const uint8_t* code,
+
722 size_t code_size) noexcept
+
723 {
+
724 return Result{m_instance->execute(m_instance, &host, ctx, rev, &msg, code, code_size)};
+
725 }
+
726
+ +
729 evmc_revision rev,
+
730 const evmc_message& msg,
+
731 const uint8_t* code,
+
732 size_t code_size) noexcept
+
733 {
+
734 return execute(Host::get_interface(), host.to_context(), rev, msg, code, code_size);
+
735 }
+
736
+ +
746 const evmc_message& msg,
+
747 const uint8_t* code,
+
748 size_t code_size) noexcept
+
749 {
+
750 return Result{
+
751 m_instance->execute(m_instance, nullptr, nullptr, rev, &msg, code, code_size)};
+
752 }
+
753
+
759 evmc_vm* get_raw_pointer() const noexcept { return m_instance; }
+
760
+
761private:
+
762 evmc_vm* m_instance = nullptr;
+
763};
+
764
+
765inline VM::VM(evmc_vm* vm,
+
766 std::initializer_list<std::pair<const char*, const char*>> options) noexcept
+
767 : m_instance{vm}
+
768{
+
769 // This constructor is implemented outside of the class definition to workaround a doxygen bug.
+
770 for (const auto& option : options)
+
771 set_option(option.first, option.second);
+
772}
+
773
+
774
+
775namespace internal
+
776{
+
777inline bool account_exists(evmc_host_context* h, const evmc_address* addr) noexcept
+
778{
+
779 return Host::from_context(h)->account_exists(*addr);
+
780}
+
781
+
782inline evmc_bytes32 get_storage(evmc_host_context* h,
+
783 const evmc_address* addr,
+
784 const evmc_bytes32* key) noexcept
+
785{
+
786 return Host::from_context(h)->get_storage(*addr, *key);
+
787}
+
788
+
789inline evmc_storage_status set_storage(evmc_host_context* h,
+
790 const evmc_address* addr,
+
791 const evmc_bytes32* key,
+
792 const evmc_bytes32* value) noexcept
+
793{
+
794 return Host::from_context(h)->set_storage(*addr, *key, *value);
+
795}
+
796
+
797inline evmc_uint256be get_balance(evmc_host_context* h, const evmc_address* addr) noexcept
+
798{
+
799 return Host::from_context(h)->get_balance(*addr);
+
800}
+
801
+
802inline size_t get_code_size(evmc_host_context* h, const evmc_address* addr) noexcept
+
803{
+
804 return Host::from_context(h)->get_code_size(*addr);
+
805}
+
806
+
807inline evmc_bytes32 get_code_hash(evmc_host_context* h, const evmc_address* addr) noexcept
+
808{
+
809 return Host::from_context(h)->get_code_hash(*addr);
+
810}
+
811
+
812inline size_t copy_code(evmc_host_context* h,
+
813 const evmc_address* addr,
+
814 size_t code_offset,
+
815 uint8_t* buffer_data,
+
816 size_t buffer_size) noexcept
+
817{
+
818 return Host::from_context(h)->copy_code(*addr, code_offset, buffer_data, buffer_size);
+
819}
+
820
+
821inline bool selfdestruct(evmc_host_context* h,
+
822 const evmc_address* addr,
+
823 const evmc_address* beneficiary) noexcept
+
824{
+
825 return Host::from_context(h)->selfdestruct(*addr, *beneficiary);
+
826}
+
827
+
828inline evmc_result call(evmc_host_context* h, const evmc_message* msg) noexcept
+
829{
+
830 return Host::from_context(h)->call(*msg).release_raw();
+
831}
+
832
+
833inline evmc_tx_context get_tx_context(evmc_host_context* h) noexcept
+
834{
+
835 return Host::from_context(h)->get_tx_context();
+
836}
+
837
+
838inline evmc_bytes32 get_block_hash(evmc_host_context* h, int64_t block_number) noexcept
+
839{
+
840 return Host::from_context(h)->get_block_hash(block_number);
+
841}
+
842
+
843inline void emit_log(evmc_host_context* h,
+
844 const evmc_address* addr,
+
845 const uint8_t* data,
+
846 size_t data_size,
+
847 const evmc_bytes32 topics[],
+
848 size_t num_topics) noexcept
+
849{
+
850 Host::from_context(h)->emit_log(*addr, data, data_size, static_cast<const bytes32*>(topics),
+
851 num_topics);
+
852}
+
853
+
854inline evmc_access_status access_account(evmc_host_context* h, const evmc_address* addr) noexcept
+
855{
+
856 return Host::from_context(h)->access_account(*addr);
+
857}
+
858
+
859inline evmc_access_status access_storage(evmc_host_context* h,
+
860 const evmc_address* addr,
+
861 const evmc_bytes32* key) noexcept
+
862{
+
863 return Host::from_context(h)->access_storage(*addr, *key);
+
864}
+
865
+
866inline evmc_bytes32 get_transient_storage(evmc_host_context* h,
+
867 const evmc_address* addr,
+
868 const evmc_bytes32* key) noexcept
+
869{
+
870 return Host::from_context(h)->get_transient_storage(*addr, *key);
+
871}
+
872
+
873inline void set_transient_storage(evmc_host_context* h,
+
874 const evmc_address* addr,
+
875 const evmc_bytes32* key,
+
876 const evmc_bytes32* value) noexcept
+
877{
+
878 Host::from_context(h)->set_transient_storage(*addr, *key, *value);
+
879}
+
880} // namespace internal
+
881
+ +
883{
+
884 static constexpr evmc_host_interface interface = {
+
885 ::evmc::internal::account_exists,
+
886 ::evmc::internal::get_storage,
+
887 ::evmc::internal::set_storage,
+
888 ::evmc::internal::get_balance,
+
889 ::evmc::internal::get_code_size,
+
890 ::evmc::internal::get_code_hash,
+
891 ::evmc::internal::copy_code,
+
892 ::evmc::internal::selfdestruct,
+
893 ::evmc::internal::call,
+
894 ::evmc::internal::get_tx_context,
+
895 ::evmc::internal::get_block_hash,
+
896 ::evmc::internal::emit_log,
+
897 ::evmc::internal::access_account,
+
898 ::evmc::internal::access_storage,
+
899 ::evmc::internal::get_transient_storage,
+
900 ::evmc::internal::set_transient_storage,
+
901 };
+
902 return interface;
+
903}
+
904} // namespace evmc
+
905
+
906
+
911inline std::ostream& operator<<(std::ostream& os, evmc_status_code status_code)
+
912{
+
913 return os << evmc::to_string(status_code);
+
914}
+
915
+
920inline std::ostream& operator<<(std::ostream& os, evmc_revision rev)
+
921{
+
922 return os << evmc::to_string(rev);
+
923}
+
924
+
925namespace std
+
926{
+
928template <>
+
929struct hash<evmc::address>
+
930{
+
932 constexpr size_t operator()(const evmc::address& s) const noexcept
+
933 {
+
934 using namespace evmc;
+
935 using namespace fnv;
+
936 return static_cast<size_t>(fnv1a_by64(
+
937 fnv1a_by64(fnv1a_by64(fnv::offset_basis, load64le(&s.bytes[0])), load64le(&s.bytes[8])),
+
938 load32le(&s.bytes[16])));
+
939 }
+
940};
+
941
+
943template <>
+
944struct hash<evmc::bytes32>
+
945{
+
947 constexpr size_t operator()(const evmc::bytes32& s) const noexcept
+
948 {
+
949 using namespace evmc;
+
950 using namespace fnv;
+
951 return static_cast<size_t>(
+
952 fnv1a_by64(fnv1a_by64(fnv1a_by64(fnv1a_by64(fnv::offset_basis, load64le(&s.bytes[0])),
+
953 load64le(&s.bytes[8])),
+
954 load64le(&s.bytes[16])),
+
955 load64le(&s.bytes[24])));
+
956 }
+
957};
+
958} // namespace std
+
Wrapper around EVMC host context / host interface.
Definition: evmc.hpp:509
+
bytes32 get_code_hash(const address &address) const noexcept final
Get code hash callback function.
Definition: evmc.hpp:551
+
bool account_exists(const address &address) const noexcept final
Check account existence callback function.
Definition: evmc.hpp:524
+
size_t get_code_size(const address &address) const noexcept final
Get code size callback function.
Definition: evmc.hpp:546
+
HostContext()=default
Default constructor for null Host context.
+
uint256be get_balance(const address &address) const noexcept final
Get balance callback function.
Definition: evmc.hpp:541
+
HostContext(const evmc_host_interface &interface, evmc_host_context *ctx) noexcept
Constructor from the EVMC Host primitives.
Definition: evmc.hpp:520
+
evmc_access_status access_storage(const address &address, const bytes32 &key) noexcept final
Access storage callback function.
Definition: evmc.hpp:596
+
size_t copy_code(const address &address, size_t code_offset, uint8_t *buffer_data, size_t buffer_size) const noexcept final
Copy code callback function.
Definition: evmc.hpp:556
+
Result call(const evmc_message &message) noexcept final
Call callback function.
Definition: evmc.hpp:569
+
bool selfdestruct(const address &addr, const address &beneficiary) noexcept final
Selfdestruct callback function.
Definition: evmc.hpp:564
+
evmc_access_status access_account(const address &address) noexcept final
Access account callback function.
Definition: evmc.hpp:591
+
void set_transient_storage(const address &address, const bytes32 &key, const bytes32 &value) noexcept final
Set transient storage callback function.
Definition: evmc.hpp:606
+
bytes32 get_block_hash(int64_t number) const noexcept final
Get block hash callback function.
Definition: evmc.hpp:577
+
void emit_log(const address &addr, const uint8_t *data, size_t data_size, const bytes32 topics[], size_t topics_count) noexcept final
Emit log callback function.
Definition: evmc.hpp:582
+
evmc_storage_status set_storage(const address &address, const bytes32 &key, const bytes32 &value) noexcept final
Set storage callback function.
Definition: evmc.hpp:534
+
bytes32 get_transient_storage(const address &address, const bytes32 &key) const noexcept final
Get transient storage callback function.
Definition: evmc.hpp:601
+
evmc_tx_context get_tx_context() const noexcept final
Get transaction context callback function.
Definition: evmc.hpp:575
+
bytes32 get_storage(const address &address, const bytes32 &key) const noexcept final
Get storage callback function.
Definition: evmc.hpp:529
+
The EVMC Host interface.
Definition: evmc.hpp:439
+
virtual bytes32 get_transient_storage(const address &addr, const bytes32 &key) const noexcept=0
Get transient storage callback function.
+
virtual bytes32 get_storage(const address &addr, const bytes32 &key) const noexcept=0
Get storage callback function.
+
virtual Result call(const evmc_message &msg) noexcept=0
Call callback function.
+
virtual void emit_log(const address &addr, const uint8_t *data, size_t data_size, const bytes32 topics[], size_t num_topics) noexcept=0
Emit log callback function.
+
virtual bool selfdestruct(const address &addr, const address &beneficiary) noexcept=0
Selfdestruct callback function.
+
virtual evmc_tx_context get_tx_context() const noexcept=0
Get transaction context callback function.
+
virtual bytes32 get_code_hash(const address &addr) const noexcept=0
Get code hash callback function.
+
virtual size_t get_code_size(const address &addr) const noexcept=0
Get code size callback function.
+
virtual evmc_storage_status set_storage(const address &addr, const bytes32 &key, const bytes32 &value) noexcept=0
Set storage callback function.
+
virtual bytes32 get_block_hash(int64_t block_number) const noexcept=0
Get block hash callback function.
+
virtual evmc_access_status access_account(const address &addr) noexcept=0
Access account callback function.
+
virtual evmc_access_status access_storage(const address &addr, const bytes32 &key) noexcept=0
Access storage callback function.
+
virtual uint256be get_balance(const address &addr) const noexcept=0
Get balance callback function.
+
virtual size_t copy_code(const address &addr, size_t code_offset, uint8_t *buffer_data, size_t buffer_size) const noexcept=0
Copy code callback function.
+
virtual void set_transient_storage(const address &addr, const bytes32 &key, const bytes32 &value) noexcept=0
Set transient storage callback function.
+
virtual bool account_exists(const address &addr) const noexcept=0
Check account existence callback function.
+
Abstract class to be used by Host implementations.
Definition: evmc.hpp:621
+
static DerivedClass * from_context(evmc_host_context *context) noexcept
Converts the opaque host context pointer back to the original Host object.
Definition: evmc.hpp:636
+
evmc_host_context * to_context() noexcept
Converts the Host object to the opaque host context pointer.
Definition: evmc.hpp:629
+
static const evmc_host_interface & get_interface() noexcept
Provides access to the global host interface.
Definition: evmc.hpp:882
+
The EVM code execution result.
Definition: evmc.hpp:329
+
Result(evmc_status_code _status_code, int64_t _gas_left, int64_t _gas_refund, const uint8_t *_output_data, size_t _output_size) noexcept
Creates the result from the provided arguments.
Definition: evmc.hpp:348
+
~Result() noexcept
Destructor responsible for automatically releasing attached resources.
Definition: evmc.hpp:388
+
evmc_result & raw() noexcept
Access the result object as a referenced to evmc_result.
Definition: evmc.hpp:415
+
Result(evmc_status_code _status_code=EVMC_INTERNAL_ERROR, int64_t _gas_left=0, int64_t _gas_refund=0) noexcept
Creates the result without output.
Definition: evmc.hpp:361
+
Result(const evmc_result &res) noexcept
Converting constructor from raw evmc_result.
Definition: evmc.hpp:385
+
Result(Result &&other) noexcept
Move constructor.
Definition: evmc.hpp:395
+
Result(evmc_status_code _status_code, int64_t _gas_left, int64_t _gas_refund, const evmc_address &_create_address) noexcept
Creates the result of contract creation.
Definition: evmc.hpp:373
+
evmc_result release_raw() noexcept
Releases the ownership and returns the raw copy of evmc_result.
Definition: evmc.hpp:428
+
evmc_address create_address
The address of the possibly created contract.
Definition: evmc.h:486
+
Result & operator=(Result &&other) noexcept
Move assignment operator.
Definition: evmc.hpp:406
+
const evmc_result & raw() const noexcept
Access the result object as a const referenced to evmc_result.
Definition: evmc.hpp:418
+
The VM instance.
Definition: evmc.hpp:652
+
Result execute(evmc_revision rev, const evmc_message &msg, const uint8_t *code, size_t code_size) noexcept
Executes code without the Host context.
Definition: evmc.hpp:745
+
VM & operator=(VM &&other) noexcept
Move assignment operator.
Definition: evmc.hpp:673
+
evmc_set_option_result set_option(const char name[], const char value[]) noexcept
Sets the option for the VM, if the feature is supported by the VM.
Definition: evmc.hpp:711
+
~VM() noexcept
Destructor responsible for automatically destroying the VM instance.
Definition: evmc.hpp:660
+
Result execute(Host &host, evmc_revision rev, const evmc_message &msg, const uint8_t *code, size_t code_size) noexcept
Convenient variant of the VM::execute() that takes reference to evmc::Host class.
Definition: evmc.hpp:728
+
bool is_abi_compatible() const noexcept
Checks whenever the VM instance is ABI compatible with the current EVMC API.
Definition: evmc.hpp:690
+
bool has_capability(evmc_capabilities capability) const noexcept
Checks if the VM has the given capability.
Definition: evmc.hpp:699
+
VM(VM &&other) noexcept
Move constructor.
Definition: evmc.hpp:670
+
evmc_vm * get_raw_pointer() const noexcept
Returns the pointer to C EVMC struct representing the VM.
Definition: evmc.hpp:759
+
char const * name() const noexcept
The name of the EVMC VM implementation.
Definition: evmc.hpp:693
+
Result execute(const evmc_host_interface &host, evmc_host_context *ctx, evmc_revision rev, const evmc_message &msg, const uint8_t *code, size_t code_size) noexcept
Executes code in the VM instance.
Definition: evmc.hpp:717
+
char const * version() const noexcept
The version of the EVMC VM implementation, e.g.
Definition: evmc.hpp:696
+
evmc_capabilities_flagset get_capabilities() const noexcept
A method returning capabilities supported by the VM instance.
Definition: evmc.hpp:705
+
VM(evmc_vm *vm) noexcept
Converting constructor from evmc_vm.
Definition: evmc.hpp:657
+ +
constexpr auto offset_basis
The 64-bit FNV offset basis.
Definition: evmc.hpp:160
+
std::ostream & operator<<(std::ostream &os, evmc_status_code status_code)
"Stream out" operator implementation for evmc_status_code.
Definition: evmc.hpp:911
+
constexpr uint64_t fnv1a_by64(uint64_t h, uint64_t x) noexcept
The hashing transformation for 64-bit inputs based on the FNV-1a formula.
Definition: evmc.hpp:163
+
constexpr T parse(std::string_view s) noexcept
Converts a raw literal into value of type T.
Definition: evmc.hpp:287
+
constexpr auto prime
The 64-bit FNV prime number.
Definition: evmc.hpp:159
+
evmc_set_option_result
Possible outcomes of evmc_set_option.
Definition: evmc.h:910
+
evmc_capabilities
Possible capabilities of a VM.
Definition: evmc.h:1091
+
evmc_status_code
The execution status code.
Definition: evmc.h:284
+
uint32_t evmc_capabilities_flagset
Alias for unsigned integer representing a set of bit flags of EVMC capabilities.
Definition: evmc.h:1120
+
evmc_access_status
Access status per EIP-2929: Gas cost increases for state access opcodes.
Definition: evmc.h:784
+
evmc_storage_status
The effect of an attempt to modify a contract storage item.
Definition: evmc.h:569
+
evmc_revision
EVM revision.
Definition: evmc.h:941
+
@ EVMC_ABI_VERSION
The EVMC ABI version number of the interface declared in this file.
Definition: evmc.h:47
+
@ EVMC_INTERNAL_ERROR
EVM implementation generic internal error.
Definition: evmc.h:374
+
@ EVMC_LATEST_STABLE_REVISION
The latest known EVM revision with finalized specification.
Definition: evmc.h:1057
+
@ EVMC_MAX_REVISION
The maximum EVM revision supported.
Definition: evmc.h:1050
+
static struct evmc_result evmc_make_result(enum evmc_status_code status_code, int64_t gas_left, int64_t gas_refund, const uint8_t *output_data, size_t output_size)
Creates the result from the provided arguments.
Definition: helpers.h:127
+
static const char * evmc_revision_to_string(enum evmc_revision rev)
Returns the name of the evmc_revision.
Definition: helpers.h:272
+
static const char * evmc_status_code_to_string(enum evmc_status_code status_code)
Returns text representation of the evmc_status_code.
Definition: helpers.h:221
+
static enum evmc_set_option_result evmc_set_option(struct evmc_vm *vm, char const *name, char const *value)
Sets the option for the VM, if the feature is supported by the VM.
Definition: helpers.h:78
+ +
EVMC C++ API - wrappers and bindings for C++.
Definition: bytes.hpp:12
+
constexpr bool operator<(const address &a, const address &b) noexcept
The "less than" comparison operator for the evmc::address type.
Definition: evmc.hpp:185
+
constexpr uint64_t load64be(const uint8_t *data) noexcept
Loads 64 bits / 8 bytes of data from the given data array in big-endian order.
Definition: evmc.hpp:128
+
constexpr uint32_t load32be(const uint8_t *data) noexcept
Loads 32 bits / 4 bytes of data from the given data array in big-endian order.
Definition: evmc.hpp:144
+
constexpr bool operator==(const address &a, const address &b) noexcept
The "equal to" comparison operator for the evmc::address type.
Definition: evmc.hpp:171
+
constexpr bool operator>(const address &a, const address &b) noexcept
The "greater than" comparison operator for the evmc::address type.
Definition: evmc.hpp:195
+
const char * to_string(evmc_status_code status_code) noexcept
Returns text representation of the evmc_status_code.
Definition: evmc.hpp:309
+
std::basic_string_view< unsigned char, byte_traits< unsigned char > > bytes_view
String view of unsigned chars representing bytes.
Definition: bytes.hpp:92
+
constexpr auto make_result
Alias for evmc_make_result().
Definition: evmc.hpp:322
+
constexpr bool operator>=(const address &a, const address &b) noexcept
The "greater than or equal to" comparison operator for the evmc::address type.
Definition: evmc.hpp:207
+
constexpr bool operator<=(const address &a, const address &b) noexcept
The "less than or equal to" comparison operator for the evmc::address type.
Definition: evmc.hpp:201
+
constexpr uint64_t load64le(const uint8_t *data) noexcept
Loads 64 bits / 8 bytes of data from the given data array in little-endian order.
Definition: evmc.hpp:136
+
constexpr bool operator!=(const address &a, const address &b) noexcept
The "not equal to" comparison operator for the evmc::address type.
Definition: evmc.hpp:179
+
constexpr uint32_t load32le(const uint8_t *data) noexcept
Loads 32 bits / 4 bytes of data from the given data array in little-endian order.
Definition: evmc.hpp:151
+
constexpr bool is_zero(const address &a) noexcept
Checks if the given address is the zero address.
Definition: evmc.hpp:258
+
The big-endian 160-bit hash suitable for keeping an Ethereum address.
Definition: evmc.hpp:27
+
constexpr address(evmc_address init={}) noexcept
Default and converting constructor.
Definition: evmc.hpp:31
+
constexpr address(uint64_t v) noexcept
Converting constructor from unsigned integer value.
Definition: evmc.hpp:37
+
The fixed size array of 32 bytes for storing 256-bit EVM values.
Definition: evmc.hpp:71
+
constexpr bytes32(evmc_bytes32 init={}) noexcept
Default and converting constructor.
Definition: evmc.hpp:75
+
constexpr bytes32(uint64_t v) noexcept
Converting constructor from unsigned integer value.
Definition: evmc.hpp:81
+
Big-endian 160-bit hash suitable for keeping an Ethereum address.
Definition: evmc.h:69
+
uint8_t bytes[20]
The 20 bytes of the hash.
Definition: evmc.h:71
+
The fixed size array of 32 bytes.
Definition: evmc.h:57
+
uint8_t bytes[32]
The 32 bytes.
Definition: evmc.h:59
+
The opaque data type representing the Host execution context.
+
The Host interface.
Definition: evmc.h:845
+
evmc_get_code_hash_fn get_code_hash
Get code hash callback function.
Definition: evmc.h:862
+
evmc_call_fn call
Call callback function.
Definition: evmc.h:871
+
evmc_selfdestruct_fn selfdestruct
Selfdestruct callback function.
Definition: evmc.h:868
+
evmc_get_storage_fn get_storage
Get storage callback function.
Definition: evmc.h:850
+
evmc_copy_code_fn copy_code
Copy code callback function.
Definition: evmc.h:865
+
evmc_get_code_size_fn get_code_size
Get code size callback function.
Definition: evmc.h:859
+
evmc_get_transient_storage_fn get_transient_storage
Get transient storage callback function.
Definition: evmc.h:889
+
evmc_set_transient_storage_fn set_transient_storage
Set transient storage callback function.
Definition: evmc.h:892
+
evmc_get_block_hash_fn get_block_hash
Get block hash callback function.
Definition: evmc.h:877
+
evmc_emit_log_fn emit_log
Emit log callback function.
Definition: evmc.h:880
+
evmc_account_exists_fn account_exists
Check account existence callback function.
Definition: evmc.h:847
+
evmc_access_account_fn access_account
Access account callback function.
Definition: evmc.h:883
+
evmc_get_balance_fn get_balance
Get balance callback function.
Definition: evmc.h:856
+
evmc_set_storage_fn set_storage
Set storage callback function.
Definition: evmc.h:853
+
evmc_get_tx_context_fn get_tx_context
Get transaction context callback function.
Definition: evmc.h:874
+
evmc_access_storage_fn access_storage
Access storage callback function.
Definition: evmc.h:886
+
The message describing an EVM call, including a zero-depth calls from a transaction origin.
Definition: evmc.h:98
+
The EVM code execution result.
Definition: evmc.h:416
+
const uint8_t * output_data
The reference to output data.
Definition: evmc.h:448
+
enum evmc_status_code status_code
The execution status code.
Definition: evmc.h:418
+
evmc_release_result_fn release
The method releasing all resources associated with the result object.
Definition: evmc.h:476
+
int64_t gas_refund
The refunded gas accumulated from this execution and its sub-calls.
Definition: evmc.h:434
+
size_t output_size
The size of the output data.
Definition: evmc.h:455
+
evmc_address create_address
The address of the possibly created contract.
Definition: evmc.h:486
+
int64_t gas_left
The amount of gas left after the execution.
Definition: evmc.h:426
+
The transaction and block data for execution.
Definition: evmc.h:214
+
The VM instance.
Definition: evmc.h:1140
+
+
+ + + + diff --git a/example__vm_8cpp.html b/example__vm_8cpp.html new file mode 100644 index 000000000..3c544b94e --- /dev/null +++ b/example__vm_8cpp.html @@ -0,0 +1,106 @@ + + + + + + + +EVMC: examples/example_vm/example_vm.cpp File Reference + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ +
example_vm.cpp File Reference
+
+
+ +

Example implementation of the EVMC VM interface. +More...

+
#include "example_vm.h"
+#include <evmc/evmc.h>
+#include <evmc/helpers.h>
+#include <evmc/instructions.h>
+#include <algorithm>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
+

Go to the source code of this file.

+ + + + + +

+Functions

evmc_vmevmc_create_example_vm ()
 Example of a function creating an instance of an example EVM implementation.
 
+

Detailed Description

+

Example implementation of the EVMC VM interface.

+

This VM implements a subset of EVM instructions in simplistic, incorrect and unsafe way:

    +
  • memory bounds are not checked,
  • +
  • stack bounds are not checked,
  • +
  • most of the operations are done with 32-bit precision (instead of EVM 256-bit precision). Yet, it is capable of coping with some example EVM bytecode inputs, which is very useful in integration testing. The implementation is done in simple C++ for readability and uses pure C API and some C helpers.
  • +
+ +

Definition in file example_vm.cpp.

+
+
+ + + + diff --git a/example__vm_8cpp.js b/example__vm_8cpp.js new file mode 100644 index 000000000..b94cbe7bf --- /dev/null +++ b/example__vm_8cpp.js @@ -0,0 +1,4 @@ +var example__vm_8cpp = +[ + [ "evmc_create_example_vm", "group__EVMC.html#ga4ba5aae5d0250d9c4f6987a78602e795", null ] +]; \ No newline at end of file diff --git a/example__vm_8cpp_source.html b/example__vm_8cpp_source.html new file mode 100644 index 000000000..30ade5152 --- /dev/null +++ b/example__vm_8cpp_source.html @@ -0,0 +1,468 @@ + + + + + + + +EVMC: examples/example_vm/example_vm.cpp Source File + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
example_vm.cpp
+
+
+Go to the documentation of this file.
1// EVMC: Ethereum Client-VM Connector API.
+
2// Copyright 2016 The EVMC Authors.
+
3// Licensed under the Apache License, Version 2.0.
+
4
+
15
+
16#include "example_vm.h"
+
17#include <evmc/evmc.h>
+
18#include <evmc/helpers.h>
+
19#include <evmc/instructions.h>
+
20#include <algorithm>
+
21#include <cstdio>
+
22#include <cstdlib>
+
23#include <cstring>
+
24
+
28namespace
+
29{
+
31struct ExampleVM : evmc_vm
+
32{
+
33 int verbose = 0;
+
34 ExampleVM();
+
35};
+
36
+
38void destroy(evmc_vm* instance)
+
39{
+
40 delete static_cast<ExampleVM*>(instance);
+
41}
+
42
+
44evmc_capabilities_flagset get_capabilities(evmc_vm* /*instance*/)
+
45{
+ +
47}
+
48
+
53enum evmc_set_option_result set_option(evmc_vm* instance, const char* name, const char* value)
+
54{
+
55 auto* vm = static_cast<ExampleVM*>(instance);
+
56 if (std::strcmp(name, "verbose") == 0)
+
57 {
+
58 if (value == nullptr)
+
59 return EVMC_SET_OPTION_INVALID_VALUE;
+
60
+
61 char* end = nullptr;
+
62 auto v = std::strtol(value, &end, 0);
+
63 if (end == value) // Parsing the value failed.
+
64 return EVMC_SET_OPTION_INVALID_VALUE;
+
65 if (v > 9 || v < -1) // Not in the valid range.
+
66 return EVMC_SET_OPTION_INVALID_VALUE;
+
67 vm->verbose = static_cast<int>(v);
+
68 return EVMC_SET_OPTION_SUCCESS;
+
69 }
+
70
+
71 return EVMC_SET_OPTION_INVALID_NAME;
+
72}
+
73
+
75struct Stack
+
76{
+
77 evmc_uint256be items[1024] = {};
+
78 evmc_uint256be* pointer = items;
+
79
+
81 evmc_uint256be pop() { return *--pointer; }
+
82
+
84 void push(evmc_uint256be value) { *pointer++ = value; }
+
85};
+
86
+
88struct Memory
+
89{
+
90 uint32_t size = 0;
+
91 uint8_t data[1024] = {};
+
92
+
98 uint8_t* expand(uint32_t offset, uint32_t region_size)
+
99 {
+
100 uint32_t new_size = offset + region_size;
+
101 if (new_size > sizeof(data))
+
102 return nullptr; // Cannot expand more than fixed max memory size.
+
103
+
104 if (new_size > size)
+
105 size = new_size; // Update current memory size.
+
106
+
107 return &data[offset];
+
108 }
+
109
+
113 bool store(uint32_t offset, const uint8_t* value_data, uint32_t value_size)
+
114 {
+
115 uint8_t* p = expand(offset, value_size);
+
116 if (p == nullptr)
+
117 return false;
+
118
+
119 std::memcpy(p, value_data, value_size);
+
120 return true;
+
121 }
+
122};
+
123
+
125inline evmc_uint256be to_uint256(uint32_t x)
+
126{
+
127 evmc_uint256be value = {};
+
128 value.bytes[31] = static_cast<uint8_t>(x);
+
129 value.bytes[30] = static_cast<uint8_t>(x >> 8);
+
130 value.bytes[29] = static_cast<uint8_t>(x >> 16);
+
131 value.bytes[28] = static_cast<uint8_t>(x >> 24);
+
132 return value;
+
133}
+
134
+
136inline evmc_uint256be to_uint256(evmc_address address)
+
137{
+
138 evmc_uint256be value = {};
+
139 size_t offset = sizeof(value) - sizeof(address);
+
140 std::memcpy(&value.bytes[offset], address.bytes, sizeof(address.bytes));
+
141 return value;
+
142}
+
143
+
145inline uint32_t to_uint32(evmc_uint256be value)
+
146{
+
147 return (uint32_t{value.bytes[28]} << 24) | (uint32_t{value.bytes[29]} << 16) |
+
148 (uint32_t{value.bytes[30]} << 8) | (uint32_t{value.bytes[31]});
+
149}
+
150
+
152inline evmc_address to_address(evmc_uint256be value)
+
153{
+
154 evmc_address address = {};
+
155 size_t offset = sizeof(value) - sizeof(address);
+
156 std::memcpy(address.bytes, &value.bytes[offset], sizeof(address.bytes));
+
157 return address;
+
158}
+
159
+
160
+
162evmc_result execute(evmc_vm* instance,
+
163 const evmc_host_interface* host,
+
164 evmc_host_context* context,
+
165 enum evmc_revision rev,
+
166 const evmc_message* msg,
+
167 const uint8_t* code,
+
168 size_t code_size)
+
169{
+
170 auto* vm = static_cast<ExampleVM*>(instance);
+
171
+
172 if (vm->verbose > 0)
+
173 std::puts("execution started\n");
+
174
+
175 int64_t gas_left = msg->gas;
+
176 Stack stack;
+
177 Memory memory;
+
178
+
179 for (size_t pc = 0; pc < code_size; ++pc)
+
180 {
+
181 // Check remaining gas, assume each instruction costs 1.
+
182 gas_left -= 1;
+
183 if (gas_left < 0)
+
184 return evmc_make_result(EVMC_OUT_OF_GAS, 0, 0, nullptr, 0);
+
185
+
186 switch (code[pc])
+
187 {
+
188 default:
+
189 return evmc_make_result(EVMC_UNDEFINED_INSTRUCTION, 0, 0, nullptr, 0);
+
190
+
191 case OP_STOP:
+
192 return evmc_make_result(EVMC_SUCCESS, gas_left, 0, nullptr, 0);
+
193
+
194 case OP_ADD:
+
195 {
+
196 uint32_t a = to_uint32(stack.pop());
+
197 uint32_t b = to_uint32(stack.pop());
+
198 uint32_t sum = a + b;
+
199 stack.push(to_uint256(sum));
+
200 break;
+
201 }
+
202
+
203 case OP_ADDRESS:
+
204 {
+
205 evmc_uint256be value = to_uint256(msg->recipient);
+
206 stack.push(value);
+
207 break;
+
208 }
+
209
+
210 case OP_CALLDATALOAD:
+
211 {
+
212 uint32_t offset = to_uint32(stack.pop());
+
213 evmc_uint256be value = {};
+
214
+
215 if (offset < msg->input_size)
+
216 {
+
217 size_t copy_size = std::min(msg->input_size - offset, sizeof(value));
+
218 std::memcpy(value.bytes, &msg->input_data[offset], copy_size);
+
219 }
+
220
+
221 stack.push(value);
+
222 break;
+
223 }
+
224
+
225 case OP_NUMBER:
+
226 {
+
227 evmc_uint256be value =
+
228 to_uint256(static_cast<uint32_t>(host->get_tx_context(context).block_number));
+
229 stack.push(value);
+
230 break;
+
231 }
+
232
+
233 case OP_MSTORE:
+
234 {
+
235 uint32_t index = to_uint32(stack.pop());
+
236 evmc_uint256be value = stack.pop();
+
237 if (!memory.store(index, value.bytes, sizeof(value)))
+
238 return evmc_make_result(EVMC_FAILURE, 0, 0, nullptr, 0);
+
239 break;
+
240 }
+
241
+
242 case OP_SLOAD:
+
243 {
+
244 evmc_uint256be index = stack.pop();
+
245 evmc_uint256be value = host->get_storage(context, &msg->recipient, &index);
+
246 stack.push(value);
+
247 break;
+
248 }
+
249
+
250 case OP_SSTORE:
+
251 {
+
252 evmc_uint256be index = stack.pop();
+
253 evmc_uint256be value = stack.pop();
+
254 host->set_storage(context, &msg->recipient, &index, &value);
+
255 break;
+
256 }
+
257
+
258 case OP_MSIZE:
+
259 {
+
260 evmc_uint256be value = to_uint256(memory.size);
+
261 stack.push(value);
+
262 break;
+
263 }
+
264
+
265 case OP_PUSH1:
+
266 case OP_PUSH2:
+
267 case OP_PUSH3:
+
268 case OP_PUSH4:
+
269 case OP_PUSH5:
+
270 case OP_PUSH6:
+
271 case OP_PUSH7:
+
272 case OP_PUSH8:
+
273 case OP_PUSH9:
+
274 case OP_PUSH10:
+
275 case OP_PUSH11:
+
276 case OP_PUSH12:
+
277 case OP_PUSH13:
+
278 case OP_PUSH14:
+
279 case OP_PUSH15:
+
280 case OP_PUSH16:
+
281 case OP_PUSH17:
+
282 case OP_PUSH18:
+
283 case OP_PUSH19:
+
284 case OP_PUSH20:
+
285 case OP_PUSH21:
+
286 case OP_PUSH22:
+
287 case OP_PUSH23:
+
288 case OP_PUSH24:
+
289 case OP_PUSH25:
+
290 case OP_PUSH26:
+
291 case OP_PUSH27:
+
292 case OP_PUSH28:
+
293 case OP_PUSH29:
+
294 case OP_PUSH30:
+
295 case OP_PUSH31:
+
296 case OP_PUSH32:
+
297 {
+
298 evmc_uint256be value = {};
+
299 size_t num_push_bytes = size_t{code[pc]} - OP_PUSH1 + 1;
+
300 size_t offset = sizeof(value) - num_push_bytes;
+
301 std::memcpy(&value.bytes[offset], &code[pc + 1], num_push_bytes);
+
302 pc += num_push_bytes;
+
303 stack.push(value);
+
304 break;
+
305 }
+
306
+
307 case OP_DUP1:
+
308 {
+
309 evmc_uint256be value = stack.pop();
+
310 stack.push(value);
+
311 stack.push(value);
+
312 break;
+
313 }
+
314
+
315 case OP_CALL:
+
316 {
+
317 evmc_message call_msg = {};
+
318 call_msg.gas = to_uint32(stack.pop());
+
319 call_msg.recipient = to_address(stack.pop());
+
320 call_msg.value = stack.pop();
+
321
+
322 uint32_t call_input_offset = to_uint32(stack.pop());
+
323 uint32_t call_input_size = to_uint32(stack.pop());
+
324 call_msg.input_data = memory.expand(call_input_offset, call_input_size);
+
325 call_msg.input_size = call_input_size;
+
326
+
327 uint32_t call_output_offset = to_uint32(stack.pop());
+
328 uint32_t call_output_size = to_uint32(stack.pop());
+
329 uint8_t* call_output_ptr = memory.expand(call_output_offset, call_output_size);
+
330
+
331 if (call_msg.input_data == nullptr || call_output_ptr == nullptr)
+
332 return evmc_make_result(EVMC_FAILURE, 0, 0, nullptr, 0);
+
333
+
334 evmc_result call_result = host->call(context, &call_msg);
+
335
+
336 evmc_uint256be value = to_uint256(call_result.status_code == EVMC_SUCCESS ? 1 : 0);
+
337 stack.push(value);
+
338
+
339 if (call_output_size > call_result.output_size)
+
340 call_output_size = static_cast<uint32_t>(call_result.output_size);
+
341 memory.store(call_output_offset, call_result.output_data, call_output_size);
+
342
+
343 if (call_result.release != nullptr)
+
344 call_result.release(&call_result);
+
345 break;
+
346 }
+
347
+
348 case OP_RETURN:
+
349 {
+
350 uint32_t output_offset = to_uint32(stack.pop());
+
351 uint32_t output_size = to_uint32(stack.pop());
+
352 uint8_t* output_ptr = memory.expand(output_offset, output_size);
+
353 if (output_ptr == nullptr)
+
354 return evmc_make_result(EVMC_FAILURE, 0, 0, nullptr, 0);
+
355
+
356 return evmc_make_result(EVMC_SUCCESS, gas_left, 0, output_ptr, output_size);
+
357 }
+
358
+
359 case OP_REVERT:
+
360 {
+
361 if (rev < EVMC_BYZANTIUM)
+
362 return evmc_make_result(EVMC_UNDEFINED_INSTRUCTION, 0, 0, nullptr, 0);
+
363
+
364 uint32_t output_offset = to_uint32(stack.pop());
+
365 uint32_t output_size = to_uint32(stack.pop());
+
366 uint8_t* output_ptr = memory.expand(output_offset, output_size);
+
367 if (output_ptr == nullptr)
+
368 return evmc_make_result(EVMC_FAILURE, 0, 0, nullptr, 0);
+
369
+
370 return evmc_make_result(EVMC_REVERT, gas_left, 0, output_ptr, output_size);
+
371 }
+
372 }
+
373 }
+
374
+
375 return evmc_make_result(EVMC_SUCCESS, gas_left, 0, nullptr, 0);
+
376}
+
377
+
378
+
380#if !defined(PROJECT_VERSION)
+
382#define PROJECT_VERSION "0.0.0"
+
383#endif
+
385
+
386ExampleVM::ExampleVM()
+
387 : evmc_vm{EVMC_ABI_VERSION, "example_vm", PROJECT_VERSION, ::destroy,
+
388 ::execute, ::get_capabilities, ::set_option}
+
389{}
+
390} // namespace
+
391
+ +
393{
+
394 return new ExampleVM;
+
395}
+ +
evmc_set_option_result
Possible outcomes of evmc_set_option.
Definition: evmc.h:910
+
evmc_vm * evmc_create_example_vm()
Example of a function creating an instance of an example EVM implementation.
Definition: example_vm.cpp:392
+
uint32_t evmc_capabilities_flagset
Alias for unsigned integer representing a set of bit flags of EVMC capabilities.
Definition: evmc.h:1120
+
evmc_revision
EVM revision.
Definition: evmc.h:941
+
@ EVMC_ABI_VERSION
The EVMC ABI version number of the interface declared in this file.
Definition: evmc.h:47
+
@ EVMC_CAPABILITY_EVM1
The VM is capable of executing EVM1 bytecode.
Definition: evmc.h:1095
+
@ EVMC_UNDEFINED_INSTRUCTION
An undefined instruction has been encountered.
Definition: evmc.h:313
+
@ EVMC_SUCCESS
Execution finished with success.
Definition: evmc.h:286
+
@ EVMC_OUT_OF_GAS
The execution has run out of gas.
Definition: evmc.h:300
+
@ EVMC_FAILURE
Generic execution failure.
Definition: evmc.h:289
+
@ EVMC_REVERT
Execution terminated with REVERT opcode.
Definition: evmc.h:297
+
@ EVMC_BYZANTIUM
The Byzantium revision.
Definition: evmc.h:975
+
static struct evmc_result evmc_make_result(enum evmc_status_code status_code, int64_t gas_left, int64_t gas_refund, const uint8_t *output_data, size_t output_size)
Creates the result from the provided arguments.
Definition: helpers.h:127
+ + +
Big-endian 160-bit hash suitable for keeping an Ethereum address.
Definition: evmc.h:69
+
uint8_t bytes[20]
The 20 bytes of the hash.
Definition: evmc.h:71
+
The fixed size array of 32 bytes.
Definition: evmc.h:57
+
uint8_t bytes[32]
The 32 bytes.
Definition: evmc.h:59
+
The opaque data type representing the Host execution context.
+
The Host interface.
Definition: evmc.h:845
+
evmc_call_fn call
Call callback function.
Definition: evmc.h:871
+
evmc_get_storage_fn get_storage
Get storage callback function.
Definition: evmc.h:850
+
evmc_set_storage_fn set_storage
Set storage callback function.
Definition: evmc.h:853
+
evmc_get_tx_context_fn get_tx_context
Get transaction context callback function.
Definition: evmc.h:874
+
The message describing an EVM call, including a zero-depth calls from a transaction origin.
Definition: evmc.h:98
+
const uint8_t * input_data
The message input data.
Definition: evmc.h:152
+
size_t input_size
The size of the message input data.
Definition: evmc.h:159
+
evmc_address recipient
The recipient of the message.
Definition: evmc.h:133
+
evmc_uint256be value
The amount of Ether transferred with the message.
Definition: evmc.h:167
+
int64_t gas
The amount of gas available to the message execution.
Definition: evmc.h:120
+
The EVM code execution result.
Definition: evmc.h:416
+
const uint8_t * output_data
The reference to output data.
Definition: evmc.h:448
+
enum evmc_status_code status_code
The execution status code.
Definition: evmc.h:418
+
evmc_release_result_fn release
The method releasing all resources associated with the result object.
Definition: evmc.h:476
+
size_t output_size
The size of the output data.
Definition: evmc.h:455
+
The VM instance.
Definition: evmc.h:1140
+
+
+ + + + diff --git a/files.html b/files.html new file mode 100644 index 000000000..159db349d --- /dev/null +++ b/files.html @@ -0,0 +1,94 @@ + + + + + + + +EVMC: File List + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
File List
+
+
+
Here is a list of all documented files with brief descriptions:
+
[detail level 123]
+ + + + + + + + + + + + + + + + +
  examples
  example_vm
 example_vm.cppExample implementation of the EVMC VM interface
  include
  evmc
 bytes.hpp
 evmc.h
 evmc.hpp
 filter_iterator.hpp
 helpers.h
 hex.hpp
 instructions.h
 loader.h
 mocked_host.hpp
 tooling.hpp
 utils.hA collection of helper macros to handle some non-portable features of C/C++ compilers
+
+
+
+ + + + diff --git a/files_dup.js b/files_dup.js new file mode 100644 index 000000000..91c347345 --- /dev/null +++ b/files_dup.js @@ -0,0 +1,5 @@ +var files_dup = +[ + [ "examples", "dir_d28a4824dc47e487b107a5db32ef43c4.html", "dir_d28a4824dc47e487b107a5db32ef43c4" ], + [ "include", "dir_d44c64559bbebec7f509842c48db8b23.html", "dir_d44c64559bbebec7f509842c48db8b23" ] +]; \ No newline at end of file diff --git a/filter__iterator_8hpp_source.html b/filter__iterator_8hpp_source.html new file mode 100644 index 000000000..70fa1127b --- /dev/null +++ b/filter__iterator_8hpp_source.html @@ -0,0 +1,172 @@ + + + + + + + +EVMC: include/evmc/filter_iterator.hpp Source File + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
filter_iterator.hpp
+
+
+
1// EVMC: Ethereum Client-VM Connector API.
+
2// Copyright 2022 The EVMC Authors.
+
3// Licensed under the Apache License, Version 2.0.
+
4#pragma once
+
5
+
6#include <iterator>
+
7
+
8namespace evmc
+
9{
+
11inline constexpr bool isspace(char ch) noexcept
+
12{
+
13 // Implementation taken from LLVM's libc.
+
14 return ch == ' ' || (static_cast<unsigned>(ch) - '\t') < 5;
+
15}
+
16
+
18inline constexpr bool is_not_space(char ch) noexcept
+
19{
+
20 return !isspace(ch);
+
21}
+
22
+
32template <typename BaseIterator,
+
33 bool predicate(typename std::iterator_traits<BaseIterator>::value_type) noexcept>
+ +
35{
+
37 using difference_type = typename std::iterator_traits<BaseIterator>::difference_type;
+
38
+
40 using value_type = typename std::iterator_traits<BaseIterator>::value_type;
+
41
+
43 using pointer = typename std::iterator_traits<BaseIterator>::pointer;
+
44
+
46 using reference = typename std::iterator_traits<BaseIterator>::reference;
+
47
+
49 using iterator_category = std::input_iterator_tag;
+
50
+
51private:
+
52 BaseIterator base;
+
53 BaseIterator base_end;
+
54 value_type value;
+
55
+
56 constexpr void forward_to_next_value() noexcept
+
57 {
+
58 for (; base != base_end; ++base)
+
59 {
+
60 value = *base;
+
61 if (predicate(value))
+
62 break;
+
63 }
+
64 }
+
65
+
66public:
+
68 constexpr filter_iterator(BaseIterator it, BaseIterator end) noexcept : base{it}, base_end{end}
+
69 {
+
70 forward_to_next_value();
+
71 }
+
72
+
74 constexpr auto operator*() noexcept
+
75 {
+
76 // We should not read from an input base iterator twice. So the only read is in
+
77 // forward_to_next_value() and here we return the cached value.
+
78 return value;
+
79 }
+
80
+
82 constexpr void operator++() noexcept
+
83 {
+
84 ++base;
+
85 forward_to_next_value();
+
86 }
+
87
+
89 constexpr bool operator==(const filter_iterator& o) const noexcept { return base == o.base; }
+
90
+
92 constexpr bool operator!=(const filter_iterator& o) const noexcept { return base != o.base; }
+
93};
+
94
+
96template <typename BaseIterator>
+
97struct skip_space_iterator : filter_iterator<BaseIterator, is_not_space>
+
98{
+
99 using filter_iterator<BaseIterator, is_not_space>::filter_iterator;
+
100};
+
101
+
103template <typename BaseIterator>
+ +
105} // namespace evmc
+
EVMC C++ API - wrappers and bindings for C++.
Definition: bytes.hpp:12
+
constexpr bool is_not_space(char ch) noexcept
Checks if a character is not a white space.
+
constexpr bool isspace(char ch) noexcept
The constexpr variant of std::isspace().
+
The filter iterator adaptor creates a view of an iterator range in which some elements of the range a...
+
constexpr void operator++() noexcept
The increment operator.
+
constexpr bool operator!=(const filter_iterator &o) const noexcept
The inequality operator.
+
typename std::iterator_traits< BaseIterator >::reference reference
The iterator reference type.
+
typename std::iterator_traits< BaseIterator >::difference_type difference_type
The iterator difference type.
+
typename std::iterator_traits< BaseIterator >::value_type value_type
The iterator value type.
+
typename std::iterator_traits< BaseIterator >::pointer pointer
The iterator pointer type.
+
constexpr auto operator*() noexcept
The dereference operator.
+
constexpr filter_iterator(BaseIterator it, BaseIterator end) noexcept
The constructor of the base iterator pair.
+
std::input_iterator_tag iterator_category
The iterator category.
+
constexpr bool operator==(const filter_iterator &o) const noexcept
The equality operator.
+
The input filter iterator which skips whitespace characters from the base input iterator.
+
+
+ + + + diff --git a/folderclosed.png b/folderclosed.png new file mode 100644 index 000000000..bb8ab35ed Binary files /dev/null and b/folderclosed.png differ diff --git a/folderopen.png b/folderopen.png new file mode 100644 index 000000000..d6c7f676a Binary files /dev/null and b/folderopen.png differ diff --git a/functions.html b/functions.html new file mode 100644 index 000000000..99cc13aa9 --- /dev/null +++ b/functions.html @@ -0,0 +1,83 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- a -

+
+
+ + + + diff --git a/functions_b.html b/functions_b.html new file mode 100644 index 000000000..7292f257a --- /dev/null +++ b/functions_b.html @@ -0,0 +1,88 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- b -

+
+
+ + + + diff --git a/functions_c.html b/functions_c.html new file mode 100644 index 000000000..647cab2ed --- /dev/null +++ b/functions_c.html @@ -0,0 +1,90 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- c -

+
+
+ + + + diff --git a/functions_d.html b/functions_d.html new file mode 100644 index 000000000..68d2a3e86 --- /dev/null +++ b/functions_d.html @@ -0,0 +1,79 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- d -

+
+
+ + + + diff --git a/functions_dup.js b/functions_dup.js new file mode 100644 index 000000000..221e49c25 --- /dev/null +++ b/functions_dup.js @@ -0,0 +1,23 @@ +var functions_dup = +[ + [ "a", "functions.html", null ], + [ "b", "functions_b.html", null ], + [ "c", "functions_c.html", null ], + [ "d", "functions_d.html", null ], + [ "e", "functions_e.html", null ], + [ "f", "functions_f.html", null ], + [ "g", "functions_g.html", null ], + [ "h", "functions_h.html", null ], + [ "i", "functions_i.html", null ], + [ "k", "functions_k.html", null ], + [ "l", "functions_l.html", null ], + [ "m", "functions_m.html", null ], + [ "n", "functions_n.html", null ], + [ "o", "functions_o.html", null ], + [ "p", "functions_p.html", null ], + [ "r", "functions_r.html", null ], + [ "s", "functions_s.html", null ], + [ "t", "functions_t.html", null ], + [ "v", "functions_v.html", null ], + [ "~", "functions_~.html", null ] +]; \ No newline at end of file diff --git a/functions_e.html b/functions_e.html new file mode 100644 index 000000000..de6ebbadd --- /dev/null +++ b/functions_e.html @@ -0,0 +1,78 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- e -

+
+
+ + + + diff --git a/functions_f.html b/functions_f.html new file mode 100644 index 000000000..aa07ed464 --- /dev/null +++ b/functions_f.html @@ -0,0 +1,79 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- f -

+
+
+ + + + diff --git a/functions_func.html b/functions_func.html new file mode 100644 index 000000000..fa50deea3 --- /dev/null +++ b/functions_func.html @@ -0,0 +1,193 @@ + + + + + + + +EVMC: Class Members - Functions + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+  + +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- e -

+ + +

- f -

+ + +

- g -

+ + +

- h -

+ + +

- i -

+ + +

- l -

+ + +

- m -

+ + +

- n -

+ + +

- o -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- v -

+ + +

- ~ -

+
+
+ + + + diff --git a/functions_g.html b/functions_g.html new file mode 100644 index 000000000..60827134d --- /dev/null +++ b/functions_g.html @@ -0,0 +1,89 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- g -

+
+
+ + + + diff --git a/functions_h.html b/functions_h.html new file mode 100644 index 000000000..6bb599d38 --- /dev/null +++ b/functions_h.html @@ -0,0 +1,78 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- h -

+
+
+ + + + diff --git a/functions_i.html b/functions_i.html new file mode 100644 index 000000000..9b353f9fc --- /dev/null +++ b/functions_i.html @@ -0,0 +1,81 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- i -

+
+
+ + + + diff --git a/functions_k.html b/functions_k.html new file mode 100644 index 000000000..c6bcee4e9 --- /dev/null +++ b/functions_k.html @@ -0,0 +1,76 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- k -

+
+
+ + + + diff --git a/functions_l.html b/functions_l.html new file mode 100644 index 000000000..6af30b3ea --- /dev/null +++ b/functions_l.html @@ -0,0 +1,77 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- l -

+
+
+ + + + diff --git a/functions_m.html b/functions_m.html new file mode 100644 index 000000000..bbc6d884e --- /dev/null +++ b/functions_m.html @@ -0,0 +1,78 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- m -

+
+
+ + + + diff --git a/functions_n.html b/functions_n.html new file mode 100644 index 000000000..968c1da56 --- /dev/null +++ b/functions_n.html @@ -0,0 +1,77 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- n -

+
+
+ + + + diff --git a/functions_o.html b/functions_o.html new file mode 100644 index 000000000..add4a8aed --- /dev/null +++ b/functions_o.html @@ -0,0 +1,85 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- o -

+
+
+ + + + diff --git a/functions_p.html b/functions_p.html new file mode 100644 index 000000000..733302bcc --- /dev/null +++ b/functions_p.html @@ -0,0 +1,77 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- p -

+
+
+ + + + diff --git a/functions_r.html b/functions_r.html new file mode 100644 index 000000000..9aa1b67f2 --- /dev/null +++ b/functions_r.html @@ -0,0 +1,86 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- r -

+
+
+ + + + diff --git a/functions_s.html b/functions_s.html new file mode 100644 index 000000000..6d74e126e --- /dev/null +++ b/functions_s.html @@ -0,0 +1,86 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- s -

+
+
+ + + + diff --git a/functions_t.html b/functions_t.html new file mode 100644 index 000000000..29290bfa0 --- /dev/null +++ b/functions_t.html @@ -0,0 +1,81 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- t -

+
+
+ + + + diff --git a/functions_type.html b/functions_type.html new file mode 100644 index 000000000..495fc2769 --- /dev/null +++ b/functions_type.html @@ -0,0 +1,79 @@ + + + + + + + +EVMC: Class Members - Typedefs + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+ +
+ + + + diff --git a/functions_v.html b/functions_v.html new file mode 100644 index 000000000..897536538 --- /dev/null +++ b/functions_v.html @@ -0,0 +1,79 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- v -

+
+
+ + + + diff --git a/functions_vars.html b/functions_vars.html new file mode 100644 index 000000000..3a70f5c12 --- /dev/null +++ b/functions_vars.html @@ -0,0 +1,229 @@ + + + + + + + +EVMC: Class Members - Variables + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+  + +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- g -

+ + +

- h -

+ + +

- i -

+ + +

- k -

+ + +

- m -

+ + +

- n -

+ + +

- o -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- v -

+
+
+ + + + diff --git a/functions_~.html b/functions_~.html new file mode 100644 index 000000000..909b020e4 --- /dev/null +++ b/functions_~.html @@ -0,0 +1,77 @@ + + + + + + + +EVMC: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- ~ -

+
+
+ + + + diff --git a/globals.html b/globals.html new file mode 100644 index 000000000..56915502c --- /dev/null +++ b/globals.html @@ -0,0 +1,209 @@ + + + + + + + +EVMC: File Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all documented file members with links to the documentation:
+ +

- e -

+ + +

- o -

+
+
+ + + + diff --git a/globals_defs.html b/globals_defs.html new file mode 100644 index 000000000..110be15e8 --- /dev/null +++ b/globals_defs.html @@ -0,0 +1,75 @@ + + + + + + + +EVMC: File Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
+
+ + + + diff --git a/globals_enum.html b/globals_enum.html new file mode 100644 index 000000000..0082c6751 --- /dev/null +++ b/globals_enum.html @@ -0,0 +1,83 @@ + + + + + + + +EVMC: File Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
+
+ + + + diff --git a/globals_eval.html b/globals_eval.html new file mode 100644 index 000000000..00b671def --- /dev/null +++ b/globals_eval.html @@ -0,0 +1,144 @@ + + + + + + + +EVMC: File Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+  + +

- e -

    +
  • EVMC_ABI_VERSION : evmc.h
  • +
  • EVMC_ACCESS_COLD : evmc.h
  • +
  • EVMC_ACCESS_WARM : evmc.h
  • +
  • EVMC_ARGUMENT_OUT_OF_RANGE : evmc.h
  • +
  • EVMC_BAD_JUMP_DESTINATION : evmc.h
  • +
  • EVMC_BERLIN : evmc.h
  • +
  • EVMC_BYZANTIUM : evmc.h
  • +
  • EVMC_CALL : evmc.h
  • +
  • EVMC_CALL_DEPTH_EXCEEDED : evmc.h
  • +
  • EVMC_CALLCODE : evmc.h
  • +
  • EVMC_CANCUN : evmc.h
  • +
  • EVMC_CAPABILITY_EVM1 : evmc.h
  • +
  • EVMC_CAPABILITY_EWASM : evmc.h
  • +
  • EVMC_CAPABILITY_PRECOMPILES : evmc.h
  • +
  • EVMC_CONSTANTINOPLE : evmc.h
  • +
  • EVMC_CONTRACT_VALIDATION_FAILURE : evmc.h
  • +
  • EVMC_CREATE : evmc.h
  • +
  • EVMC_CREATE2 : evmc.h
  • +
  • EVMC_DELEGATECALL : evmc.h
  • +
  • EVMC_EOFCREATE : evmc.h
  • +
  • EVMC_FAILURE : evmc.h
  • +
  • EVMC_FRONTIER : evmc.h
  • +
  • EVMC_HOMESTEAD : evmc.h
  • +
  • EVMC_INSUFFICIENT_BALANCE : evmc.h
  • +
  • EVMC_INTERNAL_ERROR : evmc.h
  • +
  • EVMC_INVALID_INSTRUCTION : evmc.h
  • +
  • EVMC_INVALID_MEMORY_ACCESS : evmc.h
  • +
  • EVMC_ISTANBUL : evmc.h
  • +
  • EVMC_LATEST_STABLE_REVISION : evmc.h
  • +
  • EVMC_LOADER_ABI_VERSION_MISMATCH : loader.h
  • +
  • EVMC_LOADER_CANNOT_OPEN : loader.h
  • +
  • EVMC_LOADER_INVALID_ARGUMENT : loader.h
  • +
  • EVMC_LOADER_INVALID_OPTION_NAME : loader.h
  • +
  • EVMC_LOADER_INVALID_OPTION_VALUE : loader.h
  • +
  • EVMC_LOADER_SUCCESS : loader.h
  • +
  • EVMC_LOADER_SYMBOL_NOT_FOUND : loader.h
  • +
  • EVMC_LOADER_UNSPECIFIED_ERROR : loader.h
  • +
  • EVMC_LOADER_VM_CREATION_FAILURE : loader.h
  • +
  • EVMC_LONDON : evmc.h
  • +
  • EVMC_MAX_REVISION : evmc.h
  • +
  • EVMC_OSAKA : evmc.h
  • +
  • EVMC_OUT_OF_GAS : evmc.h
  • +
  • EVMC_OUT_OF_MEMORY : evmc.h
  • +
  • EVMC_PARIS : evmc.h
  • +
  • EVMC_PETERSBURG : evmc.h
  • +
  • EVMC_PRAGUE : evmc.h
  • +
  • EVMC_PRECOMPILE_FAILURE : evmc.h
  • +
  • EVMC_REJECTED : evmc.h
  • +
  • EVMC_REVERT : evmc.h
  • +
  • EVMC_SHANGHAI : evmc.h
  • +
  • EVMC_SPURIOUS_DRAGON : evmc.h
  • +
  • EVMC_STACK_OVERFLOW : evmc.h
  • +
  • EVMC_STACK_UNDERFLOW : evmc.h
  • +
  • EVMC_STATIC : evmc.h
  • +
  • EVMC_STATIC_MODE_VIOLATION : evmc.h
  • +
  • EVMC_STORAGE_ADDED : evmc.h
  • +
  • EVMC_STORAGE_ADDED_DELETED : evmc.h
  • +
  • EVMC_STORAGE_ASSIGNED : evmc.h
  • +
  • EVMC_STORAGE_DELETED : evmc.h
  • +
  • EVMC_STORAGE_DELETED_ADDED : evmc.h
  • +
  • EVMC_STORAGE_DELETED_RESTORED : evmc.h
  • +
  • EVMC_STORAGE_MODIFIED : evmc.h
  • +
  • EVMC_STORAGE_MODIFIED_DELETED : evmc.h
  • +
  • EVMC_STORAGE_MODIFIED_RESTORED : evmc.h
  • +
  • EVMC_SUCCESS : evmc.h
  • +
  • EVMC_TANGERINE_WHISTLE : evmc.h
  • +
  • EVMC_UNDEFINED_INSTRUCTION : evmc.h
  • +
  • EVMC_WASM_TRAP : evmc.h
  • +
  • EVMC_WASM_UNREACHABLE_INSTRUCTION : evmc.h
  • +
+
+
+ + + + diff --git a/globals_func.html b/globals_func.html new file mode 100644 index 000000000..e20836615 --- /dev/null +++ b/globals_func.html @@ -0,0 +1,95 @@ + + + + + + + +EVMC: File Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
+
+ + + + diff --git a/globals_type.html b/globals_type.html new file mode 100644 index 000000000..0229b28ee --- /dev/null +++ b/globals_type.html @@ -0,0 +1,100 @@ + + + + + + + +EVMC: File Members + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
    +
  • evmc_access_account_fn : evmc.h
  • +
  • evmc_access_storage_fn : evmc.h
  • +
  • evmc_account_exists_fn : evmc.h
  • +
  • evmc_address : evmc.h
  • +
  • evmc_bytes32 : evmc.h
  • +
  • evmc_call_fn : evmc.h
  • +
  • evmc_capabilities_flagset : evmc.h
  • +
  • evmc_copy_code_fn : evmc.h
  • +
  • evmc_create_fn : loader.h
  • +
  • evmc_destroy_fn : evmc.h
  • +
  • evmc_emit_log_fn : evmc.h
  • +
  • evmc_execute_fn : evmc.h
  • +
  • evmc_get_balance_fn : evmc.h
  • +
  • evmc_get_block_hash_fn : evmc.h
  • +
  • evmc_get_capabilities_fn : evmc.h
  • +
  • evmc_get_code_hash_fn : evmc.h
  • +
  • evmc_get_code_size_fn : evmc.h
  • +
  • evmc_get_storage_fn : evmc.h
  • +
  • evmc_get_transient_storage_fn : evmc.h
  • +
  • evmc_get_tx_context_fn : evmc.h
  • +
  • evmc_release_result_fn : evmc.h
  • +
  • evmc_selfdestruct_fn : evmc.h
  • +
  • evmc_set_option_fn : evmc.h
  • +
  • evmc_set_storage_fn : evmc.h
  • +
  • evmc_set_transient_storage_fn : evmc.h
  • +
  • evmc_tx_initcode : evmc.h
  • +
  • evmc_uint256be : evmc.h
  • +
+
+
+ + + + diff --git a/group__EVMC.html b/group__EVMC.html new file mode 100644 index 000000000..66cedf1e1 --- /dev/null +++ b/group__EVMC.html @@ -0,0 +1,1575 @@ + + + + + + + +EVMC: EVMC + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ +
EVMC
+
+
+ +

EVMC: Ethereum Client-VM Connector API. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Classes

struct  evmc_bytes32
 The fixed size array of 32 bytes. More...
 
struct  evmc_address
 Big-endian 160-bit hash suitable for keeping an Ethereum address. More...
 
struct  evmc_message
 The message describing an EVM call, including a zero-depth calls from a transaction origin. More...
 
struct  evmc_tx_initcode
 The hashed initcode used for TXCREATE instruction. More...
 
struct  evmc_tx_context
 The transaction and block data for execution. More...
 
struct  evmc_result
 The EVM code execution result. More...
 
struct  evmc_host_interface
 The Host interface. More...
 
struct  evmc_vm
 The VM instance. More...
 
struct  evmc_host_context
 The opaque data type representing the Host execution context. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Typedefs

typedef struct evmc_bytes32 evmc_bytes32
 The fixed size array of 32 bytes.
 
typedef struct evmc_bytes32 evmc_uint256be
 The alias for evmc_bytes32 to represent a big-endian 256-bit integer.
 
+typedef struct evmc_address evmc_address
 Big-endian 160-bit hash suitable for keeping an Ethereum address.
 
+typedef struct evmc_tx_initcode evmc_tx_initcode
 The hashed initcode used for TXCREATE instruction.
 
typedef struct evmc_tx_context(* evmc_get_tx_context_fn) (struct evmc_host_context *context)
 Get transaction context callback function.
 
typedef evmc_bytes32(* evmc_get_block_hash_fn) (struct evmc_host_context *context, int64_t number)
 Get block hash callback function.
 
typedef void(* evmc_release_result_fn) (const struct evmc_result *result)
 Releases resources assigned to an execution result.
 
typedef bool(* evmc_account_exists_fn) (struct evmc_host_context *context, const evmc_address *address)
 Check account existence callback function.
 
typedef evmc_bytes32(* evmc_get_storage_fn) (struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key)
 Get storage callback function.
 
typedef evmc_bytes32(* evmc_get_transient_storage_fn) (struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key)
 Get transient storage callback function.
 
typedef enum evmc_storage_status(* evmc_set_storage_fn) (struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key, const evmc_bytes32 *value)
 Set storage callback function.
 
typedef void(* evmc_set_transient_storage_fn) (struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key, const evmc_bytes32 *value)
 Set transient storage callback function.
 
typedef evmc_uint256be(* evmc_get_balance_fn) (struct evmc_host_context *context, const evmc_address *address)
 Get balance callback function.
 
typedef size_t(* evmc_get_code_size_fn) (struct evmc_host_context *context, const evmc_address *address)
 Get code size callback function.
 
typedef evmc_bytes32(* evmc_get_code_hash_fn) (struct evmc_host_context *context, const evmc_address *address)
 Get code hash callback function.
 
typedef size_t(* evmc_copy_code_fn) (struct evmc_host_context *context, const evmc_address *address, size_t code_offset, uint8_t *buffer_data, size_t buffer_size)
 Copy code callback function.
 
typedef bool(* evmc_selfdestruct_fn) (struct evmc_host_context *context, const evmc_address *address, const evmc_address *beneficiary)
 Selfdestruct callback function.
 
typedef void(* evmc_emit_log_fn) (struct evmc_host_context *context, const evmc_address *address, const uint8_t *data, size_t data_size, const evmc_bytes32 topics[], size_t topics_count)
 Log callback function.
 
typedef enum evmc_access_status(* evmc_access_account_fn) (struct evmc_host_context *context, const evmc_address *address)
 Access account callback function.
 
typedef enum evmc_access_status(* evmc_access_storage_fn) (struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key)
 Access storage callback function.
 
typedef struct evmc_result(* evmc_call_fn) (struct evmc_host_context *context, const struct evmc_message *msg)
 Pointer to the callback function supporting EVM calls.
 
typedef void(* evmc_destroy_fn) (struct evmc_vm *vm)
 Destroys the VM instance.
 
typedef enum evmc_set_option_result(* evmc_set_option_fn) (struct evmc_vm *vm, char const *name, char const *value)
 Configures the VM instance.
 
typedef struct evmc_result(* evmc_execute_fn) (struct evmc_vm *vm, const struct evmc_host_interface *host, struct evmc_host_context *context, enum evmc_revision rev, const struct evmc_message *msg, uint8_t const *code, size_t code_size)
 Executes the given code using the input from the message.
 
typedef uint32_t evmc_capabilities_flagset
 Alias for unsigned integer representing a set of bit flags of EVMC capabilities.
 
typedef evmc_capabilities_flagset(* evmc_get_capabilities_fn) (struct evmc_vm *vm)
 Return the supported capabilities of the VM instance.
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Enumerations

enum  { EVMC_ABI_VERSION = 12 + }
 
enum  evmc_call_kind {
+  EVMC_CALL = 0 +, EVMC_DELEGATECALL = 1 +, EVMC_CALLCODE = 2 +, EVMC_CREATE = 3 +,
+  EVMC_CREATE2 = 4 +, EVMC_EOFCREATE = 5 +
+ }
 The kind of call-like instruction. More...
 
enum  evmc_flags { EVMC_STATIC = 1 + }
 The flags for evmc_message. More...
 
enum  evmc_status_code {
+  EVMC_SUCCESS = 0 +, EVMC_FAILURE = 1 +, EVMC_REVERT = 2 +, EVMC_OUT_OF_GAS = 3 +,
+  EVMC_INVALID_INSTRUCTION = 4 +, EVMC_UNDEFINED_INSTRUCTION = 5 +, EVMC_STACK_OVERFLOW = 6 +, EVMC_STACK_UNDERFLOW = 7 +,
+  EVMC_BAD_JUMP_DESTINATION = 8 +, EVMC_INVALID_MEMORY_ACCESS = 9 +, EVMC_CALL_DEPTH_EXCEEDED = 10 +, EVMC_STATIC_MODE_VIOLATION = 11 +,
+  EVMC_PRECOMPILE_FAILURE = 12 +, EVMC_CONTRACT_VALIDATION_FAILURE = 13 +, EVMC_ARGUMENT_OUT_OF_RANGE = 14 +, EVMC_WASM_UNREACHABLE_INSTRUCTION = 15 +,
+  EVMC_WASM_TRAP = 16 +, EVMC_INSUFFICIENT_BALANCE = 17 +, EVMC_INTERNAL_ERROR = -1 +, EVMC_REJECTED = -2 +,
+  EVMC_OUT_OF_MEMORY = -3 +
+ }
 The execution status code. More...
 
enum  evmc_storage_status {
+  EVMC_STORAGE_ASSIGNED = 0 +, EVMC_STORAGE_ADDED = 1 +, EVMC_STORAGE_DELETED = 2 +, EVMC_STORAGE_MODIFIED = 3 +,
+  EVMC_STORAGE_DELETED_ADDED = 4 +, EVMC_STORAGE_MODIFIED_DELETED = 5 +, EVMC_STORAGE_DELETED_RESTORED = 6 +, EVMC_STORAGE_ADDED_DELETED = 7 +,
+  EVMC_STORAGE_MODIFIED_RESTORED = 8 +
+ }
 The effect of an attempt to modify a contract storage item. More...
 
enum  evmc_access_status { EVMC_ACCESS_COLD = 0 +, EVMC_ACCESS_WARM = 1 + }
 Access status per EIP-2929: Gas cost increases for state access opcodes. More...
 
enum  evmc_set_option_result { EVMC_SET_OPTION_SUCCESS = 0 +, EVMC_SET_OPTION_INVALID_NAME = 1 +, EVMC_SET_OPTION_INVALID_VALUE = 2 + }
 Possible outcomes of evmc_set_option. More...
 
enum  evmc_revision {
+  EVMC_FRONTIER = 0 +, EVMC_HOMESTEAD = 1 +, EVMC_TANGERINE_WHISTLE = 2 +, EVMC_SPURIOUS_DRAGON = 3 +,
+  EVMC_BYZANTIUM = 4 +, EVMC_CONSTANTINOPLE = 5 +, EVMC_PETERSBURG = 6 +, EVMC_ISTANBUL = 7 +,
+  EVMC_BERLIN = 8 +, EVMC_LONDON = 9 +, EVMC_PARIS = 10 +, EVMC_SHANGHAI = 11 +,
+  EVMC_CANCUN = 12 +, EVMC_PRAGUE = 13 +, EVMC_OSAKA = 14 +, EVMC_MAX_REVISION = EVMC_OSAKA +,
+  EVMC_LATEST_STABLE_REVISION = EVMC_CANCUN +
+ }
 EVM revision. More...
 
enum  evmc_capabilities { EVMC_CAPABILITY_EVM1 = (1u << 0) +, EVMC_CAPABILITY_EWASM = (1u << 1) +, EVMC_CAPABILITY_PRECOMPILES = (1u << 2) + }
 Possible capabilities of a VM. More...
 
+ + + + +

+Functions

struct evmc_vmevmc_create_example_vm (void)
 Example of a function creating an instance of an example EVM implementation.
 
+

Detailed Description

+

EVMC: Ethereum Client-VM Connector API.

+ +

+Terms

+
    +
  1. VM – An Ethereum Virtual Machine instance/implementation.
  2. +
  3. Host – An entity controlling the VM. The Host requests code execution and responses to VM queries by callback functions. This usually represents an Ethereum Client.
  4. +
+

+Responsibilities

+

+VM

+
    +
  • Executes the code (obviously).
  • +
  • Calculates the running gas cost and manages the gas counter except the refund counter.
  • +
  • Controls the call depth, including the exceptional termination of execution in case the maximum depth is reached.
  • +
+

+Host

+
    +
  • Provides access to State.
  • +
  • Creates new accounts (with code being a result of VM execution).
  • +
  • Handles refunds entirely.
  • +
  • Manages the set of precompiled contracts and handles execution of messages coming to them.
  • +
+

Macro Definition Documentation

+ +

◆ EVMC_DEPRECATED

+ +
+
+ + + + +
#define EVMC_DEPRECATED
+
+ +

Definition at line 23 of file evmc.h.

+ +
+
+

Typedef Documentation

+ +

◆ evmc_access_account_fn

+ +
+
+ + + + +
typedef enum evmc_access_status(* evmc_access_account_fn) (struct evmc_host_context *context, const evmc_address *address)
+
+ +

Access account callback function.

+

This callback function is used by a VM to add the given address to accessed_addresses substate (EIP-2929).

+
Parameters
+ + + +
contextThe Host execution context.
addressThe address of the account.
+
+
+
Returns
EVMC_ACCESS_WARM if accessed_addresses already contained the address or EVMC_ACCESS_COLD otherwise.
+ +

Definition at line 773 of file evmc.h.

+ +
+
+ +

◆ evmc_access_storage_fn

+ +
+
+ + + + +
typedef enum evmc_access_status(* evmc_access_storage_fn) (struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key)
+
+ +

Access storage callback function.

+

This callback function is used by a VM to add the given account storage entry to accessed_storage_keys substate (EIP-2929).

+
Parameters
+ + + + +
contextThe Host execution context.
addressThe address of the account.
keyThe index of the account's storage entry.
+
+
+
Returns
EVMC_ACCESS_WARM if accessed_storage_keys already contained the key or EVMC_ACCESS_COLD otherwise.
+ +

Definition at line 773 of file evmc.h.

+ +
+
+ +

◆ evmc_account_exists_fn

+ +
+
+ + + + +
typedef bool(* evmc_account_exists_fn) (struct evmc_host_context *context, const evmc_address *address)
+
+ +

Check account existence callback function.

+

This callback function is used by the VM to check if there exists an account at given address.

Parameters
+ + + +
contextThe pointer to the Host execution context.
addressThe address of the account the query is about.
+
+
+
Returns
true if exists, false otherwise.
+ +

Definition at line 512 of file evmc.h.

+ +
+
+ +

◆ evmc_bytes32

+ +
+
+ + + + +
typedef struct evmc_bytes32 evmc_bytes32
+
+ +

The fixed size array of 32 bytes.

+

32 bytes of data capable of storing e.g. 256-bit hashes.

+ +
+
+ +

◆ evmc_call_fn

+ +
+
+ + + + +
typedef struct evmc_result(* evmc_call_fn) (struct evmc_host_context *context, const struct evmc_message *msg)
+
+ +

Pointer to the callback function supporting EVM calls.

+
Parameters
+ + + +
contextThe pointer to the Host execution context.
msgThe call parameters.
+
+
+
Returns
The result of the call.
+ +

Definition at line 773 of file evmc.h.

+ +
+
+ +

◆ evmc_capabilities_flagset

+ +
+
+ + + + +
typedef uint32_t evmc_capabilities_flagset
+
+ +

Alias for unsigned integer representing a set of bit flags of EVMC capabilities.

+
See also
evmc_capabilities
+ +

Definition at line 1120 of file evmc.h.

+ +
+
+ +

◆ evmc_copy_code_fn

+ +
+
+ + + + +
typedef size_t(* evmc_copy_code_fn) (struct evmc_host_context *context, const evmc_address *address, size_t code_offset, uint8_t *buffer_data, size_t buffer_size)
+
+ +

Copy code callback function.

+

This callback function is used by an EVM to request a copy of the code of the given account to the memory buffer provided by the EVM. The Client MUST copy the requested code, starting with the given offset, to the provided memory buffer up to the size of the buffer or the size of the code, whichever is smaller.

+
Parameters
+ + + + + + +
contextThe pointer to the Host execution context. See evmc_host_context.
addressThe address of the account.
code_offsetThe offset of the code to copy.
buffer_dataThe pointer to the memory buffer allocated by the EVM to store a copy of the requested code.
buffer_sizeThe size of the memory buffer.
+
+
+
Returns
The number of bytes copied to the buffer by the Client.
+ +

Definition at line 738 of file evmc.h.

+ +
+
+ +

◆ evmc_destroy_fn

+ +
+
+ + + + +
typedef void(* evmc_destroy_fn) (struct evmc_vm *vm)
+
+ +

Destroys the VM instance.

+
Parameters
+ + +
vmThe VM instance to be destroyed.
+
+
+ +

Definition at line 904 of file evmc.h.

+ +
+
+ +

◆ evmc_emit_log_fn

+ +
+
+ + + + +
typedef void(* evmc_emit_log_fn) (struct evmc_host_context *context, const evmc_address *address, const uint8_t *data, size_t data_size, const evmc_bytes32 topics[], size_t topics_count)
+
+ +

Log callback function.

+

This callback function is used by an EVM to inform about a LOG that happened during an EVM bytecode execution.

+
Parameters
+ + + + + + + +
contextThe pointer to the Host execution context. See evmc_host_context.
addressThe address of the contract that generated the log.
dataThe pointer to unindexed data attached to the log.
data_sizeThe length of the data.
topicsThe pointer to the array of topics attached to the log.
topics_countThe number of the topics. Valid values are between 0 and 4 inclusively.
+
+
+ +

Definition at line 773 of file evmc.h.

+ +
+
+ +

◆ evmc_execute_fn

+ +
+
+ + + + +
typedef struct evmc_result(* evmc_execute_fn) (struct evmc_vm *vm, const struct evmc_host_interface *host, struct evmc_host_context *context, enum evmc_revision rev, const struct evmc_message *msg, uint8_t const *code, size_t code_size)
+
+ +

Executes the given code using the input from the message.

+

This function MAY be invoked multiple times for a single VM instance.

+
Parameters
+ + + + + + + + +
vmThe VM instance. This argument MUST NOT be NULL.
hostThe Host interface. This argument MUST NOT be NULL unless the vm has the EVMC_CAPABILITY_PRECOMPILES capability.
contextThe opaque pointer to the Host execution context. This argument MAY be NULL. The VM MUST pass the same pointer to the methods of the host interface. The VM MUST NOT dereference the pointer.
revThe requested EVM specification revision.
msgThe call parameters. See evmc_message. This argument MUST NOT be NULL.
codeThe reference to the code to be executed. This argument MAY be NULL.
code_sizeThe length of the code. If code is NULL this argument MUST be 0.
+
+
+
Returns
The execution result.
+ +

Definition at line 904 of file evmc.h.

+ +
+
+ +

◆ evmc_get_balance_fn

+ +
+
+ + + + +
typedef evmc_uint256be(* evmc_get_balance_fn) (struct evmc_host_context *context, const evmc_address *address)
+
+ +

Get balance callback function.

+

This callback function is used by a VM to query the balance of the given account.

+
Parameters
+ + + +
contextThe pointer to the Host execution context.
addressThe address of the account.
+
+
+
Returns
The balance of the given account or 0 if the account does not exist.
+ +

Definition at line 691 of file evmc.h.

+ +
+
+ +

◆ evmc_get_block_hash_fn

+ +
+
+ + + + +
typedef evmc_bytes32(* evmc_get_block_hash_fn) (struct evmc_host_context *context, int64_t number)
+
+ +

Get block hash callback function.

+

This callback function is used by a VM to query the hash of the header of the given block. If the information about the requested block is not available, then this is signalled by returning null bytes.

+
Parameters
+ + + +
contextThe pointer to the Host execution context.
numberThe block number.
+
+
+
Returns
The block hash or null bytes if the information about the block is not available.
+ +

Definition at line 261 of file evmc.h.

+ +
+
+ +

◆ evmc_get_capabilities_fn

+ +
+
+ + + + +
typedef evmc_capabilities_flagset(* evmc_get_capabilities_fn) (struct evmc_vm *vm)
+
+ +

Return the supported capabilities of the VM instance.

+

This function MAY be invoked multiple times for a single VM instance, and its value MAY be influenced by calls to evmc_vm::set_option.

+
Parameters
+ + +
vmThe VM instance.
+
+
+
Returns
The supported capabilities of the VM.
+
See also
evmc_capabilities.
+ +

Definition at line 1131 of file evmc.h.

+ +
+
+ +

◆ evmc_get_code_hash_fn

+ +
+
+ + + + +
typedef evmc_bytes32(* evmc_get_code_hash_fn) (struct evmc_host_context *context, const evmc_address *address)
+
+ +

Get code hash callback function.

+

This callback function is used by a VM to get the keccak256 hash of the code stored in the account at the given address. For existing accounts not having a code, this function returns keccak256 hash of empty data.

+
Parameters
+ + + +
contextThe pointer to the Host execution context.
addressThe address of the account.
+
+
+
Returns
The hash of the code in the account or null bytes if the account does not exist.
+ +

Definition at line 718 of file evmc.h.

+ +
+
+ +

◆ evmc_get_code_size_fn

+ +
+
+ + + + +
typedef size_t(* evmc_get_code_size_fn) (struct evmc_host_context *context, const evmc_address *address)
+
+ +

Get code size callback function.

+

This callback function is used by a VM to get the size of the code stored in the account at the given address.

+
Parameters
+ + + +
contextThe pointer to the Host execution context.
addressThe address of the account.
+
+
+
Returns
The size of the code in the account or 0 if the account does not exist.
+ +

Definition at line 704 of file evmc.h.

+ +
+
+ +

◆ evmc_get_storage_fn

+ +
+
+ + + + +
typedef evmc_bytes32(* evmc_get_storage_fn) (struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key)
+
+ +

Get storage callback function.

+

This callback function is used by a VM to query the given account storage entry.

+
Parameters
+ + + + +
contextThe Host execution context.
addressThe address of the account.
keyThe index of the account's storage entry.
+
+
+
Returns
The storage value at the given storage key or null bytes if the account does not exist.
+ +

Definition at line 526 of file evmc.h.

+ +
+
+ +

◆ evmc_get_transient_storage_fn

+ +
+
+ + + + +
typedef evmc_bytes32(* evmc_get_transient_storage_fn) (struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key)
+
+ +

Get transient storage callback function.

+

This callback function is used by a VM to query the given account transient storage (EIP-1153) entry.

+
Parameters
+ + + + +
contextThe Host execution context.
addressThe address of the account.
keyThe index of the account's transient storage entry.
+
+
+
Returns
The transient storage value at the given storage key or null bytes if the account does not exist.
+ +

Definition at line 542 of file evmc.h.

+ +
+
+ +

◆ evmc_get_tx_context_fn

+ +
+
+ + + + +
typedef struct evmc_tx_context(* evmc_get_tx_context_fn) (struct evmc_host_context *context)
+
+ +

Get transaction context callback function.

+

This callback function is used by an EVM to retrieve the transaction and block context.

+
Parameters
+ + +
contextThe pointer to the Host execution context.
+
+
+
Returns
The transaction context.
+ +

Definition at line 65 of file evmc.h.

+ +
+
+ +

◆ evmc_release_result_fn

+ +
+
+ + + + +
typedef void(* evmc_release_result_fn) (const struct evmc_result *result)
+
+ +

Releases resources assigned to an execution result.

+

This function releases memory (and other resources, if any) assigned to the specified execution result making the result object invalid.

+
Parameters
+ + +
resultThe execution result which resources are to be released. The result itself it not modified by this function, but becomes invalid and user MUST discard it as well. This MUST NOT be NULL.
+
+
+
Note
The result is passed by pointer to avoid (shallow) copy of the evmc_result struct. Think of this as the best possible C language approximation to passing objects by reference.
+ +

Definition at line 412 of file evmc.h.

+ +
+
+ +

◆ evmc_selfdestruct_fn

+ +
+
+ + + + +
typedef bool(* evmc_selfdestruct_fn) (struct evmc_host_context *context, const evmc_address *address, const evmc_address *beneficiary)
+
+ +

Selfdestruct callback function.

+

This callback function is used by an EVM to SELFDESTRUCT given contract. The execution of the contract will not be stopped, that is up to the EVM.

+
Parameters
+ + + + +
contextThe pointer to the Host execution context. See evmc_host_context.
addressThe address of the contract to be selfdestructed.
beneficiaryThe address where the remaining ETH is going to be transferred.
+
+
+
Returns
The information if the given address has not been registered as selfdestructed yet. True if registered for the first time, false otherwise.
+ +

Definition at line 756 of file evmc.h.

+ +
+
+ +

◆ evmc_set_option_fn

+ +
+
+ + + + +
typedef enum evmc_set_option_result(* evmc_set_option_fn) (struct evmc_vm *vm, char const *name, char const *value)
+
+ +

Configures the VM instance.

+

Allows modifying options of the VM instance. Options:

    +
  • code cache behavior: on, off, read-only, ...
  • +
  • optimizations,
  • +
+
Parameters
+ + + + +
vmThe VM instance to be configured.
nameThe option name. NULL-terminated string. Cannot be NULL.
valueThe new option value. NULL-terminated string. Cannot be NULL.
+
+
+
Returns
The outcome of the operation.
+ +

Definition at line 904 of file evmc.h.

+ +
+
+ +

◆ evmc_set_storage_fn

+ +
+
+ + + + +
typedef enum evmc_storage_status(* evmc_set_storage_fn) (struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key, const evmc_bytes32 *value)
+
+ +

Set storage callback function.

+

This callback function is used by a VM to update the given account storage entry. The VM MUST make sure that the account exists. This requirement is only a formality because VM implementations only modify storage of the account of the current execution context (i.e. referenced by evmc_message::recipient).

+
Parameters
+ + + + + +
contextThe pointer to the Host execution context.
addressThe address of the account.
keyThe index of the storage entry.
valueThe value to be stored.
+
+
+
Returns
The effect on the storage item.
+ +

Definition at line 542 of file evmc.h.

+ +
+
+ +

◆ evmc_set_transient_storage_fn

+ +
+
+ + + + +
typedef void(* evmc_set_transient_storage_fn) (struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key, const evmc_bytes32 *value)
+
+ +

Set transient storage callback function.

+

This callback function is used by a VM to update the given account's transient storage (EIP-1153) entry. The VM MUST make sure that the account exists. This requirement is only a formality because VM implementations only modify storage of the account of the current execution context (i.e. referenced by evmc_message::recipient).

+
Parameters
+ + + + + +
contextThe pointer to the Host execution context.
addressThe address of the account.
keyThe index of the transient storage entry.
valueThe value to be stored.
+
+
+ +

Definition at line 677 of file evmc.h.

+ +
+
+ +

◆ evmc_uint256be

+ +
+
+ + + + +
typedef struct evmc_bytes32 evmc_uint256be
+
+ +

The alias for evmc_bytes32 to represent a big-endian 256-bit integer.

+ +

Definition at line 65 of file evmc.h.

+ +
+
+

Enumeration Type Documentation

+ +

◆ anonymous enum

+ +
+
+ + + + +
anonymous enum
+
+ + +
Enumerator
EVMC_ABI_VERSION 

The EVMC ABI version number of the interface declared in this file.

+

The EVMC ABI version always equals the major version number of the EVMC project. The Host SHOULD check if the ABI versions match when dynamically loading VMs.

+
See also
Versioning
+
+ +

Definition at line 37 of file evmc.h.

+
38{
+ +
48};
+
@ EVMC_ABI_VERSION
The EVMC ABI version number of the interface declared in this file.
Definition: evmc.h:47
+
+
+
+ +

◆ evmc_access_status

+ +
+
+ + + + +
enum evmc_access_status
+
+ +

Access status per EIP-2929: Gas cost increases for state access opcodes.

+ + + +
Enumerator
EVMC_ACCESS_COLD 

The entry hasn't been accessed before – it's the first access.

+
EVMC_ACCESS_WARM 

The entry is already in accessed_addresses or accessed_storage_keys.

+
+ +

Definition at line 783 of file evmc.h.

+
784{
+ +
789
+ +
794};
+
@ EVMC_ACCESS_COLD
The entry hasn't been accessed before – it's the first access.
Definition: evmc.h:788
+
@ EVMC_ACCESS_WARM
The entry is already in accessed_addresses or accessed_storage_keys.
Definition: evmc.h:793
+
+
+
+ +

◆ evmc_call_kind

+ +
+
+ + + + +
enum evmc_call_kind
+
+ +

The kind of call-like instruction.

+ + + + + + + +
Enumerator
EVMC_CALL 

Request CALL.

+
EVMC_DELEGATECALL 

Request DELEGATECALL.

+

Valid since Homestead. The value param ignored.

+
EVMC_CALLCODE 

Request CALLCODE.

+
EVMC_CREATE 

Request CREATE.

+
EVMC_CREATE2 

Request CREATE2.

+

Valid since Constantinople.

+
EVMC_EOFCREATE 

Request EOFCREATE.

+

Valid since Prague.

+
+ +

Definition at line 75 of file evmc.h.

+
76{
+
77 EVMC_CALL = 0,
+ +
80 EVMC_CALLCODE = 2,
+
81 EVMC_CREATE = 3,
+
82 EVMC_CREATE2 = 4,
+ +
84};
+
@ EVMC_CREATE
Request CREATE.
Definition: evmc.h:81
+
@ EVMC_EOFCREATE
Request EOFCREATE.
Definition: evmc.h:83
+
@ EVMC_DELEGATECALL
Request DELEGATECALL.
Definition: evmc.h:78
+
@ EVMC_CREATE2
Request CREATE2.
Definition: evmc.h:82
+
@ EVMC_CALL
Request CALL.
Definition: evmc.h:77
+
@ EVMC_CALLCODE
Request CALLCODE.
Definition: evmc.h:80
+
+
+
+ +

◆ evmc_capabilities

+ +
+
+ + + + +
enum evmc_capabilities
+
+ +

Possible capabilities of a VM.

+ + + + +
Enumerator
EVMC_CAPABILITY_EVM1 

The VM is capable of executing EVM1 bytecode.

+
EVMC_CAPABILITY_EWASM 

The VM is capable of executing ewasm bytecode.

+
EVMC_CAPABILITY_PRECOMPILES 

The VM is capable of executing the precompiled contracts defined for the range of code addresses.

+

The EIP-1352 (https://eips.ethereum.org/EIPS/eip-1352) specifies the range 0x000...0000 - 0x000...ffff of addresses reserved for precompiled and system contracts.

+

This capability is experimental and MAY be removed without notice.

+
+ +

Definition at line 1090 of file evmc.h.

+
1091{
+
1095 EVMC_CAPABILITY_EVM1 = (1u << 0),
+
1096
+
1100 EVMC_CAPABILITY_EWASM = (1u << 1),
+
1101
+
1112 EVMC_CAPABILITY_PRECOMPILES = (1u << 2)
+
1113};
+
@ EVMC_CAPABILITY_EVM1
The VM is capable of executing EVM1 bytecode.
Definition: evmc.h:1095
+
@ EVMC_CAPABILITY_PRECOMPILES
The VM is capable of executing the precompiled contracts defined for the range of code addresses.
Definition: evmc.h:1112
+
@ EVMC_CAPABILITY_EWASM
The VM is capable of executing ewasm bytecode.
Definition: evmc.h:1100
+
+
+
+ +

◆ evmc_flags

+ +
+
+ + + + +
enum evmc_flags
+
+ +

The flags for evmc_message.

+ + +
Enumerator
EVMC_STATIC 

Static call mode.

+
+ +

Definition at line 87 of file evmc.h.

+
88{
+
89 EVMC_STATIC = 1
+
90};
+
@ EVMC_STATIC
Static call mode.
Definition: evmc.h:89
+
+
+
+ +

◆ evmc_revision

+ +
+
+ + + + +
enum evmc_revision
+
+ +

EVM revision.

+

The revision of the EVM specification based on the Ethereum upgrade / hard fork codenames.

+ + + + + + + + + + + + + + + + + + +
Enumerator
EVMC_FRONTIER 

The Frontier revision.

+

The one Ethereum launched with.

+
EVMC_HOMESTEAD 

The Homestead revision.

+

https://eips.ethereum.org/EIPS/eip-606

+
EVMC_TANGERINE_WHISTLE 

The Tangerine Whistle revision.

+

https://eips.ethereum.org/EIPS/eip-608

+
EVMC_SPURIOUS_DRAGON 

The Spurious Dragon revision.

+

https://eips.ethereum.org/EIPS/eip-607

+
EVMC_BYZANTIUM 

The Byzantium revision.

+

https://eips.ethereum.org/EIPS/eip-609

+
EVMC_CONSTANTINOPLE 

The Constantinople revision.

+

https://eips.ethereum.org/EIPS/eip-1013

+
EVMC_PETERSBURG 

The Petersburg revision.

+

Other names: Constantinople2, ConstantinopleFix.

+

https://eips.ethereum.org/EIPS/eip-1716

+
EVMC_ISTANBUL 

The Istanbul revision.

+

https://eips.ethereum.org/EIPS/eip-1679

+
EVMC_BERLIN 

The Berlin revision.

+

https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/berlin.md

+
EVMC_LONDON 

The London revision.

+

https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/london.md

+
EVMC_PARIS 

The Paris revision (aka The Merge).

+

https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/paris.md

+
EVMC_SHANGHAI 

The Shanghai revision.

+

https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md

+
EVMC_CANCUN 

The Cancun revision.

+

https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md

+
EVMC_PRAGUE 

The Prague revision.

+

The future next revision after Cancun.

+
EVMC_OSAKA 

The Osaka revision.

+

The future next revision after Prague.

+
EVMC_MAX_REVISION 

The maximum EVM revision supported.

+
EVMC_LATEST_STABLE_REVISION 

The latest known EVM revision with finalized specification.

+

This is handy for EVM tools to always use the latest revision available.

+
+ +

Definition at line 940 of file evmc.h.

+
941{
+
947 EVMC_FRONTIER = 0,
+
948
+
954 EVMC_HOMESTEAD = 1,
+
955
+ +
962
+ +
969
+
975 EVMC_BYZANTIUM = 4,
+
976
+ +
983
+
991 EVMC_PETERSBURG = 6,
+
992
+
998 EVMC_ISTANBUL = 7,
+
999
+
1005 EVMC_BERLIN = 8,
+
1006
+
1012 EVMC_LONDON = 9,
+
1013
+
1019 EVMC_PARIS = 10,
+
1020
+
1026 EVMC_SHANGHAI = 11,
+
1027
+
1033 EVMC_CANCUN = 12,
+
1034
+
1040 EVMC_PRAGUE = 13,
+
1041
+
1047 EVMC_OSAKA = 14,
+
1048
+ +
1051
+ +
1058};
+
@ EVMC_OSAKA
The Osaka revision.
Definition: evmc.h:1047
+
@ EVMC_HOMESTEAD
The Homestead revision.
Definition: evmc.h:954
+
@ EVMC_LATEST_STABLE_REVISION
The latest known EVM revision with finalized specification.
Definition: evmc.h:1057
+
@ EVMC_PRAGUE
The Prague revision.
Definition: evmc.h:1040
+
@ EVMC_ISTANBUL
The Istanbul revision.
Definition: evmc.h:998
+
@ EVMC_FRONTIER
The Frontier revision.
Definition: evmc.h:947
+
@ EVMC_PETERSBURG
The Petersburg revision.
Definition: evmc.h:991
+
@ EVMC_CONSTANTINOPLE
The Constantinople revision.
Definition: evmc.h:982
+
@ EVMC_TANGERINE_WHISTLE
The Tangerine Whistle revision.
Definition: evmc.h:961
+
@ EVMC_MAX_REVISION
The maximum EVM revision supported.
Definition: evmc.h:1050
+
@ EVMC_SPURIOUS_DRAGON
The Spurious Dragon revision.
Definition: evmc.h:968
+
@ EVMC_BYZANTIUM
The Byzantium revision.
Definition: evmc.h:975
+
@ EVMC_CANCUN
The Cancun revision.
Definition: evmc.h:1033
+
@ EVMC_SHANGHAI
The Shanghai revision.
Definition: evmc.h:1026
+
@ EVMC_LONDON
The London revision.
Definition: evmc.h:1012
+
@ EVMC_PARIS
The Paris revision (aka The Merge).
Definition: evmc.h:1019
+
@ EVMC_BERLIN
The Berlin revision.
Definition: evmc.h:1005
+
+
+
+ +

◆ evmc_set_option_result

+ +
+
+ + + + +
enum evmc_set_option_result
+
+ +

Possible outcomes of evmc_set_option.

+ +

Definition at line 909 of file evmc.h.

+
910{
+
911 EVMC_SET_OPTION_SUCCESS = 0,
+
912 EVMC_SET_OPTION_INVALID_NAME = 1,
+
913 EVMC_SET_OPTION_INVALID_VALUE = 2
+
914};
+
+
+
+ +

◆ evmc_status_code

+ +
+
+ + + + +
enum evmc_status_code
+
+ +

The execution status code.

+

Successful execution is represented by EVMC_SUCCESS having value 0.

+

Positive values represent failures defined by VM specifications with generic EVMC_FAILURE code of value 1.

+

Status codes with negative values represent VM internal errors not provided by EVM specifications. These errors MUST not be passed back to the caller. They MAY be handled by the Client in predefined manner (see e.g. EVMC_REJECTED), otherwise internal errors are not recoverable. The generic representant of errors is EVMC_INTERNAL_ERROR but an EVM implementation MAY return negative status codes that are not defined in the EVMC documentation.

+
Note
In case new status codes are needed, please create an issue or pull request in the EVMC repository (https://github.com/ethereum/evmc).
+ + + + + + + + + + + + + + + + + + + + + + +
Enumerator
EVMC_SUCCESS 

Execution finished with success.

+
EVMC_FAILURE 

Generic execution failure.

+
EVMC_REVERT 

Execution terminated with REVERT opcode.

+

In this case the amount of gas left MAY be non-zero and additional output data MAY be provided in evmc_result.

+
EVMC_OUT_OF_GAS 

The execution has run out of gas.

+
EVMC_INVALID_INSTRUCTION 

The designated INVALID instruction has been hit during execution.

+

The EIP-141 (https://github.com/ethereum/EIPs/blob/master/EIPS/eip-141.md) defines the instruction 0xfe as INVALID instruction to indicate execution abortion coming from high-level languages. This status code is reported in case this INVALID instruction has been encountered.

+
EVMC_UNDEFINED_INSTRUCTION 

An undefined instruction has been encountered.

+
EVMC_STACK_OVERFLOW 

The execution has attempted to put more items on the EVM stack than the specified limit.

+
EVMC_STACK_UNDERFLOW 

Execution of an opcode has required more items on the EVM stack.

+
EVMC_BAD_JUMP_DESTINATION 

Execution has violated the jump destination restrictions.

+
EVMC_INVALID_MEMORY_ACCESS 

Tried to read outside memory bounds.

+

An example is RETURNDATACOPY reading past the available buffer.

+
EVMC_CALL_DEPTH_EXCEEDED 

Call depth has exceeded the limit (if any)

+
EVMC_STATIC_MODE_VIOLATION 

Tried to execute an operation which is restricted in static mode.

+
EVMC_PRECOMPILE_FAILURE 

A call to a precompiled or system contract has ended with a failure.

+

An example: elliptic curve functions handed invalid EC points.

+
EVMC_CONTRACT_VALIDATION_FAILURE 

Contract validation has failed (e.g.

+

due to EVM 1.5 jump validity, Casper's purity checker or ewasm contract rules).

+
EVMC_ARGUMENT_OUT_OF_RANGE 

An argument to a state accessing method has a value outside of the accepted range of values.

+
EVMC_WASM_UNREACHABLE_INSTRUCTION 

A WebAssembly unreachable instruction has been hit during execution.

+
EVMC_WASM_TRAP 

A WebAssembly trap has been hit during execution.

+

This can be for many reasons, including division by zero, validation errors, etc.

+
EVMC_INSUFFICIENT_BALANCE 

The caller does not have enough funds for value transfer.

+
EVMC_INTERNAL_ERROR 

EVM implementation generic internal error.

+
EVMC_REJECTED 

The execution of the given code and/or message has been rejected by the EVM implementation.

+

This error SHOULD be used to signal that the EVM is not able to or willing to execute the given code type or message. If an EVM returns the EVMC_REJECTED status code, the Client MAY try to execute it in other EVM implementation. For example, the Client tries running a code in the EVM 1.5. If the code is not supported there, the execution falls back to the EVM 1.0.

+
EVMC_OUT_OF_MEMORY 

The VM failed to allocate the amount of memory needed for execution.

+
+ +

Definition at line 283 of file evmc.h.

+
284{
+
286 EVMC_SUCCESS = 0,
+
287
+
289 EVMC_FAILURE = 1,
+
290
+
297 EVMC_REVERT = 2,
+
298
+
300 EVMC_OUT_OF_GAS = 3,
+
301
+ +
311
+ +
314
+ +
320
+ +
323
+ +
326
+ +
333
+ +
336
+ +
339
+ +
346
+ +
352
+ +
358
+ +
363
+
368 EVMC_WASM_TRAP = 16,
+
369
+ +
372
+ +
375
+
387 EVMC_REJECTED = -2,
+
388
+ +
391};
+
@ EVMC_INSUFFICIENT_BALANCE
The caller does not have enough funds for value transfer.
Definition: evmc.h:371
+
@ EVMC_ARGUMENT_OUT_OF_RANGE
An argument to a state accessing method has a value outside of the accepted range of values.
Definition: evmc.h:357
+
@ EVMC_INVALID_MEMORY_ACCESS
Tried to read outside memory bounds.
Definition: evmc.h:332
+
@ EVMC_REJECTED
The execution of the given code and/or message has been rejected by the EVM implementation.
Definition: evmc.h:387
+
@ EVMC_UNDEFINED_INSTRUCTION
An undefined instruction has been encountered.
Definition: evmc.h:313
+
@ EVMC_SUCCESS
Execution finished with success.
Definition: evmc.h:286
+
@ EVMC_OUT_OF_MEMORY
The VM failed to allocate the amount of memory needed for execution.
Definition: evmc.h:390
+
@ EVMC_STACK_UNDERFLOW
Execution of an opcode has required more items on the EVM stack.
Definition: evmc.h:322
+
@ EVMC_BAD_JUMP_DESTINATION
Execution has violated the jump destination restrictions.
Definition: evmc.h:325
+
@ EVMC_INVALID_INSTRUCTION
The designated INVALID instruction has been hit during execution.
Definition: evmc.h:310
+
@ EVMC_STATIC_MODE_VIOLATION
Tried to execute an operation which is restricted in static mode.
Definition: evmc.h:338
+
@ EVMC_WASM_TRAP
A WebAssembly trap has been hit during execution.
Definition: evmc.h:368
+
@ EVMC_PRECOMPILE_FAILURE
A call to a precompiled or system contract has ended with a failure.
Definition: evmc.h:345
+
@ EVMC_INTERNAL_ERROR
EVM implementation generic internal error.
Definition: evmc.h:374
+
@ EVMC_OUT_OF_GAS
The execution has run out of gas.
Definition: evmc.h:300
+
@ EVMC_CONTRACT_VALIDATION_FAILURE
Contract validation has failed (e.g.
Definition: evmc.h:351
+
@ EVMC_CALL_DEPTH_EXCEEDED
Call depth has exceeded the limit (if any)
Definition: evmc.h:335
+
@ EVMC_WASM_UNREACHABLE_INSTRUCTION
A WebAssembly unreachable instruction has been hit during execution.
Definition: evmc.h:362
+
@ EVMC_STACK_OVERFLOW
The execution has attempted to put more items on the EVM stack than the specified limit.
Definition: evmc.h:319
+
@ EVMC_FAILURE
Generic execution failure.
Definition: evmc.h:289
+
@ EVMC_REVERT
Execution terminated with REVERT opcode.
Definition: evmc.h:297
+
+
+
+ +

◆ evmc_storage_status

+ +
+
+ + + + +
enum evmc_storage_status
+
+ +

The effect of an attempt to modify a contract storage item.

+

See EVM Storage Change Status for additional information about design of this enum and analysis of the specification.

+

For the purpose of explaining the meaning of each element, the following notation is used:

    +
  • 0 is zero value,
  • +
  • X != 0 (X is any value other than 0),
  • +
  • Y != 0, Y != X, (Y is any value other than X and 0),
  • +
  • Z != 0, Z != X, Z != X (Z is any value other than Y and X and 0),
  • +
  • the "o -> c -> v" triple describes the change status in the context of:
      +
    • o: original value (cold value before a transaction started),
    • +
    • c: current storage value,
    • +
    • v: new storage value to be set.
    • +
    +
  • +
+

The order of elements follows EIPs introducing net storage gas costs:

+ + + + + + + + + + +
Enumerator
EVMC_STORAGE_ASSIGNED 

The new/same value is assigned to the storage item without affecting the cost structure.

+

The storage value item is either:

    +
  • left unchanged (c == v) or
  • +
  • the dirty value (o != c) is modified again (c != v). This is the group of cases related to minimal gas cost of only accessing warm storage. 0|X -> 0 -> 0 (current value unchanged) 0|X|Y -> Y -> Y (current value unchanged) 0|X -> Y -> Z (modified previously added/modified value)
  • +
+

This is "catch all remaining" status. I.e. if all other statuses are correctly matched this status should be assigned to all remaining cases.

+
EVMC_STORAGE_ADDED 

A new storage item is added by changing the current clean zero to a nonzero value.

+

0 -> 0 -> Z

+
EVMC_STORAGE_DELETED 

A storage item is deleted by changing the current clean nonzero to the zero value.

+

X -> X -> 0

+
EVMC_STORAGE_MODIFIED 

A storage item is modified by changing the current clean nonzero to other nonzero value.

+

X -> X -> Z

+
EVMC_STORAGE_DELETED_ADDED 

A storage item is added by changing the current dirty zero to a nonzero value other than the original value.

+

X -> 0 -> Z

+
EVMC_STORAGE_MODIFIED_DELETED 

A storage item is deleted by changing the current dirty nonzero to the zero value and the original value is not zero.

+

X -> Y -> 0

+
EVMC_STORAGE_DELETED_RESTORED 

A storage item is added by changing the current dirty zero to the original value.

+

X -> 0 -> X

+
EVMC_STORAGE_ADDED_DELETED 

A storage item is deleted by changing the current dirty nonzero to the original zero value.

+

0 -> Y -> 0

+
EVMC_STORAGE_MODIFIED_RESTORED 

A storage item is modified by changing the current dirty nonzero to the original nonzero value other than the current value.

+

X -> Y -> X

+
+ +

Definition at line 568 of file evmc.h.

+
569{
+ +
585
+ +
592
+ +
599
+ +
606
+ +
613
+ +
620
+ +
627
+ +
634
+ +
641};
+
@ EVMC_STORAGE_ADDED_DELETED
A storage item is deleted by changing the current dirty nonzero to the original zero value.
Definition: evmc.h:633
+
@ EVMC_STORAGE_MODIFIED_RESTORED
A storage item is modified by changing the current dirty nonzero to the original nonzero value other ...
Definition: evmc.h:640
+
@ EVMC_STORAGE_DELETED_RESTORED
A storage item is added by changing the current dirty zero to the original value.
Definition: evmc.h:626
+
@ EVMC_STORAGE_ADDED
A new storage item is added by changing the current clean zero to a nonzero value.
Definition: evmc.h:591
+
@ EVMC_STORAGE_MODIFIED_DELETED
A storage item is deleted by changing the current dirty nonzero to the zero value and the original va...
Definition: evmc.h:619
+
@ EVMC_STORAGE_ASSIGNED
The new/same value is assigned to the storage item without affecting the cost structure.
Definition: evmc.h:584
+
@ EVMC_STORAGE_DELETED
A storage item is deleted by changing the current clean nonzero to the zero value.
Definition: evmc.h:598
+
@ EVMC_STORAGE_DELETED_ADDED
A storage item is added by changing the current dirty zero to a nonzero value other than the original...
Definition: evmc.h:612
+
@ EVMC_STORAGE_MODIFIED
A storage item is modified by changing the current clean nonzero to other nonzero value.
Definition: evmc.h:605
+
+
+
+

Function Documentation

+ +

◆ evmc_create_example_vm()

+ +
+
+ + + + + + + + +
struct evmc_vm * evmc_create_example_vm (void )
+
+ +

Example of a function creating an instance of an example EVM implementation.

+

Each EVM implementation MUST provide a function returning an EVM instance. The function SHOULD be named evmc_create_<vm-name>(void). If the VM name contains hyphens replaces them with underscores in the function names.

+
Binaries naming convention
For VMs distributed as shared libraries, the name of the library SHOULD match the VM name. The conventional library filename prefixes and extensions SHOULD be ignored by the Client. For example, the shared library with the "beta-interpreter" implementation may be named libbeta-interpreter.so.
+
Returns
The VM instance or NULL indicating instance creation failure.
+ +

Definition at line 392 of file example_vm.cpp.

+
393{
+
394 return new ExampleVM;
+
395}
+
+
+
+
+
+ + + + diff --git a/group__EVMC.js b/group__EVMC.js new file mode 100644 index 000000000..c62bffb05 --- /dev/null +++ b/group__EVMC.js @@ -0,0 +1,186 @@ +var group__EVMC = +[ + [ "evmc_bytes32", "structevmc__bytes32.html", [ + [ "bytes", "structevmc__bytes32.html#a695eaf3c428daee54ce15c8252edc133", null ] + ] ], + [ "evmc_address", "structevmc__address.html", [ + [ "bytes", "structevmc__address.html#ab43a790ce0efb282b7ed7eafff8ed614", null ] + ] ], + [ "evmc_message", "structevmc__message.html", [ + [ "code", "structevmc__message.html#a2a7aede3f59fcab4f41734b6a671819c", null ], + [ "code_address", "structevmc__message.html#ac8cfdd4bc5d70de4deb0dacae4a6b536", null ], + [ "code_size", "structevmc__message.html#ad9ccd96006f71080e0c772cf80928a4e", null ], + [ "create2_salt", "structevmc__message.html#a20cb5b3664de79d11159e4099b80747f", null ], + [ "depth", "structevmc__message.html#a75ea15f85573ea3638e8625bbba54d3a", null ], + [ "flags", "structevmc__message.html#aae59f288163f3d3b2da2b5fdeb29512a", null ], + [ "gas", "structevmc__message.html#ae8deff46588584fa27890e74c82db5e7", null ], + [ "input_data", "structevmc__message.html#a1adee3454b105eb29cd659ee0cf65c77", null ], + [ "input_size", "structevmc__message.html#a2cf1deebd0dbbb20f25ecdfa299f4b5d", null ], + [ "kind", "structevmc__message.html#a691cb93e81d6dfd4fd7e2fa3d06a6bfa", null ], + [ "recipient", "structevmc__message.html#a63643daa5f3a30df28d42360a20e39e2", null ], + [ "sender", "structevmc__message.html#ae7f64ab994f49d9a5f028d56e80fd468", null ], + [ "value", "structevmc__message.html#adc7e2442cb362417931524ee904ecb33", null ] + ] ], + [ "evmc_tx_initcode", "structevmc__tx__initcode.html", [ + [ "code", "structevmc__tx__initcode.html#a874a12b6e701a54f302d48f3def187d3", null ], + [ "code_size", "structevmc__tx__initcode.html#a3bfdde67f0ec9606353fcf8139696d04", null ], + [ "hash", "structevmc__tx__initcode.html#a524671bd24cb0bbd7e3335f84f9f0d6f", null ] + ] ], + [ "evmc_tx_context", "structevmc__tx__context.html", [ + [ "blob_base_fee", "structevmc__tx__context.html#acff0bcc4345f5fc05c67aa2124394916", null ], + [ "blob_hashes", "structevmc__tx__context.html#a42ddac518fcd70897b6ea22563649b6b", null ], + [ "blob_hashes_count", "structevmc__tx__context.html#a6d6ac0d62f0401f2865ca1507cd345a2", null ], + [ "block_base_fee", "structevmc__tx__context.html#a172648b09b3ee20040466392a2a5f1d5", null ], + [ "block_coinbase", "structevmc__tx__context.html#acdb1c3a579bcf1578bff68d1f88f18a4", null ], + [ "block_gas_limit", "structevmc__tx__context.html#af51d0246df23060d5e958ada3f25a676", null ], + [ "block_number", "structevmc__tx__context.html#a1c3c0552db49b91358256c25643ba44a", null ], + [ "block_prev_randao", "structevmc__tx__context.html#acbfaa2901ab617c369fe1ceff4d14d0b", null ], + [ "block_timestamp", "structevmc__tx__context.html#a2391863eab970821d67a08341d9d3440", null ], + [ "chain_id", "structevmc__tx__context.html#ac68b370866987a1a1785751e4c76702a", null ], + [ "initcodes", "structevmc__tx__context.html#a5e82682b6691861d0e304c9ae7624df7", null ], + [ "initcodes_count", "structevmc__tx__context.html#a06162db38e158301f7ff9a642a5e6637", null ], + [ "tx_gas_price", "structevmc__tx__context.html#a4858c73d21efbd267ca4c2b084c9e8c0", null ], + [ "tx_origin", "structevmc__tx__context.html#a13072643da6e167daa209a305cd996db", null ] + ] ], + [ "evmc_result", "structevmc__result.html", [ + [ "create_address", "structevmc__result.html#ae7f37ff7c9cfa3b58af2c89f4d610522", null ], + [ "gas_left", "structevmc__result.html#af8478c93dbcc3cb2876037c5a5afd4c0", null ], + [ "gas_refund", "structevmc__result.html#a8b68e61d8fbbeb59f8bc0770aaf94e9d", null ], + [ "output_data", "structevmc__result.html#a61978e85f9d795a7b9695b9cbf1748d6", null ], + [ "output_size", "structevmc__result.html#a93bb7419aff492cdef754421c6d74e26", null ], + [ "padding", "structevmc__result.html#aa321f15701e9df26a9f58d60dcbd0ef9", null ], + [ "release", "structevmc__result.html#a8727ff83d372ab0067bcf6656d30b0ed", null ], + [ "status_code", "structevmc__result.html#a759c4aaa4a1c002f5a8be09ccb0b6a1c", null ] + ] ], + [ "evmc_host_interface", "structevmc__host__interface.html", [ + [ "access_account", "structevmc__host__interface.html#ac5e64cdd3216485a1e20e1f039e5c33a", null ], + [ "access_storage", "structevmc__host__interface.html#afd574060cfe3eebacbd2c3637e9a60d0", null ], + [ "account_exists", "structevmc__host__interface.html#ac3b71b9670621dd55e8bc047cd289e1a", null ], + [ "call", "structevmc__host__interface.html#a0acd6def9c08159acccfba9f9cbf9ca9", null ], + [ "copy_code", "structevmc__host__interface.html#a21b53f1aea01f97eeb29ff5d3b5910ea", null ], + [ "emit_log", "structevmc__host__interface.html#aaa3feda20b9b50381a359b2d4f591f0c", null ], + [ "get_balance", "structevmc__host__interface.html#acfb80d38a19c3c5a267a68520dae8020", null ], + [ "get_block_hash", "structevmc__host__interface.html#a9cdde67ef20f42f60d3b8949230e8852", null ], + [ "get_code_hash", "structevmc__host__interface.html#a058d2f129c4f4e840258127137801eaf", null ], + [ "get_code_size", "structevmc__host__interface.html#a35897228fa9270f59b7fca4bc373e860", null ], + [ "get_storage", "structevmc__host__interface.html#a1cfd339e26ceaba522aece2e1a06c6ef", null ], + [ "get_transient_storage", "structevmc__host__interface.html#a37136d6a49f044a6b3d5c3365bb092fa", null ], + [ "get_tx_context", "structevmc__host__interface.html#aecdea81d0643b6988e2dc6f57c936ffe", null ], + [ "selfdestruct", "structevmc__host__interface.html#a189b040cb7db22778e81d4eb19e87849", null ], + [ "set_storage", "structevmc__host__interface.html#ad24670503f09df720cc008e361a91277", null ], + [ "set_transient_storage", "structevmc__host__interface.html#a478e25757f277870c23e96cc5a4bee9a", null ] + ] ], + [ "evmc_vm", "structevmc__vm.html", [ + [ "abi_version", "structevmc__vm.html#acccbdf95110faffb4dc85624bb1d99b6", null ], + [ "destroy", "structevmc__vm.html#ac78933134b4e14ca3dd4139ee061cc6b", null ], + [ "execute", "structevmc__vm.html#a8384d28338f2287a9f9e1508699c53f0", null ], + [ "get_capabilities", "structevmc__vm.html#a505d4e584a858c2eea7a026f3a94188b", null ], + [ "name", "structevmc__vm.html#ac29ccc98e89c8cab3ffc5bd51a2afaa8", null ], + [ "set_option", "structevmc__vm.html#a20fd85c822ba5f3296206fc8fe3e90b2", null ], + [ "version", "structevmc__vm.html#af98936c214ed16f5da05ba3d6a619faa", null ] + ] ], + [ "evmc_host_context", "structevmc__host__context.html", null ], + [ "evmc_access_account_fn", "group__EVMC.html#ga8eb6233115c660f8d779eb9b132e93c5", null ], + [ "evmc_access_storage_fn", "group__EVMC.html#gac33551d757c3762e4cc3dd9bdfeee356", null ], + [ "evmc_account_exists_fn", "group__EVMC.html#ga4c5464305402bf2a10d94bf2d828d82b", null ], + [ "evmc_address", "group__EVMC.html#ga0a566da7d9e3c337abf4ef4045d8f5c5", null ], + [ "evmc_bytes32", "group__EVMC.html#gab19677b7977fc98a8d1182256486c8e9", null ], + [ "evmc_call_fn", "group__EVMC.html#ga54f569386b52be6eee15ca9e14ed1ef8", null ], + [ "evmc_capabilities_flagset", "group__EVMC.html#ga714bc8ca946adc759403fe072bdd2aa0", null ], + [ "evmc_copy_code_fn", "group__EVMC.html#ga7dc696d1491951200ac5dc4f852a4499", null ], + [ "evmc_destroy_fn", "group__EVMC.html#ga1f54475fc7dc20a0c4d370272e39d755", null ], + [ "evmc_emit_log_fn", "group__EVMC.html#gaab96621b67d653758b3da15c2b596938", null ], + [ "evmc_execute_fn", "group__EVMC.html#gaed9a4ab5609b55c5e3272d6d37d84ff7", null ], + [ "evmc_get_balance_fn", "group__EVMC.html#ga5208ee08734b69bb0a28793f0ecfbc48", null ], + [ "evmc_get_block_hash_fn", "group__EVMC.html#ga97c2981658d797d3031720a54740a4b3", null ], + [ "evmc_get_capabilities_fn", "group__EVMC.html#ga9bac25459c5a09d42606e7bd9320445c", null ], + [ "evmc_get_code_hash_fn", "group__EVMC.html#ga7971754ea6e237ffb9e9b7ab102fa16e", null ], + [ "evmc_get_code_size_fn", "group__EVMC.html#ga38e37a3a70dec828829cccb461e99de2", null ], + [ "evmc_get_storage_fn", "group__EVMC.html#ga7aff77bf67e8fad5819807b8aafff7cb", null ], + [ "evmc_get_transient_storage_fn", "group__EVMC.html#gaf9d05d52083ede06470147205d695224", null ], + [ "evmc_get_tx_context_fn", "group__EVMC.html#ga7b403c029b5b9ad627ffafb8c41ac84b", null ], + [ "evmc_release_result_fn", "group__EVMC.html#ga297c7c7ca966c82296a54683143157b1", null ], + [ "evmc_selfdestruct_fn", "group__EVMC.html#ga1aa9fa657b3f0de375e2f07e53b65bcc", null ], + [ "evmc_set_option_fn", "group__EVMC.html#ga5531cee5b83d76c71b06475454f4633b", null ], + [ "evmc_set_storage_fn", "group__EVMC.html#gaf7481ac7c3f1071d5d4d8256d0687e83", null ], + [ "evmc_set_transient_storage_fn", "group__EVMC.html#gae1980210d9b43a72f8aae55a8577d9cd", null ], + [ "evmc_tx_initcode", "group__EVMC.html#ga33f5d46f46db823948037dd4365de859", null ], + [ "evmc_uint256be", "group__EVMC.html#ga260738d59f9a23d039dc7a290e0c0a3b", [ + [ "EVMC_ABI_VERSION", "group__EVMC.html#gga06fc87d81c62e9abb8790b6e5713c55ba1db9144f8af4e62865f0c003c07a02bc", null ] + ] ], + [ "evmc_access_status", "group__EVMC.html#ga9f71195f3873f9979d81d7a5e1b3aaf0", [ + [ "EVMC_ACCESS_COLD", "group__EVMC.html#gga9f71195f3873f9979d81d7a5e1b3aaf0a3a719b69a4c3f9d6b9913b47312b5a76", null ], + [ "EVMC_ACCESS_WARM", "group__EVMC.html#gga9f71195f3873f9979d81d7a5e1b3aaf0a584ba0f1ab5c1e5e8a126fdcdde5d994", null ] + ] ], + [ "evmc_call_kind", "group__EVMC.html#gab2fa68a92a6828064a61e46060abc634", [ + [ "EVMC_CALL", "group__EVMC.html#ggab2fa68a92a6828064a61e46060abc634abcf3ae29d9a88ff70b98374fc665694a", null ], + [ "EVMC_DELEGATECALL", "group__EVMC.html#ggab2fa68a92a6828064a61e46060abc634a6face22070bace91b429297e88d3ab1a", null ], + [ "EVMC_CALLCODE", "group__EVMC.html#ggab2fa68a92a6828064a61e46060abc634ae9c5b431a0c823f368341c9f026642ef", null ], + [ "EVMC_CREATE", "group__EVMC.html#ggab2fa68a92a6828064a61e46060abc634a1d15450429f540677caea05143344d33", null ], + [ "EVMC_CREATE2", "group__EVMC.html#ggab2fa68a92a6828064a61e46060abc634a9ec7e0da8dde8e9bc420d806c621b418", null ], + [ "EVMC_EOFCREATE", "group__EVMC.html#ggab2fa68a92a6828064a61e46060abc634a35e57b99b5f6f11af16846c31a15dacc", null ] + ] ], + [ "evmc_capabilities", "group__EVMC.html#ga44f9ecb88cf6422a0072936494fd6ac7", [ + [ "EVMC_CAPABILITY_EVM1", "group__EVMC.html#gga44f9ecb88cf6422a0072936494fd6ac7a36fd3cfe936b9525eed7f88a7b43a2a8", null ], + [ "EVMC_CAPABILITY_EWASM", "group__EVMC.html#gga44f9ecb88cf6422a0072936494fd6ac7af1240f950b5b9ca4369bcac424443e54", null ], + [ "EVMC_CAPABILITY_PRECOMPILES", "group__EVMC.html#gga44f9ecb88cf6422a0072936494fd6ac7a43ea2aa7b099a2d67bc53c118ff3683d", null ] + ] ], + [ "evmc_flags", "group__EVMC.html#ga187a3a658849da19a0c4e8f7b51fa70d", [ + [ "EVMC_STATIC", "group__EVMC.html#gga187a3a658849da19a0c4e8f7b51fa70da1d8bef8b2bd39a6bd1936e87b18e95bf", null ] + ] ], + [ "evmc_revision", "group__EVMC.html#gae5759b1590071966ccf6a505b52a0ef7", [ + [ "EVMC_FRONTIER", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a622480509359764aa2a258b074812a5f", null ], + [ "EVMC_HOMESTEAD", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a04f0bf686d2b1c50612f9a96480f70a9", null ], + [ "EVMC_TANGERINE_WHISTLE", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a8305858ab32b80a6eced7bf177d6dee2", null ], + [ "EVMC_SPURIOUS_DRAGON", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7abbbcae1af73ad1efc570b40bb0363879", null ], + [ "EVMC_BYZANTIUM", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7ac4b0c9cfb5d408f17255a15e26938ea6", null ], + [ "EVMC_CONSTANTINOPLE", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a7a2ed5cf3d25c8c4a68691721bb969fc", null ], + [ "EVMC_PETERSBURG", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a6d913d4917e87b1fc798b450735acdeb", null ], + [ "EVMC_ISTANBUL", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a5f0e287935fd0afd65afea34b51dcf8c", null ], + [ "EVMC_BERLIN", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7af53e0cb0d793d60b5fb07c6b4c3c6ab7", null ], + [ "EVMC_LONDON", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7acfe86739fa2a0882d49cf19a94d8ee09", null ], + [ "EVMC_PARIS", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7adaa40f0a556842b0339aedc61ec332f7", null ], + [ "EVMC_SHANGHAI", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7ac79d6325f9e74fd00a6b98eaea3e30a5", null ], + [ "EVMC_CANCUN", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7ac503f2602c39827e09476616ac785a21", null ], + [ "EVMC_PRAGUE", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a23a210788296b4a859585a4cac639cf3", null ], + [ "EVMC_OSAKA", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a04e6977f757a1a3e7a64c041fff1b63a", null ], + [ "EVMC_MAX_REVISION", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a8b67f41f15bc079b8ad40dcd7156f576", null ], + [ "EVMC_LATEST_STABLE_REVISION", "group__EVMC.html#ggae5759b1590071966ccf6a505b52a0ef7a0dd8bdd55816359290e8fb8648aeb03e", null ] + ] ], + [ "evmc_set_option_result", "group__EVMC.html#ga28d9f527bda67277bccccc100e32260a", null ], + [ "evmc_status_code", "group__EVMC.html#ga4c0be97f333c050ff45321fcaa34d920", [ + [ "EVMC_SUCCESS", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a4bc3069fec2bab2a55355a72b7db68b7", null ], + [ "EVMC_FAILURE", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920aed5b2a4afa5a47af732569445920a4a9", null ], + [ "EVMC_REVERT", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920aed708e84d49cc1270e54ec20b0ca0a05", null ], + [ "EVMC_OUT_OF_GAS", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920abfc47f75656c996c0b29c0553c00fc18", null ], + [ "EVMC_INVALID_INSTRUCTION", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a8ea4f35a269f5fd3a722f2054c993637", null ], + [ "EVMC_UNDEFINED_INSTRUCTION", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a443084a263a2325f1e4c629e97685367", null ], + [ "EVMC_STACK_OVERFLOW", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920ae1a613949fe1c994a36488b0bc4c86c4", null ], + [ "EVMC_STACK_UNDERFLOW", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a640106fdec78d04a1098c512898d4efc", null ], + [ "EVMC_BAD_JUMP_DESTINATION", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a6acf000dfa802a949063a87046f4bb26", null ], + [ "EVMC_INVALID_MEMORY_ACCESS", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a2981ec30896486ac69bab7c0a1be591b", null ], + [ "EVMC_CALL_DEPTH_EXCEEDED", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920ac139d631ff852379d566c8a60f86ddc0", null ], + [ "EVMC_STATIC_MODE_VIOLATION", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a92ccaaeb3fd1ee5aa1ad022678c13bac", null ], + [ "EVMC_PRECOMPILE_FAILURE", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920ab960d50047f87925e540bee6230aafb7", null ], + [ "EVMC_CONTRACT_VALIDATION_FAILURE", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920ac0e1bf525f51da5b3d34d4f67ca549e1", null ], + [ "EVMC_ARGUMENT_OUT_OF_RANGE", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a1cc537c5875de1b42aa5d556f33223d8", null ], + [ "EVMC_WASM_UNREACHABLE_INSTRUCTION", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920ac99fbd9645011663df070ae3c367eb4e", null ], + [ "EVMC_WASM_TRAP", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920aaf0c6c7a736ec498bd390884f143e57b", null ], + [ "EVMC_INSUFFICIENT_BALANCE", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a12f7061f20d077ce0d14ca86b2d5975d", null ], + [ "EVMC_INTERNAL_ERROR", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920abb1dcac202eac2ed8fd3025645a2fb28", null ], + [ "EVMC_REJECTED", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a2f3e0d8777f8d974ead27ae2a6eb2005", null ], + [ "EVMC_OUT_OF_MEMORY", "group__EVMC.html#gga4c0be97f333c050ff45321fcaa34d920a63aa9b3ac3af61c39c20562509347b86", null ] + ] ], + [ "evmc_storage_status", "group__EVMC.html#gae012fd6b8e5c23806b507c2d3e9fb1aa", [ + [ "EVMC_STORAGE_ASSIGNED", "group__EVMC.html#ggae012fd6b8e5c23806b507c2d3e9fb1aaad073aa65057b9bc304b9e723e6b7cfaa", null ], + [ "EVMC_STORAGE_ADDED", "group__EVMC.html#ggae012fd6b8e5c23806b507c2d3e9fb1aaa8afd1741edf799d44264654d9f04a5a9", null ], + [ "EVMC_STORAGE_DELETED", "group__EVMC.html#ggae012fd6b8e5c23806b507c2d3e9fb1aaae5b6ea5ec988f3b3ceb323ce3c0fa53f", null ], + [ "EVMC_STORAGE_MODIFIED", "group__EVMC.html#ggae012fd6b8e5c23806b507c2d3e9fb1aaaf102ce749767d5277923c221089da2c6", null ], + [ "EVMC_STORAGE_DELETED_ADDED", "group__EVMC.html#ggae012fd6b8e5c23806b507c2d3e9fb1aaaecee2e651cdfa14f1686903b10796b8a", null ], + [ "EVMC_STORAGE_MODIFIED_DELETED", "group__EVMC.html#ggae012fd6b8e5c23806b507c2d3e9fb1aaa9def8aed9b4498385904ea37fad8a228", null ], + [ "EVMC_STORAGE_DELETED_RESTORED", "group__EVMC.html#ggae012fd6b8e5c23806b507c2d3e9fb1aaa88a893f304c7d0c0bbf6c82254544e28", null ], + [ "EVMC_STORAGE_ADDED_DELETED", "group__EVMC.html#ggae012fd6b8e5c23806b507c2d3e9fb1aaa095d061ef441491e494b124582bd1e2e", null ], + [ "EVMC_STORAGE_MODIFIED_RESTORED", "group__EVMC.html#ggae012fd6b8e5c23806b507c2d3e9fb1aaa7dddf323f6fe21b15dfec07740e8038e", null ] + ] ], + [ "evmc_create_example_vm", "group__EVMC.html#ga4ba5aae5d0250d9c4f6987a78602e795", null ] +]; \ No newline at end of file diff --git a/group__cpp.html b/group__cpp.html new file mode 100644 index 000000000..53a03d006 --- /dev/null +++ b/group__cpp.html @@ -0,0 +1,85 @@ + + + + + + + +EVMC: EVMC C++ + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ +
EVMC C++
+
+
+ + + + + +

+Namespaces

namespace  evmc
 EVMC C++ API - wrappers and bindings for C++.
 
+

Detailed Description

+

EVMC C++ API - wrappers and bindings for C++.

+
+
+ + + + diff --git a/group__cpp.js b/group__cpp.js new file mode 100644 index 000000000..aab81909b --- /dev/null +++ b/group__cpp.js @@ -0,0 +1,4 @@ +var group__cpp = +[ + [ "evmc", "namespaceevmc.html", null ] +]; \ No newline at end of file diff --git a/group__helpers.html b/group__helpers.html new file mode 100644 index 000000000..445bfcd1a --- /dev/null +++ b/group__helpers.html @@ -0,0 +1,853 @@ + + + + + + + +EVMC: EVMC Helpers + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ +
EVMC Helpers
+
+
+ +

EVMC Helpers. +More...

+ + + + + +

+Modules

 Result Optional Storage
 Helpers for optional storage of evmc_result.
 
+ + + + + + + +

+Macros

#define EVMC_EXPORT   __attribute__((visibility("default")))
 Marks a function to be exported from a shared library.
 
#define EVMC_NOEXCEPT
 Safe way of marking a function with noexcept C++ specifier.
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

static bool evmc_is_abi_compatible (struct evmc_vm *vm)
 Returns true if the VM has a compatible ABI version.
 
static const char * evmc_vm_name (struct evmc_vm *vm)
 Returns the name of the VM.
 
static const char * evmc_vm_version (struct evmc_vm *vm)
 Returns the version of the VM.
 
static bool evmc_vm_has_capability (struct evmc_vm *vm, enum evmc_capabilities capability)
 Checks if the VM has the given capability.
 
static void evmc_destroy (struct evmc_vm *vm)
 Destroys the VM instance.
 
static enum evmc_set_option_result evmc_set_option (struct evmc_vm *vm, char const *name, char const *value)
 Sets the option for the VM, if the feature is supported by the VM.
 
static struct evmc_result evmc_execute (struct evmc_vm *vm, const struct evmc_host_interface *host, struct evmc_host_context *context, enum evmc_revision rev, const struct evmc_message *msg, uint8_t const *code, size_t code_size)
 Executes code in the VM instance.
 
static void evmc_free_result_memory (const struct evmc_result *result)
 The evmc_result release function using free() for releasing the memory.
 
static struct evmc_result evmc_make_result (enum evmc_status_code status_code, int64_t gas_left, int64_t gas_refund, const uint8_t *output_data, size_t output_size)
 Creates the result from the provided arguments.
 
static void evmc_release_result (struct evmc_result *result)
 Releases the resources allocated to the execution result.
 
static const char * evmc_status_code_to_string (enum evmc_status_code status_code)
 Returns text representation of the evmc_status_code.
 
static const char * evmc_revision_to_string (enum evmc_revision rev)
 Returns the name of the evmc_revision.
 
+

Detailed Description

+

EVMC Helpers.

+

A collection of C helper functions for invoking a VM instance methods. These are convenient for languages where invoking function pointers is "ugly" or impossible (such as Go).

+

Macro Definition Documentation

+ +

◆ EVMC_EXPORT

+ +
+
+ + + + +
#define EVMC_EXPORT   __attribute__((visibility("default")))
+
+ +

Marks a function to be exported from a shared library.

+ +

Definition at line 22 of file utils.h.

+ +
+
+ +

◆ EVMC_NOEXCEPT

+ +
+
+ + + + +
#define EVMC_NOEXCEPT
+
+ +

Safe way of marking a function with noexcept C++ specifier.

+ +

Definition at line 32 of file utils.h.

+ +
+
+

Function Documentation

+ +

◆ evmc_destroy()

+ +
+
+ + + + + +
+ + + + + + + + +
static void evmc_destroy (struct evmc_vmvm)
+
+inlinestatic
+
+ +

Destroys the VM instance.

+
See also
evmc_destroy_fn
+ +

Definition at line 68 of file helpers.h.

+
69{
+
70 vm->destroy(vm);
+
71}
+
evmc_destroy_fn destroy
Pointer to function destroying the VM instance.
Definition: evmc.h:1170
+
+
+
+ +

◆ evmc_execute()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static struct evmc_result evmc_execute (struct evmc_vmvm,
const struct evmc_host_interfacehost,
struct evmc_host_contextcontext,
enum evmc_revision rev,
const struct evmc_messagemsg,
uint8_t const * code,
size_t code_size 
)
+
+inlinestatic
+
+ +

Executes code in the VM instance.

+
See also
evmc_execute_fn.
+ +

Definition at line 92 of file helpers.h.

+
99{
+
100 return vm->execute(vm, host, context, rev, msg, code, code_size);
+
101}
+
evmc_execute_fn execute
Pointer to function executing a code by the VM instance.
Definition: evmc.h:1177
+
+
+
+ +

◆ evmc_free_result_memory()

+ +
+
+ + + + + +
+ + + + + + + + +
static void evmc_free_result_memory (const struct evmc_resultresult)
+
+static
+
+ +

The evmc_result release function using free() for releasing the memory.

+

This function is used in the evmc_make_result(), but may be also used in other case if convenient.

+
Parameters
+ + +
resultThe result object.
+
+
+ +

Definition at line 109 of file helpers.h.

+
110{
+
111 free((uint8_t*)result->output_data);
+
112}
+
const uint8_t * output_data
The reference to output data.
Definition: evmc.h:448
+
+
+
+ +

◆ evmc_is_abi_compatible()

+ +
+
+ + + + + +
+ + + + + + + + +
static bool evmc_is_abi_compatible (struct evmc_vmvm)
+
+inlinestatic
+
+ +

Returns true if the VM has a compatible ABI version.

+ +

Definition at line 32 of file helpers.h.

+
33{
+
34 return vm->abi_version == EVMC_ABI_VERSION;
+
35}
+
@ EVMC_ABI_VERSION
The EVMC ABI version number of the interface declared in this file.
Definition: evmc.h:47
+
const int abi_version
EVMC ABI version implemented by the VM instance.
Definition: evmc.h:1147
+
+
+
+ +

◆ evmc_make_result()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static struct evmc_result evmc_make_result (enum evmc_status_code status_code,
int64_t gas_left,
int64_t gas_refund,
const uint8_t * output_data,
size_t output_size 
)
+
+inlinestatic
+
+ +

Creates the result from the provided arguments.

+

The provided output is copied to memory allocated with malloc() and the evmc_result::release function is set to one invoking free().

+

In case of memory allocation failure, the result has all fields zeroed and only evmc_result::status_code is set to EVMC_OUT_OF_MEMORY internal error.

+
Parameters
+ + + + + + +
status_codeThe status code.
gas_leftThe amount of gas left.
gas_refundThe amount of refunded gas.
output_dataThe pointer to the output.
output_sizeThe output size.
+
+
+ +

Definition at line 127 of file helpers.h.

+
132{
+
133 struct evmc_result result;
+
134 memset(&result, 0, sizeof(result));
+
135
+
136 if (output_size != 0)
+
137 {
+
138 uint8_t* buffer = (uint8_t*)malloc(output_size);
+
139
+
140 if (!buffer)
+
141 {
+
142 result.status_code = EVMC_OUT_OF_MEMORY;
+
143 return result;
+
144 }
+
145
+
146 memcpy(buffer, output_data, output_size);
+
147 result.output_data = buffer;
+
148 result.output_size = output_size;
+
149 result.release = evmc_free_result_memory;
+
150 }
+
151
+
152 result.status_code = status_code;
+
153 result.gas_left = gas_left;
+
154 result.gas_refund = gas_refund;
+
155 return result;
+
156}
+
@ EVMC_OUT_OF_MEMORY
The VM failed to allocate the amount of memory needed for execution.
Definition: evmc.h:390
+
static void evmc_free_result_memory(const struct evmc_result *result)
The evmc_result release function using free() for releasing the memory.
Definition: helpers.h:109
+
The EVM code execution result.
Definition: evmc.h:416
+
enum evmc_status_code status_code
The execution status code.
Definition: evmc.h:418
+
int64_t gas_refund
The refunded gas accumulated from this execution and its sub-calls.
Definition: evmc.h:434
+
size_t output_size
The size of the output data.
Definition: evmc.h:455
+
int64_t gas_left
The amount of gas left after the execution.
Definition: evmc.h:426
+
+
+
+ +

◆ evmc_release_result()

+ +
+
+ + + + + +
+ + + + + + + + +
static void evmc_release_result (struct evmc_resultresult)
+
+inlinestatic
+
+ +

Releases the resources allocated to the execution result.

+
Parameters
+ + +
resultThe result object to be released. MUST NOT be NULL.
+
+
+
See also
evmc_result::release() evmc_release_result_fn
+ +

Definition at line 165 of file helpers.h.

+
166{
+
167 if (result->release)
+
168 result->release(result);
+
169}
+
evmc_release_result_fn release
The method releasing all resources associated with the result object.
Definition: evmc.h:476
+
+
+
+ +

◆ evmc_revision_to_string()

+ +
+
+ + + + + +
+ + + + + + + + +
static const char * evmc_revision_to_string (enum evmc_revision rev)
+
+inlinestatic
+
+ +

Returns the name of the evmc_revision.

+ +

Definition at line 272 of file helpers.h.

+
273{
+
274 switch (rev)
+
275 {
+
276 case EVMC_FRONTIER:
+
277 return "Frontier";
+
278 case EVMC_HOMESTEAD:
+
279 return "Homestead";
+ +
281 return "Tangerine Whistle";
+ +
283 return "Spurious Dragon";
+
284 case EVMC_BYZANTIUM:
+
285 return "Byzantium";
+ +
287 return "Constantinople";
+
288 case EVMC_PETERSBURG:
+
289 return "Petersburg";
+
290 case EVMC_ISTANBUL:
+
291 return "Istanbul";
+
292 case EVMC_BERLIN:
+
293 return "Berlin";
+
294 case EVMC_LONDON:
+
295 return "London";
+
296 case EVMC_PARIS:
+
297 return "Paris";
+
298 case EVMC_SHANGHAI:
+
299 return "Shanghai";
+
300 case EVMC_CANCUN:
+
301 return "Cancun";
+
302 case EVMC_PRAGUE:
+
303 return "Prague";
+
304 case EVMC_OSAKA:
+
305 return "Osaka";
+
306 }
+
307 return "<unknown>";
+
308}
+
@ EVMC_OSAKA
The Osaka revision.
Definition: evmc.h:1047
+
@ EVMC_HOMESTEAD
The Homestead revision.
Definition: evmc.h:954
+
@ EVMC_PRAGUE
The Prague revision.
Definition: evmc.h:1040
+
@ EVMC_ISTANBUL
The Istanbul revision.
Definition: evmc.h:998
+
@ EVMC_FRONTIER
The Frontier revision.
Definition: evmc.h:947
+
@ EVMC_PETERSBURG
The Petersburg revision.
Definition: evmc.h:991
+
@ EVMC_CONSTANTINOPLE
The Constantinople revision.
Definition: evmc.h:982
+
@ EVMC_TANGERINE_WHISTLE
The Tangerine Whistle revision.
Definition: evmc.h:961
+
@ EVMC_SPURIOUS_DRAGON
The Spurious Dragon revision.
Definition: evmc.h:968
+
@ EVMC_BYZANTIUM
The Byzantium revision.
Definition: evmc.h:975
+
@ EVMC_CANCUN
The Cancun revision.
Definition: evmc.h:1033
+
@ EVMC_SHANGHAI
The Shanghai revision.
Definition: evmc.h:1026
+
@ EVMC_LONDON
The London revision.
Definition: evmc.h:1012
+
@ EVMC_PARIS
The Paris revision (aka The Merge).
Definition: evmc.h:1019
+
@ EVMC_BERLIN
The Berlin revision.
Definition: evmc.h:1005
+
+
+
+ +

◆ evmc_set_option()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static enum evmc_set_option_result evmc_set_option (struct evmc_vmvm,
char const * name,
char const * value 
)
+
+inlinestatic
+
+ +

Sets the option for the VM, if the feature is supported by the VM.

+
See also
evmc_set_option_fn
+ +

Definition at line 78 of file helpers.h.

+
81{
+
82 if (vm->set_option)
+
83 return vm->set_option(vm, name, value);
+
84 return EVMC_SET_OPTION_INVALID_NAME;
+
85}
+
evmc_set_option_fn set_option
Optional pointer to function modifying VM's options.
Definition: evmc.h:1196
+
+
+
+ +

◆ evmc_status_code_to_string()

+ +
+
+ + + + + +
+ + + + + + + + +
static const char * evmc_status_code_to_string (enum evmc_status_code status_code)
+
+inlinestatic
+
+ +

Returns text representation of the evmc_status_code.

+ +

Definition at line 221 of file helpers.h.

+
222{
+
223 switch (status_code)
+
224 {
+
225 case EVMC_SUCCESS:
+
226 return "success";
+
227 case EVMC_FAILURE:
+
228 return "failure";
+
229 case EVMC_REVERT:
+
230 return "revert";
+
231 case EVMC_OUT_OF_GAS:
+
232 return "out of gas";
+ +
234 return "invalid instruction";
+ +
236 return "undefined instruction";
+ +
238 return "stack overflow";
+ +
240 return "stack underflow";
+ +
242 return "bad jump destination";
+ +
244 return "invalid memory access";
+ +
246 return "call depth exceeded";
+ +
248 return "static mode violation";
+ +
250 return "precompile failure";
+ +
252 return "contract validation failure";
+ +
254 return "argument out of range";
+ +
256 return "wasm unreachable instruction";
+
257 case EVMC_WASM_TRAP:
+
258 return "wasm trap";
+ +
260 return "insufficient balance";
+ +
262 return "internal error";
+
263 case EVMC_REJECTED:
+
264 return "rejected";
+ +
266 return "out of memory";
+
267 }
+
268 return "<unknown>";
+
269}
+
@ EVMC_INSUFFICIENT_BALANCE
The caller does not have enough funds for value transfer.
Definition: evmc.h:371
+
@ EVMC_ARGUMENT_OUT_OF_RANGE
An argument to a state accessing method has a value outside of the accepted range of values.
Definition: evmc.h:357
+
@ EVMC_INVALID_MEMORY_ACCESS
Tried to read outside memory bounds.
Definition: evmc.h:332
+
@ EVMC_REJECTED
The execution of the given code and/or message has been rejected by the EVM implementation.
Definition: evmc.h:387
+
@ EVMC_UNDEFINED_INSTRUCTION
An undefined instruction has been encountered.
Definition: evmc.h:313
+
@ EVMC_SUCCESS
Execution finished with success.
Definition: evmc.h:286
+
@ EVMC_STACK_UNDERFLOW
Execution of an opcode has required more items on the EVM stack.
Definition: evmc.h:322
+
@ EVMC_BAD_JUMP_DESTINATION
Execution has violated the jump destination restrictions.
Definition: evmc.h:325
+
@ EVMC_INVALID_INSTRUCTION
The designated INVALID instruction has been hit during execution.
Definition: evmc.h:310
+
@ EVMC_STATIC_MODE_VIOLATION
Tried to execute an operation which is restricted in static mode.
Definition: evmc.h:338
+
@ EVMC_WASM_TRAP
A WebAssembly trap has been hit during execution.
Definition: evmc.h:368
+
@ EVMC_PRECOMPILE_FAILURE
A call to a precompiled or system contract has ended with a failure.
Definition: evmc.h:345
+
@ EVMC_INTERNAL_ERROR
EVM implementation generic internal error.
Definition: evmc.h:374
+
@ EVMC_OUT_OF_GAS
The execution has run out of gas.
Definition: evmc.h:300
+
@ EVMC_CONTRACT_VALIDATION_FAILURE
Contract validation has failed (e.g.
Definition: evmc.h:351
+
@ EVMC_CALL_DEPTH_EXCEEDED
Call depth has exceeded the limit (if any)
Definition: evmc.h:335
+
@ EVMC_WASM_UNREACHABLE_INSTRUCTION
A WebAssembly unreachable instruction has been hit during execution.
Definition: evmc.h:362
+
@ EVMC_STACK_OVERFLOW
The execution has attempted to put more items on the EVM stack than the specified limit.
Definition: evmc.h:319
+
@ EVMC_FAILURE
Generic execution failure.
Definition: evmc.h:289
+
@ EVMC_REVERT
Execution terminated with REVERT opcode.
Definition: evmc.h:297
+
+
+
+ +

◆ evmc_vm_has_capability()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static bool evmc_vm_has_capability (struct evmc_vmvm,
enum evmc_capabilities capability 
)
+
+inlinestatic
+
+ +

Checks if the VM has the given capability.

+
See also
evmc_get_capabilities_fn
+ +

Definition at line 58 of file helpers.h.

+
59{
+
60 return (vm->get_capabilities(vm) & (evmc_capabilities_flagset)capability) != 0;
+
61}
+
uint32_t evmc_capabilities_flagset
Alias for unsigned integer representing a set of bit flags of EVMC capabilities.
Definition: evmc.h:1120
+
evmc_get_capabilities_fn get_capabilities
A method returning capabilities supported by the VM instance.
Definition: evmc.h:1189
+
+
+
+ +

◆ evmc_vm_name()

+ +
+
+ + + + + +
+ + + + + + + + +
static const char * evmc_vm_name (struct evmc_vmvm)
+
+inlinestatic
+
+ +

Returns the name of the VM.

+ +

Definition at line 40 of file helpers.h.

+
41{
+
42 return vm->name;
+
43}
+
const char * name
The name of the EVMC VM implementation.
Definition: evmc.h:1155
+
+
+
+ +

◆ evmc_vm_version()

+ +
+
+ + + + + +
+ + + + + + + + +
static const char * evmc_vm_version (struct evmc_vmvm)
+
+inlinestatic
+
+ +

Returns the version of the VM.

+ +

Definition at line 48 of file helpers.h.

+
49{
+
50 return vm->version;
+
51}
+
const char * version
The version of the EVMC VM implementation, e.g.
Definition: evmc.h:1163
+
+
+
+
+
+ + + + diff --git a/group__helpers.js b/group__helpers.js new file mode 100644 index 000000000..a055227bb --- /dev/null +++ b/group__helpers.js @@ -0,0 +1,18 @@ +var group__helpers = +[ + [ "Result Optional Storage", "group__result__optional__storage.html", "group__result__optional__storage" ], + [ "EVMC_EXPORT", "group__helpers.html#gaad1a8fca9b52410cdc8f73739883cb93", null ], + [ "EVMC_NOEXCEPT", "group__helpers.html#ga73d425fddf1083ef70d1ffd9a29522d4", null ], + [ "evmc_destroy", "group__helpers.html#ga6204e6ae26e07377b509b2953a8094b2", null ], + [ "evmc_execute", "group__helpers.html#ga82fb11f4b40ceec377bf0093ffc1d416", null ], + [ "evmc_free_result_memory", "group__helpers.html#ga432ca3c26b4b03a175f2a0fbd0692dfa", null ], + [ "evmc_is_abi_compatible", "group__helpers.html#ga7e9c2c68b366dda89dba56566aab111d", null ], + [ "evmc_make_result", "group__helpers.html#gaa7f9fce8e717fd61efb14ec7b6c2ab35", null ], + [ "evmc_release_result", "group__helpers.html#ga78a610e76b00c5868368bd915bdeffb8", null ], + [ "evmc_revision_to_string", "group__helpers.html#gad04bac3144296562478b0447bf3991ff", null ], + [ "evmc_set_option", "group__helpers.html#gaee14c6797a91ae328e43b4f4916f6004", null ], + [ "evmc_status_code_to_string", "group__helpers.html#gad9e0e4b4cf8323982572dc54d36f0b40", null ], + [ "evmc_vm_has_capability", "group__helpers.html#ga5b05e2d9d24fa23dd648bfd8ed023f92", null ], + [ "evmc_vm_name", "group__helpers.html#gad7d1edccf65c57e7bbf5aa68399084bd", null ], + [ "evmc_vm_version", "group__helpers.html#ga9b32326e83633f890e1c41fd2ec2f1fe", null ] +]; \ No newline at end of file diff --git a/group__instructions.html b/group__instructions.html new file mode 100644 index 000000000..f4717074a --- /dev/null +++ b/group__instructions.html @@ -0,0 +1,517 @@ + + + + + + + +EVMC: EVM Instructions + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ +
EVM Instructions
+
+
+ +

EVM Instruction Tables. +More...

+ + + + + +

+Classes

struct  evmc_instruction_metrics
 Metrics for an EVM 1 instruction. More...
 
+ + + + +

+Enumerations

enum  evmc_opcode {
+  OP_STOP = 0x00 +, OP_ADD = 0x01 +, OP_MUL = 0x02 +, OP_SUB = 0x03 +,
+  OP_DIV = 0x04 +, OP_SDIV = 0x05 +, OP_MOD = 0x06 +, OP_SMOD = 0x07 +,
+  OP_ADDMOD = 0x08 +, OP_MULMOD = 0x09 +, OP_EXP = 0x0a +, OP_SIGNEXTEND = 0x0b +,
+  OP_LT = 0x10 +, OP_GT = 0x11 +, OP_SLT = 0x12 +, OP_SGT = 0x13 +,
+  OP_EQ = 0x14 +, OP_ISZERO = 0x15 +, OP_AND = 0x16 +, OP_OR = 0x17 +,
+  OP_XOR = 0x18 +, OP_NOT = 0x19 +, OP_BYTE = 0x1a +, OP_SHL = 0x1b +,
+  OP_SHR = 0x1c +, OP_SAR = 0x1d +, OP_KECCAK256 = 0x20 +, OP_ADDRESS = 0x30 +,
+  OP_BALANCE = 0x31 +, OP_ORIGIN = 0x32 +, OP_CALLER = 0x33 +, OP_CALLVALUE = 0x34 +,
+  OP_CALLDATALOAD = 0x35 +, OP_CALLDATASIZE = 0x36 +, OP_CALLDATACOPY = 0x37 +, OP_CODESIZE = 0x38 +,
+  OP_CODECOPY = 0x39 +, OP_GASPRICE = 0x3a +, OP_EXTCODESIZE = 0x3b +, OP_EXTCODECOPY = 0x3c +,
+  OP_RETURNDATASIZE = 0x3d +, OP_RETURNDATACOPY = 0x3e +, OP_EXTCODEHASH = 0x3f +, OP_BLOCKHASH = 0x40 +,
+  OP_COINBASE = 0x41 +, OP_TIMESTAMP = 0x42 +, OP_NUMBER = 0x43 +, OP_PREVRANDAO = 0x44 +,
+  OP_GASLIMIT = 0x45 +, OP_CHAINID = 0x46 +, OP_SELFBALANCE = 0x47 +, OP_BASEFEE = 0x48 +,
+  OP_POP = 0x50 +, OP_MLOAD = 0x51 +, OP_MSTORE = 0x52 +, OP_MSTORE8 = 0x53 +,
+  OP_SLOAD = 0x54 +, OP_SSTORE = 0x55 +, OP_JUMP = 0x56 +, OP_JUMPI = 0x57 +,
+  OP_PC = 0x58 +, OP_MSIZE = 0x59 +, OP_GAS = 0x5a +, OP_JUMPDEST = 0x5b +,
+  OP_PUSH0 = 0x5f +, OP_PUSH1 = 0x60 +, OP_PUSH2 = 0x61 +, OP_PUSH3 = 0x62 +,
+  OP_PUSH4 = 0x63 +, OP_PUSH5 = 0x64 +, OP_PUSH6 = 0x65 +, OP_PUSH7 = 0x66 +,
+  OP_PUSH8 = 0x67 +, OP_PUSH9 = 0x68 +, OP_PUSH10 = 0x69 +, OP_PUSH11 = 0x6a +,
+  OP_PUSH12 = 0x6b +, OP_PUSH13 = 0x6c +, OP_PUSH14 = 0x6d +, OP_PUSH15 = 0x6e +,
+  OP_PUSH16 = 0x6f +, OP_PUSH17 = 0x70 +, OP_PUSH18 = 0x71 +, OP_PUSH19 = 0x72 +,
+  OP_PUSH20 = 0x73 +, OP_PUSH21 = 0x74 +, OP_PUSH22 = 0x75 +, OP_PUSH23 = 0x76 +,
+  OP_PUSH24 = 0x77 +, OP_PUSH25 = 0x78 +, OP_PUSH26 = 0x79 +, OP_PUSH27 = 0x7a +,
+  OP_PUSH28 = 0x7b +, OP_PUSH29 = 0x7c +, OP_PUSH30 = 0x7d +, OP_PUSH31 = 0x7e +,
+  OP_PUSH32 = 0x7f +, OP_DUP1 = 0x80 +, OP_DUP2 = 0x81 +, OP_DUP3 = 0x82 +,
+  OP_DUP4 = 0x83 +, OP_DUP5 = 0x84 +, OP_DUP6 = 0x85 +, OP_DUP7 = 0x86 +,
+  OP_DUP8 = 0x87 +, OP_DUP9 = 0x88 +, OP_DUP10 = 0x89 +, OP_DUP11 = 0x8a +,
+  OP_DUP12 = 0x8b +, OP_DUP13 = 0x8c +, OP_DUP14 = 0x8d +, OP_DUP15 = 0x8e +,
+  OP_DUP16 = 0x8f +, OP_SWAP1 = 0x90 +, OP_SWAP2 = 0x91 +, OP_SWAP3 = 0x92 +,
+  OP_SWAP4 = 0x93 +, OP_SWAP5 = 0x94 +, OP_SWAP6 = 0x95 +, OP_SWAP7 = 0x96 +,
+  OP_SWAP8 = 0x97 +, OP_SWAP9 = 0x98 +, OP_SWAP10 = 0x99 +, OP_SWAP11 = 0x9a +,
+  OP_SWAP12 = 0x9b +, OP_SWAP13 = 0x9c +, OP_SWAP14 = 0x9d +, OP_SWAP15 = 0x9e +,
+  OP_SWAP16 = 0x9f +, OP_LOG0 = 0xa0 +, OP_LOG1 = 0xa1 +, OP_LOG2 = 0xa2 +,
+  OP_LOG3 = 0xa3 +, OP_LOG4 = 0xa4 +, OP_CREATE = 0xf0 +, OP_CALL = 0xf1 +,
+  OP_CALLCODE = 0xf2 +, OP_RETURN = 0xf3 +, OP_DELEGATECALL = 0xf4 +, OP_CREATE2 = 0xf5 +,
+  OP_STATICCALL = 0xfa +, OP_REVERT = 0xfd +, OP_INVALID = 0xfe +, OP_SELFDESTRUCT = 0xff +
+ }
 The list of EVM 1 opcodes from every EVM revision. More...
 
+ + + + + + + +

+Functions

EVMC_EXPORT const struct evmc_instruction_metricsevmc_get_instruction_metrics_table (enum evmc_revision revision)
 Get the table of the EVM 1 instructions metrics.
 
EVMC_EXPORT const char *const * evmc_get_instruction_names_table (enum evmc_revision revision)
 Get the table of the EVM 1 instruction names.
 
+

Detailed Description

+

EVM Instruction Tables.

+

A collection of metrics for EVM1 instruction set.

+

Enumeration Type Documentation

+ +

◆ evmc_opcode

+ +
+
+ + + + +
enum evmc_opcode
+
+ +

The list of EVM 1 opcodes from every EVM revision.

+ +

Definition at line 25 of file instructions.h.

+
26{
+
27 OP_STOP = 0x00,
+
28 OP_ADD = 0x01,
+
29 OP_MUL = 0x02,
+
30 OP_SUB = 0x03,
+
31 OP_DIV = 0x04,
+
32 OP_SDIV = 0x05,
+
33 OP_MOD = 0x06,
+
34 OP_SMOD = 0x07,
+
35 OP_ADDMOD = 0x08,
+
36 OP_MULMOD = 0x09,
+
37 OP_EXP = 0x0a,
+
38 OP_SIGNEXTEND = 0x0b,
+
39
+
40 OP_LT = 0x10,
+
41 OP_GT = 0x11,
+
42 OP_SLT = 0x12,
+
43 OP_SGT = 0x13,
+
44 OP_EQ = 0x14,
+
45 OP_ISZERO = 0x15,
+
46 OP_AND = 0x16,
+
47 OP_OR = 0x17,
+
48 OP_XOR = 0x18,
+
49 OP_NOT = 0x19,
+
50 OP_BYTE = 0x1a,
+
51 OP_SHL = 0x1b,
+
52 OP_SHR = 0x1c,
+
53 OP_SAR = 0x1d,
+
54
+
55 OP_KECCAK256 = 0x20,
+
56
+
57 OP_ADDRESS = 0x30,
+
58 OP_BALANCE = 0x31,
+
59 OP_ORIGIN = 0x32,
+
60 OP_CALLER = 0x33,
+
61 OP_CALLVALUE = 0x34,
+
62 OP_CALLDATALOAD = 0x35,
+
63 OP_CALLDATASIZE = 0x36,
+
64 OP_CALLDATACOPY = 0x37,
+
65 OP_CODESIZE = 0x38,
+
66 OP_CODECOPY = 0x39,
+
67 OP_GASPRICE = 0x3a,
+
68 OP_EXTCODESIZE = 0x3b,
+
69 OP_EXTCODECOPY = 0x3c,
+
70 OP_RETURNDATASIZE = 0x3d,
+
71 OP_RETURNDATACOPY = 0x3e,
+
72 OP_EXTCODEHASH = 0x3f,
+
73
+
74 OP_BLOCKHASH = 0x40,
+
75 OP_COINBASE = 0x41,
+
76 OP_TIMESTAMP = 0x42,
+
77 OP_NUMBER = 0x43,
+
78 OP_PREVRANDAO = 0x44,
+
79 OP_GASLIMIT = 0x45,
+
80 OP_CHAINID = 0x46,
+
81 OP_SELFBALANCE = 0x47,
+
82 OP_BASEFEE = 0x48,
+
83
+
84 OP_POP = 0x50,
+
85 OP_MLOAD = 0x51,
+
86 OP_MSTORE = 0x52,
+
87 OP_MSTORE8 = 0x53,
+
88 OP_SLOAD = 0x54,
+
89 OP_SSTORE = 0x55,
+
90 OP_JUMP = 0x56,
+
91 OP_JUMPI = 0x57,
+
92 OP_PC = 0x58,
+
93 OP_MSIZE = 0x59,
+
94 OP_GAS = 0x5a,
+
95 OP_JUMPDEST = 0x5b,
+
96
+
97 OP_PUSH0 = 0x5f,
+
98 OP_PUSH1 = 0x60,
+
99 OP_PUSH2 = 0x61,
+
100 OP_PUSH3 = 0x62,
+
101 OP_PUSH4 = 0x63,
+
102 OP_PUSH5 = 0x64,
+
103 OP_PUSH6 = 0x65,
+
104 OP_PUSH7 = 0x66,
+
105 OP_PUSH8 = 0x67,
+
106 OP_PUSH9 = 0x68,
+
107 OP_PUSH10 = 0x69,
+
108 OP_PUSH11 = 0x6a,
+
109 OP_PUSH12 = 0x6b,
+
110 OP_PUSH13 = 0x6c,
+
111 OP_PUSH14 = 0x6d,
+
112 OP_PUSH15 = 0x6e,
+
113 OP_PUSH16 = 0x6f,
+
114 OP_PUSH17 = 0x70,
+
115 OP_PUSH18 = 0x71,
+
116 OP_PUSH19 = 0x72,
+
117 OP_PUSH20 = 0x73,
+
118 OP_PUSH21 = 0x74,
+
119 OP_PUSH22 = 0x75,
+
120 OP_PUSH23 = 0x76,
+
121 OP_PUSH24 = 0x77,
+
122 OP_PUSH25 = 0x78,
+
123 OP_PUSH26 = 0x79,
+
124 OP_PUSH27 = 0x7a,
+
125 OP_PUSH28 = 0x7b,
+
126 OP_PUSH29 = 0x7c,
+
127 OP_PUSH30 = 0x7d,
+
128 OP_PUSH31 = 0x7e,
+
129 OP_PUSH32 = 0x7f,
+
130 OP_DUP1 = 0x80,
+
131 OP_DUP2 = 0x81,
+
132 OP_DUP3 = 0x82,
+
133 OP_DUP4 = 0x83,
+
134 OP_DUP5 = 0x84,
+
135 OP_DUP6 = 0x85,
+
136 OP_DUP7 = 0x86,
+
137 OP_DUP8 = 0x87,
+
138 OP_DUP9 = 0x88,
+
139 OP_DUP10 = 0x89,
+
140 OP_DUP11 = 0x8a,
+
141 OP_DUP12 = 0x8b,
+
142 OP_DUP13 = 0x8c,
+
143 OP_DUP14 = 0x8d,
+
144 OP_DUP15 = 0x8e,
+
145 OP_DUP16 = 0x8f,
+
146 OP_SWAP1 = 0x90,
+
147 OP_SWAP2 = 0x91,
+
148 OP_SWAP3 = 0x92,
+
149 OP_SWAP4 = 0x93,
+
150 OP_SWAP5 = 0x94,
+
151 OP_SWAP6 = 0x95,
+
152 OP_SWAP7 = 0x96,
+
153 OP_SWAP8 = 0x97,
+
154 OP_SWAP9 = 0x98,
+
155 OP_SWAP10 = 0x99,
+
156 OP_SWAP11 = 0x9a,
+
157 OP_SWAP12 = 0x9b,
+
158 OP_SWAP13 = 0x9c,
+
159 OP_SWAP14 = 0x9d,
+
160 OP_SWAP15 = 0x9e,
+
161 OP_SWAP16 = 0x9f,
+
162 OP_LOG0 = 0xa0,
+
163 OP_LOG1 = 0xa1,
+
164 OP_LOG2 = 0xa2,
+
165 OP_LOG3 = 0xa3,
+
166 OP_LOG4 = 0xa4,
+
167
+
168 OP_CREATE = 0xf0,
+
169 OP_CALL = 0xf1,
+
170 OP_CALLCODE = 0xf2,
+
171 OP_RETURN = 0xf3,
+
172 OP_DELEGATECALL = 0xf4,
+
173 OP_CREATE2 = 0xf5,
+
174
+
175 OP_STATICCALL = 0xfa,
+
176
+
177 OP_REVERT = 0xfd,
+
178 OP_INVALID = 0xfe,
+
179 OP_SELFDESTRUCT = 0xff
+
180};
+
+
+
+

Function Documentation

+ +

◆ evmc_get_instruction_metrics_table()

+ +
+
+ + + + + + + + +
EVMC_EXPORT const struct evmc_instruction_metrics * evmc_get_instruction_metrics_table (enum evmc_revision revision)
+
+ +

Get the table of the EVM 1 instructions metrics.

+
Parameters
+ + +
revisionThe EVM revision.
+
+
+
Returns
The pointer to the array of 256 instruction metrics. Null pointer in case an invalid EVM revision provided.
+ +
+
+ +

◆ evmc_get_instruction_names_table()

+ +
+
+ + + + + + + + +
EVMC_EXPORT const char *const * evmc_get_instruction_names_table (enum evmc_revision revision)
+
+ +

Get the table of the EVM 1 instruction names.

+

The entries for undefined instructions contain null pointers.

+
Parameters
+ + +
revisionThe EVM revision.
+
+
+
Returns
The pointer to the array of 256 instruction names. Null pointer in case an invalid EVM revision provided.
+ +
+
+
+
+ + + + diff --git a/group__instructions.js b/group__instructions.js new file mode 100644 index 000000000..bf7620f86 --- /dev/null +++ b/group__instructions.js @@ -0,0 +1,11 @@ +var group__instructions = +[ + [ "evmc_instruction_metrics", "structevmc__instruction__metrics.html", [ + [ "gas_cost", "structevmc__instruction__metrics.html#a44c39286accf5bf74d10e7491ed5b8dd", null ], + [ "stack_height_change", "structevmc__instruction__metrics.html#ae721712b3eb353747203bf18d1309e0b", null ], + [ "stack_height_required", "structevmc__instruction__metrics.html#a7cfaf4a8c004d69807e5c4a2b47dad6a", null ] + ] ], + [ "evmc_opcode", "group__instructions.html#gae35f7b05b714e4dac7242a37154d48cc", null ], + [ "evmc_get_instruction_metrics_table", "group__instructions.html#ga5872e8484591ba3de0960c70e856f29a", null ], + [ "evmc_get_instruction_names_table", "group__instructions.html#gab560ce330ba86ae3a568399ce68074ee", null ] +]; \ No newline at end of file diff --git a/group__loader.html b/group__loader.html new file mode 100644 index 000000000..457ab6214 --- /dev/null +++ b/group__loader.html @@ -0,0 +1,378 @@ + + + + + + + +EVMC: EVMC Loader + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ +
EVMC Loader
+
+
+ +

EVMC Loader Library. +More...

+ + + + + +

+Typedefs

typedef struct evmc_vm *(* evmc_create_fn) (void)
 The function pointer type for EVMC create functions.
 
+ + + + +

+Enumerations

enum  evmc_loader_error_code {
+  EVMC_LOADER_SUCCESS = 0 +, EVMC_LOADER_CANNOT_OPEN = 1 +, EVMC_LOADER_SYMBOL_NOT_FOUND = 2 +, EVMC_LOADER_INVALID_ARGUMENT = 3 +,
+  EVMC_LOADER_VM_CREATION_FAILURE = 4 +, EVMC_LOADER_ABI_VERSION_MISMATCH = 5 +, EVMC_LOADER_INVALID_OPTION_NAME = 6 +, EVMC_LOADER_INVALID_OPTION_VALUE = 7 +,
+  EVMC_LOADER_UNSPECIFIED_ERROR = -1 +
+ }
 Error codes for the EVMC loader. More...
 
+ + + + + + + + + + + + + +

+Functions

evmc_create_fn evmc_load (const char *filename, enum evmc_loader_error_code *error_code)
 Dynamically loads the EVMC module with a VM implementation.
 
struct evmc_vmevmc_load_and_create (const char *filename, enum evmc_loader_error_code *error_code)
 Dynamically loads the EVMC module and creates the VM instance.
 
struct evmc_vmevmc_load_and_configure (const char *config, enum evmc_loader_error_code *error_code)
 Dynamically loads the EVMC module, then creates and configures the VM instance.
 
const char * evmc_last_error_msg (void)
 Returns the human-readable message describing the most recent error that occurred in EVMC loading since the last call to this function.
 
+

Detailed Description

+

EVMC Loader Library.

+

The EVMC Loader Library supports loading VMs implemented as Dynamically Loaded Libraries (DLLs, shared objects).

+

Typedef Documentation

+ +

◆ evmc_create_fn

+ +
+
+ + + + +
typedef struct evmc_vm *(* evmc_create_fn) (void)
+
+ +

The function pointer type for EVMC create functions.

+ +

Definition at line 1 of file loader.h.

+ +
+
+

Enumeration Type Documentation

+ +

◆ evmc_loader_error_code

+ +
+
+ + + + +
enum evmc_loader_error_code
+
+ +

Error codes for the EVMC loader.

+

Objects of this type SHOULD be initialized with EVMC_LOADER_UNSPECIFIED_ERROR before passing to the EVMC loader.

+ + + + + + + + + + +
Enumerator
EVMC_LOADER_SUCCESS 

The loader succeeded.

+
EVMC_LOADER_CANNOT_OPEN 

The loader cannot open the given file name.

+
EVMC_LOADER_SYMBOL_NOT_FOUND 

The VM create function not found.

+
EVMC_LOADER_INVALID_ARGUMENT 

The invalid argument value provided.

+
EVMC_LOADER_VM_CREATION_FAILURE 

The creation of a VM instance has failed.

+
EVMC_LOADER_ABI_VERSION_MISMATCH 

The ABI version of the VM instance has mismatched.

+
EVMC_LOADER_INVALID_OPTION_NAME 

The VM option is invalid.

+
EVMC_LOADER_INVALID_OPTION_VALUE 

The VM option value is invalid.

+
EVMC_LOADER_UNSPECIFIED_ERROR 

This error value will be never returned by the EVMC loader, but can be used by users to init evmc_loader_error_code objects.

+
+ +

Definition at line 27 of file loader.h.

+
28{
+ +
31
+ +
34
+ +
37
+ +
40
+ +
43
+ +
46
+ +
49
+ +
52
+ +
56};
+
@ EVMC_LOADER_SUCCESS
The loader succeeded.
Definition: loader.h:30
+
@ EVMC_LOADER_ABI_VERSION_MISMATCH
The ABI version of the VM instance has mismatched.
Definition: loader.h:45
+
@ EVMC_LOADER_CANNOT_OPEN
The loader cannot open the given file name.
Definition: loader.h:33
+
@ EVMC_LOADER_UNSPECIFIED_ERROR
This error value will be never returned by the EVMC loader, but can be used by users to init evmc_loa...
Definition: loader.h:55
+
@ EVMC_LOADER_INVALID_ARGUMENT
The invalid argument value provided.
Definition: loader.h:39
+
@ EVMC_LOADER_SYMBOL_NOT_FOUND
The VM create function not found.
Definition: loader.h:36
+
@ EVMC_LOADER_VM_CREATION_FAILURE
The creation of a VM instance has failed.
Definition: loader.h:42
+
@ EVMC_LOADER_INVALID_OPTION_NAME
The VM option is invalid.
Definition: loader.h:48
+
@ EVMC_LOADER_INVALID_OPTION_VALUE
The VM option value is invalid.
Definition: loader.h:51
+
+
+
+

Function Documentation

+ +

◆ evmc_last_error_msg()

+ +
+
+ + + + + + + + +
const char * evmc_last_error_msg (void )
+
+ +

Returns the human-readable message describing the most recent error that occurred in EVMC loading since the last call to this function.

+

In case any loading function returned EVMC_LOADER_SUCCESS this function always returns NULL. In case of error code other than success returned, this function MAY return the error message. Calling this function "consumes" the error message and the function will return NULL from subsequent invocations. This function is not thread-safe.

+
Returns
Error message or NULL if no additional information is available. The returned pointer MUST NOT be freed by the caller.
+ +
+
+ +

◆ evmc_load()

+ +
+
+ + + + + + + + + + + + + + + + + + +
evmc_create_fn evmc_load (const char * filename,
enum evmc_loader_error_codeerror_code 
)
+
+ +

Dynamically loads the EVMC module with a VM implementation.

+

This function tries to open a dynamically loaded library (DLL) at the given filename. On UNIX-like systems dlopen() function is used. On Windows LoadLibrary() function is used.

+

If the file does not exist or is not a valid shared library the EVMC_LOADER_CANNOT_OPEN error code is signaled and NULL is returned.

+

After the DLL is successfully loaded the function tries to find the EVM create function in the library. The filename is used to guess the EVM name and the name of the create function. The create function name is constructed by the following rules. Consider example path: "/ethereum/libexample-interpreter.so.1.0".

    +
  • the filename is taken from the path: "libexample-interpreter.so.1.0",
  • +
  • the "lib" prefix and all file extensions are stripped from the name: "example-interpreter"
  • +
  • all "-" are replaced with "_" to construct base name: "example_interpreter",
  • +
  • the function name "evmc_create_" + base name is searched in the library: "evmc_create_example_interpreter",
  • +
  • if the function is not found, the function name "evmc_create" is searched in the library.
  • +
+

If the create function is found in the library, the pointer to the function is returned. Otherwise, the EVMC_LOADER_SYMBOL_NOT_FOUND error code is signaled and NULL is returned.

+

It is safe to call this function with the same filename argument multiple times (the DLL is not going to be loaded multiple times).

+
Parameters
+ + + +
filenameThe null terminated path (absolute or relative) to an EVMC module (dynamically loaded library) containing the VM implementation. If the value is NULL, an empty C-string or longer than the path maximum length the EVMC_LOADER_INVALID_ARGUMENT is signaled.
error_codeThe pointer to the error code. If not NULL the value is set to EVMC_LOADER_SUCCESS on success or any other error code as described above.
+
+
+
Returns
The pointer to the EVM create function or NULL in case of error.
+ +
+
+ +

◆ evmc_load_and_configure()

+ +
+
+ + + + + + + + + + + + + + + + + + +
struct evmc_vm * evmc_load_and_configure (const char * config,
enum evmc_loader_error_codeerror_code 
)
+
+ +

Dynamically loads the EVMC module, then creates and configures the VM instance.

+

This function performs the following actions atomically:

    +
  • loads the EVMC module (as evmc_load()),
  • +
  • creates the VM instance,
  • +
  • configures the VM instance with options provided in the config parameter.
  • +
+

The configuration string (config) has the following syntax:

<path> ("," <option-name> ["=" <option-value>])*
+

In this syntax, an option without a value can be specified (,option,) as a shortcut for using empty value (,option=,).

+

Options are passed to a VM in the order they are specified in the configuration string. It is up to the VM implementation how to handle duplicated options and other conflicts.

+

Example configuration string:

./modules/vm.so,engine=compiler,trace,verbosity=2
+

The function signals the same errors as evmc_load_and_create() and additionally:

+
Parameters
+ + + +
configThe path to the EVMC module with additional configuration options.
error_codeThe pointer to the error code. If not NULL the value is set to EVMC_LOADER_SUCCESS on success or any other error code as described above.
+
+
+
Returns
The pointer to the created VM or NULL in case of error.
+ +
+
+ +

◆ evmc_load_and_create()

+ +
+
+ + + + + + + + + + + + + + + + + + +
struct evmc_vm * evmc_load_and_create (const char * filename,
enum evmc_loader_error_codeerror_code 
)
+
+ +

Dynamically loads the EVMC module and creates the VM instance.

+

This is a macro for creating the VM instance with the function returned from evmc_load(). The function signals the same errors as evmc_load() and additionally:

+

It is safe to call this function with the same filename argument multiple times: the DLL is not going to be loaded multiple times, but the function will return new VM instance each time.

+
Parameters
+ + + +
filenameThe null terminated path (absolute or relative) to an EVMC module (dynamically loaded library) containing the VM implementation. If the value is NULL, an empty C-string or longer than the path maximum length the EVMC_LOADER_INVALID_ARGUMENT is signaled.
error_codeThe pointer to the error code. If not NULL the value is set to EVMC_LOADER_SUCCESS on success or any other error code as described above.
+
+
+
Returns
The pointer to the created VM or NULL in case of error.
+ +
+
+
+
+ + + + diff --git a/group__loader.js b/group__loader.js new file mode 100644 index 000000000..fee9cab9f --- /dev/null +++ b/group__loader.js @@ -0,0 +1,19 @@ +var group__loader = +[ + [ "evmc_create_fn", "group__loader.html#gaa47b31e30330c2614e4d40e14d014822", null ], + [ "evmc_loader_error_code", "group__loader.html#gadf193ed1d2d7e9053e9c592fc201bd7d", [ + [ "EVMC_LOADER_SUCCESS", "group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da0cead101d164fef2ac74efd4d6e1ae6d", null ], + [ "EVMC_LOADER_CANNOT_OPEN", "group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da199bb0c460fa6263b26badcc6f6e65fb", null ], + [ "EVMC_LOADER_SYMBOL_NOT_FOUND", "group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da397b783d11709ec470bf5782c377deb2", null ], + [ "EVMC_LOADER_INVALID_ARGUMENT", "group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da36c6ba4f96cdd1b5407aa0f26a9aa379", null ], + [ "EVMC_LOADER_VM_CREATION_FAILURE", "group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da504de7833560037be4d2c620345767f5", null ], + [ "EVMC_LOADER_ABI_VERSION_MISMATCH", "group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da0d4eb3a48d3f8c500b96f43e1aa7c458", null ], + [ "EVMC_LOADER_INVALID_OPTION_NAME", "group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da53b3d46623f93646389aaf65d977aff2", null ], + [ "EVMC_LOADER_INVALID_OPTION_VALUE", "group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7dad2625a5c71f0c585cf0493c47c805e1b", null ], + [ "EVMC_LOADER_UNSPECIFIED_ERROR", "group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da2cc1b237858f7df09e7e1bf016b44683", null ] + ] ], + [ "evmc_last_error_msg", "group__loader.html#gabc6999f43f5bdc388bf3e1662b1c4e97", null ], + [ "evmc_load", "group__loader.html#gabcf5733eb4dd80c1ce060aec9ed60600", null ], + [ "evmc_load_and_configure", "group__loader.html#ga3e29ca285fe13db086daf0bf98b4a046", null ], + [ "evmc_load_and_create", "group__loader.html#ga53c5982e90b8dcbae860b98cae9951da", null ] +]; \ No newline at end of file diff --git a/group__result__optional__storage.html b/group__result__optional__storage.html new file mode 100644 index 000000000..e2aee1cd4 --- /dev/null +++ b/group__result__optional__storage.html @@ -0,0 +1,168 @@ + + + + + + + +EVMC: Result Optional Storage + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ +
Result Optional Storage
+
+
+ +

Helpers for optional storage of evmc_result. +More...

+ + + + + +

+Classes

union  evmc_result_optional_storage
 The union representing evmc_result "optional storage". More...
 
+ + + + + + + +

+Functions

static union evmc_result_optional_storageevmc_get_optional_storage (struct evmc_result *result)
 Provides read-write access to evmc_result "optional storage".
 
static const union evmc_result_optional_storageevmc_get_const_optional_storage (const struct evmc_result *result)
 Provides read-only access to evmc_result "optional storage".
 
+

Detailed Description

+

Helpers for optional storage of evmc_result.

+

In some contexts (i.e. evmc_result::create_address is unused) objects of type evmc_result contains a memory storage that MAY be used by the object owner. This group defines helper types and functions for accessing the optional storage.

+

Function Documentation

+ +

◆ evmc_get_const_optional_storage()

+ +
+
+ + + + + +
+ + + + + + + + +
static const union evmc_result_optional_storage * evmc_get_const_optional_storage (const struct evmc_resultresult)
+
+static
+
+ +

Provides read-only access to evmc_result "optional storage".

+ +

Definition at line 212 of file helpers.h.

+
214{
+
215 return (const union evmc_result_optional_storage*)&result->create_address;
+
216}
+
evmc_address create_address
The address of the possibly created contract.
Definition: evmc.h:486
+
The union representing evmc_result "optional storage".
Definition: helpers.h:199
+
+
+
+ +

◆ evmc_get_optional_storage()

+ +
+
+ + + + + +
+ + + + + + + + +
static union evmc_result_optional_storage * evmc_get_optional_storage (struct evmc_resultresult)
+
+static
+
+ +

Provides read-write access to evmc_result "optional storage".

+ +

Definition at line 205 of file helpers.h.

+
207{
+
208 return (union evmc_result_optional_storage*)&result->create_address;
+
209}
+
+
+
+
+
+ + + + diff --git a/group__result__optional__storage.js b/group__result__optional__storage.js new file mode 100644 index 000000000..a8ad4b622 --- /dev/null +++ b/group__result__optional__storage.js @@ -0,0 +1,9 @@ +var group__result__optional__storage = +[ + [ "evmc_result_optional_storage", "unionevmc__result__optional__storage.html", [ + [ "bytes", "unionevmc__result__optional__storage.html#ac98bd272f9b63a17b2c1a10deff80716", null ], + [ "pointer", "unionevmc__result__optional__storage.html#a98839fa102a6c892a735804160ca34c7", null ] + ] ], + [ "evmc_get_const_optional_storage", "group__result__optional__storage.html#gadc8033f0501ad094c8319da486018939", null ], + [ "evmc_get_optional_storage", "group__result__optional__storage.html#gaf07c4782c1ee8f22ad9a3baae8d0d9fe", null ] +]; \ No newline at end of file diff --git a/helpers_8h.html b/helpers_8h.html new file mode 100644 index 000000000..e58136208 --- /dev/null +++ b/helpers_8h.html @@ -0,0 +1,140 @@ + + + + + + + +EVMC: include/evmc/helpers.h File Reference + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ +
helpers.h File Reference
+
+
+
#include <evmc/evmc.h>
+#include <stdlib.h>
+#include <string.h>
+
+

Go to the source code of this file.

+ + + + + +

+Classes

union  evmc_result_optional_storage
 The union representing evmc_result "optional storage". More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

static bool evmc_is_abi_compatible (struct evmc_vm *vm)
 Returns true if the VM has a compatible ABI version.
 
static const char * evmc_vm_name (struct evmc_vm *vm)
 Returns the name of the VM.
 
static const char * evmc_vm_version (struct evmc_vm *vm)
 Returns the version of the VM.
 
static bool evmc_vm_has_capability (struct evmc_vm *vm, enum evmc_capabilities capability)
 Checks if the VM has the given capability.
 
static void evmc_destroy (struct evmc_vm *vm)
 Destroys the VM instance.
 
static enum evmc_set_option_result evmc_set_option (struct evmc_vm *vm, char const *name, char const *value)
 Sets the option for the VM, if the feature is supported by the VM.
 
static struct evmc_result evmc_execute (struct evmc_vm *vm, const struct evmc_host_interface *host, struct evmc_host_context *context, enum evmc_revision rev, const struct evmc_message *msg, uint8_t const *code, size_t code_size)
 Executes code in the VM instance.
 
static void evmc_free_result_memory (const struct evmc_result *result)
 The evmc_result release function using free() for releasing the memory.
 
static struct evmc_result evmc_make_result (enum evmc_status_code status_code, int64_t gas_left, int64_t gas_refund, const uint8_t *output_data, size_t output_size)
 Creates the result from the provided arguments.
 
static void evmc_release_result (struct evmc_result *result)
 Releases the resources allocated to the execution result.
 
static union evmc_result_optional_storageevmc_get_optional_storage (struct evmc_result *result)
 Provides read-write access to evmc_result "optional storage".
 
static const union evmc_result_optional_storageevmc_get_const_optional_storage (const struct evmc_result *result)
 Provides read-only access to evmc_result "optional storage".
 
static const char * evmc_status_code_to_string (enum evmc_status_code status_code)
 Returns text representation of the evmc_status_code.
 
static const char * evmc_revision_to_string (enum evmc_revision rev)
 Returns the name of the evmc_revision.
 
+

Detailed Description

+

EVMC Helpers.

+

A collection of C helper functions for invoking a VM instance methods. These are convenient for languages where invoking function pointers is "ugly" or impossible (such as Go).

+ +

Definition in file helpers.h.

+
+
+ + + + diff --git a/helpers_8h.js b/helpers_8h.js new file mode 100644 index 000000000..bd5970af5 --- /dev/null +++ b/helpers_8h.js @@ -0,0 +1,17 @@ +var helpers_8h = +[ + [ "evmc_destroy", "group__helpers.html#ga6204e6ae26e07377b509b2953a8094b2", null ], + [ "evmc_execute", "group__helpers.html#ga82fb11f4b40ceec377bf0093ffc1d416", null ], + [ "evmc_free_result_memory", "group__helpers.html#ga432ca3c26b4b03a175f2a0fbd0692dfa", null ], + [ "evmc_get_const_optional_storage", "group__result__optional__storage.html#gadc8033f0501ad094c8319da486018939", null ], + [ "evmc_get_optional_storage", "group__result__optional__storage.html#gaf07c4782c1ee8f22ad9a3baae8d0d9fe", null ], + [ "evmc_is_abi_compatible", "group__helpers.html#ga7e9c2c68b366dda89dba56566aab111d", null ], + [ "evmc_make_result", "group__helpers.html#gaa7f9fce8e717fd61efb14ec7b6c2ab35", null ], + [ "evmc_release_result", "group__helpers.html#ga78a610e76b00c5868368bd915bdeffb8", null ], + [ "evmc_revision_to_string", "group__helpers.html#gad04bac3144296562478b0447bf3991ff", null ], + [ "evmc_set_option", "group__helpers.html#gaee14c6797a91ae328e43b4f4916f6004", null ], + [ "evmc_status_code_to_string", "group__helpers.html#gad9e0e4b4cf8323982572dc54d36f0b40", null ], + [ "evmc_vm_has_capability", "group__helpers.html#ga5b05e2d9d24fa23dd648bfd8ed023f92", null ], + [ "evmc_vm_name", "group__helpers.html#gad7d1edccf65c57e7bbf5aa68399084bd", null ], + [ "evmc_vm_version", "group__helpers.html#ga9b32326e83633f890e1c41fd2ec2f1fe", null ] +]; \ No newline at end of file diff --git a/helpers_8h_source.html b/helpers_8h_source.html new file mode 100644 index 000000000..f9199d7f6 --- /dev/null +++ b/helpers_8h_source.html @@ -0,0 +1,373 @@ + + + + + + + +EVMC: include/evmc/helpers.h Source File + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
helpers.h
+
+
+Go to the documentation of this file.
1// EVMC: Ethereum Client-VM Connector API.
+
2// Copyright 2018 The EVMC Authors.
+
3// Licensed under the Apache License, Version 2.0.
+
4
+
15#pragma once
+
16
+
17#include <evmc/evmc.h>
+
18#include <stdlib.h>
+
19#include <string.h>
+
20
+
21#ifdef __cplusplus
+
22extern "C" {
+
23#ifdef __GNUC__
+
24#pragma GCC diagnostic push
+
25#pragma GCC diagnostic ignored "-Wold-style-cast"
+
26#endif
+
27#endif
+
28
+
32static inline bool evmc_is_abi_compatible(struct evmc_vm* vm)
+
33{
+
34 return vm->abi_version == EVMC_ABI_VERSION;
+
35}
+
36
+
40static inline const char* evmc_vm_name(struct evmc_vm* vm)
+
41{
+
42 return vm->name;
+
43}
+
44
+
48static inline const char* evmc_vm_version(struct evmc_vm* vm)
+
49{
+
50 return vm->version;
+
51}
+
52
+
58static inline bool evmc_vm_has_capability(struct evmc_vm* vm, enum evmc_capabilities capability)
+
59{
+
60 return (vm->get_capabilities(vm) & (evmc_capabilities_flagset)capability) != 0;
+
61}
+
62
+
68static inline void evmc_destroy(struct evmc_vm* vm)
+
69{
+
70 vm->destroy(vm);
+
71}
+
72
+
78static inline enum evmc_set_option_result evmc_set_option(struct evmc_vm* vm,
+
79 char const* name,
+
80 char const* value)
+
81{
+
82 if (vm->set_option)
+
83 return vm->set_option(vm, name, value);
+
84 return EVMC_SET_OPTION_INVALID_NAME;
+
85}
+
86
+
92static inline struct evmc_result evmc_execute(struct evmc_vm* vm,
+
93 const struct evmc_host_interface* host,
+
94 struct evmc_host_context* context,
+
95 enum evmc_revision rev,
+
96 const struct evmc_message* msg,
+
97 uint8_t const* code,
+
98 size_t code_size)
+
99{
+
100 return vm->execute(vm, host, context, rev, msg, code, code_size);
+
101}
+
102
+
109static void evmc_free_result_memory(const struct evmc_result* result)
+
110{
+
111 free((uint8_t*)result->output_data);
+
112}
+
113
+ +
128 int64_t gas_left,
+
129 int64_t gas_refund,
+
130 const uint8_t* output_data,
+
131 size_t output_size)
+
132{
+
133 struct evmc_result result;
+
134 memset(&result, 0, sizeof(result));
+
135
+
136 if (output_size != 0)
+
137 {
+
138 uint8_t* buffer = (uint8_t*)malloc(output_size);
+
139
+
140 if (!buffer)
+
141 {
+ +
143 return result;
+
144 }
+
145
+
146 memcpy(buffer, output_data, output_size);
+
147 result.output_data = buffer;
+
148 result.output_size = output_size;
+ +
150 }
+
151
+
152 result.status_code = status_code;
+
153 result.gas_left = gas_left;
+
154 result.gas_refund = gas_refund;
+
155 return result;
+
156}
+
157
+
165static inline void evmc_release_result(struct evmc_result* result)
+
166{
+
167 if (result->release)
+
168 result->release(result);
+
169}
+
170
+
171
+ +
199{
+
200 uint8_t bytes[24];
+
201 void* pointer;
+
202};
+
203
+ +
206 struct evmc_result* result)
+
207{
+
208 return (union evmc_result_optional_storage*)&result->create_address;
+
209}
+
210
+ +
213 const struct evmc_result* result)
+
214{
+
215 return (const union evmc_result_optional_storage*)&result->create_address;
+
216}
+
217
+
221static inline const char* evmc_status_code_to_string(enum evmc_status_code status_code)
+
222{
+
223 switch (status_code)
+
224 {
+
225 case EVMC_SUCCESS:
+
226 return "success";
+
227 case EVMC_FAILURE:
+
228 return "failure";
+
229 case EVMC_REVERT:
+
230 return "revert";
+
231 case EVMC_OUT_OF_GAS:
+
232 return "out of gas";
+ +
234 return "invalid instruction";
+ +
236 return "undefined instruction";
+ +
238 return "stack overflow";
+ +
240 return "stack underflow";
+ +
242 return "bad jump destination";
+ +
244 return "invalid memory access";
+ +
246 return "call depth exceeded";
+ +
248 return "static mode violation";
+ +
250 return "precompile failure";
+ +
252 return "contract validation failure";
+ +
254 return "argument out of range";
+ +
256 return "wasm unreachable instruction";
+
257 case EVMC_WASM_TRAP:
+
258 return "wasm trap";
+ +
260 return "insufficient balance";
+ +
262 return "internal error";
+
263 case EVMC_REJECTED:
+
264 return "rejected";
+ +
266 return "out of memory";
+
267 }
+
268 return "<unknown>";
+
269}
+
270
+
272static inline const char* evmc_revision_to_string(enum evmc_revision rev)
+
273{
+
274 switch (rev)
+
275 {
+
276 case EVMC_FRONTIER:
+
277 return "Frontier";
+
278 case EVMC_HOMESTEAD:
+
279 return "Homestead";
+ +
281 return "Tangerine Whistle";
+ +
283 return "Spurious Dragon";
+
284 case EVMC_BYZANTIUM:
+
285 return "Byzantium";
+ +
287 return "Constantinople";
+
288 case EVMC_PETERSBURG:
+
289 return "Petersburg";
+
290 case EVMC_ISTANBUL:
+
291 return "Istanbul";
+
292 case EVMC_BERLIN:
+
293 return "Berlin";
+
294 case EVMC_LONDON:
+
295 return "London";
+
296 case EVMC_PARIS:
+
297 return "Paris";
+
298 case EVMC_SHANGHAI:
+
299 return "Shanghai";
+
300 case EVMC_CANCUN:
+
301 return "Cancun";
+
302 case EVMC_PRAGUE:
+
303 return "Prague";
+
304 case EVMC_OSAKA:
+
305 return "Osaka";
+
306 }
+
307 return "<unknown>";
+
308}
+
309
+
312#ifdef __cplusplus
+
313#ifdef __GNUC__
+
314#pragma GCC diagnostic pop
+
315#endif
+
316} // extern "C"
+
317#endif
+ +
evmc_set_option_result
Possible outcomes of evmc_set_option.
Definition: evmc.h:910
+
evmc_capabilities
Possible capabilities of a VM.
Definition: evmc.h:1091
+
evmc_status_code
The execution status code.
Definition: evmc.h:284
+
uint32_t evmc_capabilities_flagset
Alias for unsigned integer representing a set of bit flags of EVMC capabilities.
Definition: evmc.h:1120
+
evmc_revision
EVM revision.
Definition: evmc.h:941
+
@ EVMC_ABI_VERSION
The EVMC ABI version number of the interface declared in this file.
Definition: evmc.h:47
+
@ EVMC_INSUFFICIENT_BALANCE
The caller does not have enough funds for value transfer.
Definition: evmc.h:371
+
@ EVMC_ARGUMENT_OUT_OF_RANGE
An argument to a state accessing method has a value outside of the accepted range of values.
Definition: evmc.h:357
+
@ EVMC_INVALID_MEMORY_ACCESS
Tried to read outside memory bounds.
Definition: evmc.h:332
+
@ EVMC_REJECTED
The execution of the given code and/or message has been rejected by the EVM implementation.
Definition: evmc.h:387
+
@ EVMC_UNDEFINED_INSTRUCTION
An undefined instruction has been encountered.
Definition: evmc.h:313
+
@ EVMC_SUCCESS
Execution finished with success.
Definition: evmc.h:286
+
@ EVMC_OUT_OF_MEMORY
The VM failed to allocate the amount of memory needed for execution.
Definition: evmc.h:390
+
@ EVMC_STACK_UNDERFLOW
Execution of an opcode has required more items on the EVM stack.
Definition: evmc.h:322
+
@ EVMC_BAD_JUMP_DESTINATION
Execution has violated the jump destination restrictions.
Definition: evmc.h:325
+
@ EVMC_INVALID_INSTRUCTION
The designated INVALID instruction has been hit during execution.
Definition: evmc.h:310
+
@ EVMC_STATIC_MODE_VIOLATION
Tried to execute an operation which is restricted in static mode.
Definition: evmc.h:338
+
@ EVMC_WASM_TRAP
A WebAssembly trap has been hit during execution.
Definition: evmc.h:368
+
@ EVMC_PRECOMPILE_FAILURE
A call to a precompiled or system contract has ended with a failure.
Definition: evmc.h:345
+
@ EVMC_INTERNAL_ERROR
EVM implementation generic internal error.
Definition: evmc.h:374
+
@ EVMC_OUT_OF_GAS
The execution has run out of gas.
Definition: evmc.h:300
+
@ EVMC_CONTRACT_VALIDATION_FAILURE
Contract validation has failed (e.g.
Definition: evmc.h:351
+
@ EVMC_CALL_DEPTH_EXCEEDED
Call depth has exceeded the limit (if any)
Definition: evmc.h:335
+
@ EVMC_WASM_UNREACHABLE_INSTRUCTION
A WebAssembly unreachable instruction has been hit during execution.
Definition: evmc.h:362
+
@ EVMC_STACK_OVERFLOW
The execution has attempted to put more items on the EVM stack than the specified limit.
Definition: evmc.h:319
+
@ EVMC_FAILURE
Generic execution failure.
Definition: evmc.h:289
+
@ EVMC_REVERT
Execution terminated with REVERT opcode.
Definition: evmc.h:297
+
@ EVMC_OSAKA
The Osaka revision.
Definition: evmc.h:1047
+
@ EVMC_HOMESTEAD
The Homestead revision.
Definition: evmc.h:954
+
@ EVMC_PRAGUE
The Prague revision.
Definition: evmc.h:1040
+
@ EVMC_ISTANBUL
The Istanbul revision.
Definition: evmc.h:998
+
@ EVMC_FRONTIER
The Frontier revision.
Definition: evmc.h:947
+
@ EVMC_PETERSBURG
The Petersburg revision.
Definition: evmc.h:991
+
@ EVMC_CONSTANTINOPLE
The Constantinople revision.
Definition: evmc.h:982
+
@ EVMC_TANGERINE_WHISTLE
The Tangerine Whistle revision.
Definition: evmc.h:961
+
@ EVMC_SPURIOUS_DRAGON
The Spurious Dragon revision.
Definition: evmc.h:968
+
@ EVMC_BYZANTIUM
The Byzantium revision.
Definition: evmc.h:975
+
@ EVMC_CANCUN
The Cancun revision.
Definition: evmc.h:1033
+
@ EVMC_SHANGHAI
The Shanghai revision.
Definition: evmc.h:1026
+
@ EVMC_LONDON
The London revision.
Definition: evmc.h:1012
+
@ EVMC_PARIS
The Paris revision (aka The Merge).
Definition: evmc.h:1019
+
@ EVMC_BERLIN
The Berlin revision.
Definition: evmc.h:1005
+
static void evmc_free_result_memory(const struct evmc_result *result)
The evmc_result release function using free() for releasing the memory.
Definition: helpers.h:109
+
static bool evmc_vm_has_capability(struct evmc_vm *vm, enum evmc_capabilities capability)
Checks if the VM has the given capability.
Definition: helpers.h:58
+
static void evmc_destroy(struct evmc_vm *vm)
Destroys the VM instance.
Definition: helpers.h:68
+
static void evmc_release_result(struct evmc_result *result)
Releases the resources allocated to the execution result.
Definition: helpers.h:165
+
static bool evmc_is_abi_compatible(struct evmc_vm *vm)
Returns true if the VM has a compatible ABI version.
Definition: helpers.h:32
+
static struct evmc_result evmc_execute(struct evmc_vm *vm, const struct evmc_host_interface *host, struct evmc_host_context *context, enum evmc_revision rev, const struct evmc_message *msg, uint8_t const *code, size_t code_size)
Executes code in the VM instance.
Definition: helpers.h:92
+
static const char * evmc_vm_version(struct evmc_vm *vm)
Returns the version of the VM.
Definition: helpers.h:48
+
static struct evmc_result evmc_make_result(enum evmc_status_code status_code, int64_t gas_left, int64_t gas_refund, const uint8_t *output_data, size_t output_size)
Creates the result from the provided arguments.
Definition: helpers.h:127
+
static const char * evmc_revision_to_string(enum evmc_revision rev)
Returns the name of the evmc_revision.
Definition: helpers.h:272
+
static const char * evmc_vm_name(struct evmc_vm *vm)
Returns the name of the VM.
Definition: helpers.h:40
+
static const char * evmc_status_code_to_string(enum evmc_status_code status_code)
Returns text representation of the evmc_status_code.
Definition: helpers.h:221
+
static enum evmc_set_option_result evmc_set_option(struct evmc_vm *vm, char const *name, char const *value)
Sets the option for the VM, if the feature is supported by the VM.
Definition: helpers.h:78
+
static const union evmc_result_optional_storage * evmc_get_const_optional_storage(const struct evmc_result *result)
Provides read-only access to evmc_result "optional storage".
Definition: helpers.h:212
+
static union evmc_result_optional_storage * evmc_get_optional_storage(struct evmc_result *result)
Provides read-write access to evmc_result "optional storage".
Definition: helpers.h:205
+
The opaque data type representing the Host execution context.
+
The Host interface.
Definition: evmc.h:845
+
The message describing an EVM call, including a zero-depth calls from a transaction origin.
Definition: evmc.h:98
+
const uint8_t * code
The code to be executed.
Definition: evmc.h:196
+
size_t code_size
The length of the code to be executed.
Definition: evmc.h:201
+
The EVM code execution result.
Definition: evmc.h:416
+
const uint8_t * output_data
The reference to output data.
Definition: evmc.h:448
+
enum evmc_status_code status_code
The execution status code.
Definition: evmc.h:418
+
evmc_release_result_fn release
The method releasing all resources associated with the result object.
Definition: evmc.h:476
+
int64_t gas_refund
The refunded gas accumulated from this execution and its sub-calls.
Definition: evmc.h:434
+
size_t output_size
The size of the output data.
Definition: evmc.h:455
+
evmc_address create_address
The address of the possibly created contract.
Definition: evmc.h:486
+
int64_t gas_left
The amount of gas left after the execution.
Definition: evmc.h:426
+
The VM instance.
Definition: evmc.h:1140
+
evmc_set_option_fn set_option
Optional pointer to function modifying VM's options.
Definition: evmc.h:1196
+
evmc_get_capabilities_fn get_capabilities
A method returning capabilities supported by the VM instance.
Definition: evmc.h:1189
+
const char * name
The name of the EVMC VM implementation.
Definition: evmc.h:1155
+
evmc_destroy_fn destroy
Pointer to function destroying the VM instance.
Definition: evmc.h:1170
+
const int abi_version
EVMC ABI version implemented by the VM instance.
Definition: evmc.h:1147
+
const char * version
The version of the EVMC VM implementation, e.g.
Definition: evmc.h:1163
+
The union representing evmc_result "optional storage".
Definition: helpers.h:199
+
void * pointer
Optional pointer.
Definition: helpers.h:201
+
uint8_t bytes[24]
24 bytes of optional storage.
Definition: helpers.h:200
+
+
+ + + + diff --git a/hex_8hpp_source.html b/hex_8hpp_source.html new file mode 100644 index 000000000..7ab18e9d9 --- /dev/null +++ b/hex_8hpp_source.html @@ -0,0 +1,205 @@ + + + + + + + +EVMC: include/evmc/hex.hpp Source File + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
hex.hpp
+
+
+
1// EVMC: Ethereum Client-VM Connector API.
+
2// Copyright 2021 The EVMC Authors.
+
3// Licensed under the Apache License, Version 2.0.
+
4#pragma once
+
5
+
6#include <evmc/bytes.hpp>
+
7#include <evmc/filter_iterator.hpp>
+
8#include <cstdint>
+
9#include <optional>
+
10#include <string>
+
11#include <string_view>
+
12
+
13namespace evmc
+
14{
+
16inline std::string hex(uint8_t b) noexcept
+
17{
+
18 static constexpr auto hex_digits = "0123456789abcdef";
+
19 return {hex_digits[b >> 4], hex_digits[b & 0xf]};
+
20}
+
21
+
23inline std::string hex(bytes_view bs)
+
24{
+
25 std::string str;
+
26 str.reserve(bs.size() * 2);
+
27 for (const auto b : bs)
+
28 str += hex(b);
+
29 return str;
+
30}
+
31
+
32namespace internal
+
33{
+
36inline constexpr int from_hex_digit(char h) noexcept
+
37{
+
38 if (h >= '0' && h <= '9')
+
39 return h - '0';
+
40 else if (h >= 'a' && h <= 'f')
+
41 return h - 'a' + 10;
+
42 else if (h >= 'A' && h <= 'F')
+
43 return h - 'A' + 10;
+
44 else
+
45 return -1;
+
46}
+
47} // namespace internal
+
48
+
57template <typename InputIt, typename OutputIt>
+
58inline constexpr bool from_hex(InputIt begin, InputIt end, OutputIt out) noexcept
+
59{
+
60 int hi_nibble = -1; // Init with invalid value, should never be used.
+
61 size_t i = 0;
+
62 for (auto it = begin; it != end; ++it, ++i)
+
63 {
+
64 const auto h = *it;
+
65 const int v = evmc::internal::from_hex_digit(h);
+
66 if (v < 0)
+
67 {
+
68 if (i == 1 && hi_nibble == 0 && h == 'x') // 0x prefix
+
69 continue;
+
70 return false;
+
71 }
+
72
+
73 if (i % 2 == 0)
+
74 hi_nibble = v << 4;
+
75 else
+
76 *out++ = static_cast<uint8_t>(hi_nibble | v);
+
77 }
+
78
+
79 return i % 2 == 0;
+
80}
+
81
+
85inline bool validate_hex(std::string_view hex) noexcept
+
86{
+
87 struct noop_output_iterator
+
88 {
+
89 uint8_t sink = {};
+
90 uint8_t& operator*() noexcept { return sink; }
+
91 noop_output_iterator operator++(int) noexcept { return *this; } // NOLINT(cert-dcl21-cpp)
+
92 };
+
93
+
94 return from_hex(hex.begin(), hex.end(), noop_output_iterator{});
+
95}
+
96
+
101inline std::optional<bytes> from_hex(std::string_view hex)
+
102{
+
103 bytes bs;
+
104 bs.reserve(hex.size() / 2);
+
105 if (!from_hex(hex.begin(), hex.end(), std::back_inserter(bs)))
+
106 return {};
+
107 return bs;
+
108}
+
109
+
115template <typename T>
+
116constexpr std::optional<T> from_hex(std::string_view s) noexcept
+
117{
+
118 // Omit the optional 0x prefix.
+
119 if (s.size() >= 2 && s[0] == '0' && s[1] == 'x')
+
120 s.remove_prefix(2);
+
121
+
122 T r{}; // The T must have .bytes array. This may be lifted if std::bit_cast is available.
+
123 constexpr auto num_out_bytes = std::size(r.bytes);
+
124 const auto num_in_bytes = s.length() / 2;
+
125 if (num_in_bytes > num_out_bytes)
+
126 return {};
+
127 if (!from_hex(s.begin(), s.end(), &r.bytes[num_out_bytes - num_in_bytes]))
+
128 return {};
+
129 return r;
+
130}
+
131
+
137template <typename InputIterator>
+
138std::optional<bytes> from_spaced_hex(InputIterator begin, InputIterator end) noexcept
+
139{
+
140 bytes bs;
+
141 if (!from_hex(skip_space_iterator{begin, end}, skip_space_iterator{end, end},
+
142 std::back_inserter(bs)))
+
143 return {};
+
144 return bs;
+
145}
+
146
+
148inline std::optional<bytes> from_spaced_hex(std::string_view hex) noexcept
+
149{
+
150 return from_spaced_hex(hex.begin(), hex.end());
+
151}
+
152} // namespace evmc
+
EVMC C++ API - wrappers and bindings for C++.
Definition: bytes.hpp:12
+
std::string hex(uint8_t b) noexcept
Encode a byte to a hex string.
Definition: hex.hpp:16
+
bool validate_hex(std::string_view hex) noexcept
Validates hex encoded string.
Definition: hex.hpp:85
+
constexpr bool from_hex(InputIt begin, InputIt end, OutputIt out) noexcept
Decodes hex-encoded sequence of characters.
Definition: hex.hpp:58
+
std::basic_string_view< unsigned char, byte_traits< unsigned char > > bytes_view
String view of unsigned chars representing bytes.
Definition: bytes.hpp:92
+
std::optional< bytes > from_spaced_hex(InputIterator begin, InputIterator end) noexcept
Decodes hex encoded string to bytes.
Definition: hex.hpp:138
+
std::basic_string< unsigned char, byte_traits< unsigned char > > bytes
String of unsigned chars representing bytes.
Definition: bytes.hpp:89
+
The input filter iterator which skips whitespace characters from the base input iterator.
+
+
+ + + + diff --git a/hierarchy.html b/hierarchy.html new file mode 100644 index 000000000..22e1587f3 --- /dev/null +++ b/hierarchy.html @@ -0,0 +1,105 @@ + + + + + + + +EVMC: Class Hierarchy + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
Class Hierarchy
+
+
+
This inheritance list is sorted roughly, but not completely, alphabetically:
+
[detail level 123]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Cstd::char_traits
 Cevmc::byte_traits< T >The char traits for byte-like types
 Cevmc_addressBig-endian 160-bit hash suitable for keeping an Ethereum address
 Cevmc::addressThe big-endian 160-bit hash suitable for keeping an Ethereum address
 Cevmc_bytes32The fixed size array of 32 bytes
 Cevmc::bytes32The fixed size array of 32 bytes for storing 256-bit EVM values
 Cevmc_host_contextThe opaque data type representing the Host execution context
 Cevmc_host_interfaceThe Host interface
 Cevmc_instruction_metricsMetrics for an EVM 1 instruction
 Cevmc_messageThe message describing an EVM call, including a zero-depth calls from a transaction origin
 Cevmc_resultThe EVM code execution result
 Cevmc::ResultThe EVM code execution result.
 Cevmc_result_optional_storageThe union representing evmc_result "optional storage"
 Cevmc_tx_contextThe transaction and block data for execution
 Cevmc_tx_initcodeThe hashed initcode used for TXCREATE instruction
 Cevmc_vmThe VM instance
 Cevmc::filter_iterator< BaseIterator, noexcept >The filter iterator adaptor creates a view of an iterator range in which some elements of the range are skipped
 Cevmc::filter_iterator< BaseIterator, is_not_space >
 Cevmc::skip_space_iterator< BaseIterator >The input filter iterator which skips whitespace characters from the base input iterator
 Cevmc::HostInterfaceThe EVMC Host interface
 Cevmc::HostAbstract class to be used by Host implementations
 Cevmc::MockedHostMocked EVMC Host implementation
 Cevmc::HostContextWrapper around EVMC host context / host interface
 Cevmc::MockedHost::log_recordLOG record
 Cevmc::MockedAccountMocked account
 Cevmc::StorageValueExtended value (with original value and access flag) for account storage
 Cevmc::VMThe VM instance.
+
+
+
+ + + + diff --git a/hierarchy.js b/hierarchy.js new file mode 100644 index 000000000..d0beabe28 --- /dev/null +++ b/hierarchy.js @@ -0,0 +1,37 @@ +var hierarchy = +[ + [ "std::char_traits", null, [ + [ "evmc::byte_traits< T >", "structevmc_1_1byte__traits.html", null ] + ] ], + [ "evmc_address", "structevmc__address.html", [ + [ "evmc::address", "structevmc_1_1address.html", null ] + ] ], + [ "evmc_bytes32", "structevmc__bytes32.html", [ + [ "evmc::bytes32", "structevmc_1_1bytes32.html", null ] + ] ], + [ "evmc_host_context", "structevmc__host__context.html", null ], + [ "evmc_host_interface", "structevmc__host__interface.html", null ], + [ "evmc_instruction_metrics", "structevmc__instruction__metrics.html", null ], + [ "evmc_message", "structevmc__message.html", null ], + [ "evmc_result", "structevmc__result.html", [ + [ "evmc::Result", "classevmc_1_1Result.html", null ] + ] ], + [ "evmc_result_optional_storage", "unionevmc__result__optional__storage.html", null ], + [ "evmc_tx_context", "structevmc__tx__context.html", null ], + [ "evmc_tx_initcode", "structevmc__tx__initcode.html", null ], + [ "evmc_vm", "structevmc__vm.html", null ], + [ "evmc::filter_iterator< BaseIterator, noexcept >", "structevmc_1_1filter__iterator.html", null ], + [ "evmc::filter_iterator< BaseIterator, is_not_space >", "structevmc_1_1filter__iterator.html", [ + [ "evmc::skip_space_iterator< BaseIterator >", "structevmc_1_1skip__space__iterator.html", null ] + ] ], + [ "evmc::HostInterface", "classevmc_1_1HostInterface.html", [ + [ "evmc::Host", "classevmc_1_1Host.html", [ + [ "evmc::MockedHost", "classevmc_1_1MockedHost.html", null ] + ] ], + [ "evmc::HostContext", "classevmc_1_1HostContext.html", null ] + ] ], + [ "evmc::MockedHost::log_record", "structevmc_1_1MockedHost_1_1log__record.html", null ], + [ "evmc::MockedAccount", "structevmc_1_1MockedAccount.html", null ], + [ "evmc::StorageValue", "structevmc_1_1StorageValue.html", null ], + [ "evmc::VM", "classevmc_1_1VM.html", null ] +]; \ No newline at end of file diff --git a/hostguide.html b/hostguide.html new file mode 100644 index 000000000..323f72512 --- /dev/null +++ b/hostguide.html @@ -0,0 +1,99 @@ + + + + + + + +EVMC: EVMC Host Implementation Guide + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
EVMC Host Implementation Guide
+
+
+

+

‍How to bring EVMC support to Your Ethereum Client.

+
+

+Host interface

+

First of all, you have to implement the Host interface. The Host interface allows VMs to query and modify Ethereum state during the execution.

+

The implementation can be done in object-oriented manner. The evmc_host_interface lists the methods any Host must implement.

+

Moreover, each of the methods has a pointer to evmc_host_context as a parameter. The context is owned entirely by the Host allowing a Host instance to behave as an object with data.

+

+VM usage

+

When Host implementation is ready it's time to start using EVMC VMs.

+
    +
  1. Firstly, create a VM instance. You need to know what is the name of the "create" function in particular VM implementation. The EVMC recommends to name the function by the VM codename, e.g. evmc_create_example_vm(). Invoking the create function will give you the VM instance (evmc_vm). It is recommended to create the VM instance once.
  2. +
  3. If you are interested in loading VMs dynamically (i.e. to use DLLs) check out the EVMC Loader library.
  4. +
  5. The evmc_vm contains information about the VM like name (evmc_vm::name) or ABI version (evmc_vm::abi_version) and methods.
  6. +
  7. To execute code in the VM use the "execute()" method (evmc_vm::execute). You will need:
      +
    • the code to execute,
    • +
    • the message (evmc_message) object that describes the execution context,
    • +
    • the Host instance, passed as evmc_host_context pointer.
    • +
    +
  8. +
  9. When execution finishes you will receive evmc_result object that describes the results of the execution.
  10. +
+

Have fun!

+
+
+
+ + + + diff --git a/index.html b/index.html new file mode 100644 index 000000000..c1e0cad37 --- /dev/null +++ b/index.html @@ -0,0 +1,104 @@ + + + + + + + +EVMC: EVMC – Ethereum Client-VM Connector API + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
EVMC – Ethereum Client-VM Connector API
+
+
+

ABI version 12

+

The EVMC is the low-level ABI between Ethereum Virtual Machines (EVMs) and Ethereum Clients. On the EVM-side it supports classic EVM1 and ewasm. On the Client-side it defines the interface for EVM implementations to access Ethereum environment and state.

+

+Guides

+ +

+Versioning

+

The EVMC project uses Semantic Versioning. The version format is MAJOR.MINOR.PATCH.

+

The MAJOR version number is also referenced as the EVMC ABI version. This ABI version is available to VM and Host implementations by EVMC_ABI_VERSION. For example EVMC 3.2.1 would have ABI version 3 and therefore this project release can be referenced as EVMC ABIv3 or just EVMC 3. Every C ABI breaking change requires increasing the MAJOR version number.

+

The releases with MINOR version change allow adding new API features and modifying the language bindings API. Backward incompatible API changes are allowed but should be avoided if possible.

+

The releases with PATCH should only include bug fixes. Exceptionally, API changes are allowed when required to fix a broken feature.

+

+Modules

+
    +
  • EVMC – the main component that defines API for VMs and Clients (Hosts).
  • +
  • EVMC C++ API – the wrappers and bindings for C++.
  • +
  • EVMC Loader – the library for loading VMs implemented as Dynamically Loaded Libraries (DLLs, shared objects).
  • +
  • EVMC Helpers – a collection of utility functions for easier integration with EVMC.
  • +
  • EVM Instructions – the library with collection of metrics for EVM1 instruction set.
  • +
  • EVMC VM Tester – the EVMC-compatibility testing tool for VM implementations.
  • +
+

+Language bindings

+

+Go

+
import "github.com/ethereum/evmc/bindings/go/evmc"
+
+
+
+ + + + diff --git a/index.js b/index.js new file mode 100644 index 000000000..1471020c5 --- /dev/null +++ b/index.js @@ -0,0 +1,9 @@ +var index = +[ + [ "Guides", "index.html#guides", null ], + [ "Versioning", "index.html#versioning", null ], + [ "Modules", "index.html#modules", null ], + [ "Language bindings", "index.html#bindings", [ + [ "Go", "index.html#autotoc_md4", null ] + ] ] +]; \ No newline at end of file diff --git a/instructions_8h.html b/instructions_8h.html new file mode 100644 index 000000000..1ef7a0ddd --- /dev/null +++ b/instructions_8h.html @@ -0,0 +1,291 @@ + + + + + + + +EVMC: include/evmc/instructions.h File Reference + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ +
instructions.h File Reference
+
+
+
#include <evmc/evmc.h>
+#include <evmc/utils.h>
+
+

Go to the source code of this file.

+ + + + + +

+Classes

struct  evmc_instruction_metrics
 Metrics for an EVM 1 instruction. More...
 
+ + + + +

+Enumerations

enum  evmc_opcode {
+  OP_STOP = 0x00 +, OP_ADD = 0x01 +, OP_MUL = 0x02 +, OP_SUB = 0x03 +,
+  OP_DIV = 0x04 +, OP_SDIV = 0x05 +, OP_MOD = 0x06 +, OP_SMOD = 0x07 +,
+  OP_ADDMOD = 0x08 +, OP_MULMOD = 0x09 +, OP_EXP = 0x0a +, OP_SIGNEXTEND = 0x0b +,
+  OP_LT = 0x10 +, OP_GT = 0x11 +, OP_SLT = 0x12 +, OP_SGT = 0x13 +,
+  OP_EQ = 0x14 +, OP_ISZERO = 0x15 +, OP_AND = 0x16 +, OP_OR = 0x17 +,
+  OP_XOR = 0x18 +, OP_NOT = 0x19 +, OP_BYTE = 0x1a +, OP_SHL = 0x1b +,
+  OP_SHR = 0x1c +, OP_SAR = 0x1d +, OP_KECCAK256 = 0x20 +, OP_ADDRESS = 0x30 +,
+  OP_BALANCE = 0x31 +, OP_ORIGIN = 0x32 +, OP_CALLER = 0x33 +, OP_CALLVALUE = 0x34 +,
+  OP_CALLDATALOAD = 0x35 +, OP_CALLDATASIZE = 0x36 +, OP_CALLDATACOPY = 0x37 +, OP_CODESIZE = 0x38 +,
+  OP_CODECOPY = 0x39 +, OP_GASPRICE = 0x3a +, OP_EXTCODESIZE = 0x3b +, OP_EXTCODECOPY = 0x3c +,
+  OP_RETURNDATASIZE = 0x3d +, OP_RETURNDATACOPY = 0x3e +, OP_EXTCODEHASH = 0x3f +, OP_BLOCKHASH = 0x40 +,
+  OP_COINBASE = 0x41 +, OP_TIMESTAMP = 0x42 +, OP_NUMBER = 0x43 +, OP_PREVRANDAO = 0x44 +,
+  OP_GASLIMIT = 0x45 +, OP_CHAINID = 0x46 +, OP_SELFBALANCE = 0x47 +, OP_BASEFEE = 0x48 +,
+  OP_POP = 0x50 +, OP_MLOAD = 0x51 +, OP_MSTORE = 0x52 +, OP_MSTORE8 = 0x53 +,
+  OP_SLOAD = 0x54 +, OP_SSTORE = 0x55 +, OP_JUMP = 0x56 +, OP_JUMPI = 0x57 +,
+  OP_PC = 0x58 +, OP_MSIZE = 0x59 +, OP_GAS = 0x5a +, OP_JUMPDEST = 0x5b +,
+  OP_PUSH0 = 0x5f +, OP_PUSH1 = 0x60 +, OP_PUSH2 = 0x61 +, OP_PUSH3 = 0x62 +,
+  OP_PUSH4 = 0x63 +, OP_PUSH5 = 0x64 +, OP_PUSH6 = 0x65 +, OP_PUSH7 = 0x66 +,
+  OP_PUSH8 = 0x67 +, OP_PUSH9 = 0x68 +, OP_PUSH10 = 0x69 +, OP_PUSH11 = 0x6a +,
+  OP_PUSH12 = 0x6b +, OP_PUSH13 = 0x6c +, OP_PUSH14 = 0x6d +, OP_PUSH15 = 0x6e +,
+  OP_PUSH16 = 0x6f +, OP_PUSH17 = 0x70 +, OP_PUSH18 = 0x71 +, OP_PUSH19 = 0x72 +,
+  OP_PUSH20 = 0x73 +, OP_PUSH21 = 0x74 +, OP_PUSH22 = 0x75 +, OP_PUSH23 = 0x76 +,
+  OP_PUSH24 = 0x77 +, OP_PUSH25 = 0x78 +, OP_PUSH26 = 0x79 +, OP_PUSH27 = 0x7a +,
+  OP_PUSH28 = 0x7b +, OP_PUSH29 = 0x7c +, OP_PUSH30 = 0x7d +, OP_PUSH31 = 0x7e +,
+  OP_PUSH32 = 0x7f +, OP_DUP1 = 0x80 +, OP_DUP2 = 0x81 +, OP_DUP3 = 0x82 +,
+  OP_DUP4 = 0x83 +, OP_DUP5 = 0x84 +, OP_DUP6 = 0x85 +, OP_DUP7 = 0x86 +,
+  OP_DUP8 = 0x87 +, OP_DUP9 = 0x88 +, OP_DUP10 = 0x89 +, OP_DUP11 = 0x8a +,
+  OP_DUP12 = 0x8b +, OP_DUP13 = 0x8c +, OP_DUP14 = 0x8d +, OP_DUP15 = 0x8e +,
+  OP_DUP16 = 0x8f +, OP_SWAP1 = 0x90 +, OP_SWAP2 = 0x91 +, OP_SWAP3 = 0x92 +,
+  OP_SWAP4 = 0x93 +, OP_SWAP5 = 0x94 +, OP_SWAP6 = 0x95 +, OP_SWAP7 = 0x96 +,
+  OP_SWAP8 = 0x97 +, OP_SWAP9 = 0x98 +, OP_SWAP10 = 0x99 +, OP_SWAP11 = 0x9a +,
+  OP_SWAP12 = 0x9b +, OP_SWAP13 = 0x9c +, OP_SWAP14 = 0x9d +, OP_SWAP15 = 0x9e +,
+  OP_SWAP16 = 0x9f +, OP_LOG0 = 0xa0 +, OP_LOG1 = 0xa1 +, OP_LOG2 = 0xa2 +,
+  OP_LOG3 = 0xa3 +, OP_LOG4 = 0xa4 +, OP_CREATE = 0xf0 +, OP_CALL = 0xf1 +,
+  OP_CALLCODE = 0xf2 +, OP_RETURN = 0xf3 +, OP_DELEGATECALL = 0xf4 +, OP_CREATE2 = 0xf5 +,
+  OP_STATICCALL = 0xfa +, OP_REVERT = 0xfd +, OP_INVALID = 0xfe +, OP_SELFDESTRUCT = 0xff +
+ }
 The list of EVM 1 opcodes from every EVM revision. More...
 
+ + + + + + + +

+Functions

EVMC_EXPORT const struct evmc_instruction_metricsevmc_get_instruction_metrics_table (enum evmc_revision revision)
 Get the table of the EVM 1 instructions metrics.
 
EVMC_EXPORT const char *const * evmc_get_instruction_names_table (enum evmc_revision revision)
 Get the table of the EVM 1 instruction names.
 
+

Detailed Description

+

EVM Instruction Tables.

+

A collection of metrics for EVM1 instruction set.

+ +

Definition in file instructions.h.

+
+
+ + + + diff --git a/instructions_8h.js b/instructions_8h.js new file mode 100644 index 000000000..36eb644df --- /dev/null +++ b/instructions_8h.js @@ -0,0 +1,151 @@ +var instructions_8h = +[ + [ "evmc_opcode", "group__instructions.html#gae35f7b05b714e4dac7242a37154d48cc", [ + [ "OP_STOP", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca38847747ac27359b1fc49febe6ed24df", null ], + [ "OP_ADD", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca96186829480e5b34b1373288e956b1c8", null ], + [ "OP_MUL", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaa0e08a6f94350f03d29e4a55d543ba2f", null ], + [ "OP_SUB", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca6c224b456bd394d4d8bad0631ca8e2b7", null ], + [ "OP_DIV", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca719aeab2140dd5f575d1559b95bf74e1", null ], + [ "OP_SDIV", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca90c1a0e676aae47f0e4d9fa753f4d08f", null ], + [ "OP_MOD", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca39c596fc7eae450b7218bd97126e37c9", null ], + [ "OP_SMOD", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccae201fae593ede6c2dd89194b48aaea74", null ], + [ "OP_ADDMOD", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaf030959d4ced7b5d2453b1d5c8c120f4", null ], + [ "OP_MULMOD", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccae89cd7fe6b2a15c3bd9c1830ccd94a76", null ], + [ "OP_EXP", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaf593ceb4035d3535879a1f031f0b5f0a", null ], + [ "OP_SIGNEXTEND", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaf956ccd44718973c9932bd782bb59177", null ], + [ "OP_LT", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca7d5ed006824d331041dad8486e52df50", null ], + [ "OP_GT", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccac15bc31f8120c2dd6379564f0c163028", null ], + [ "OP_SLT", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca1697a6dce24b3c2b10857582ea2e12f4", null ], + [ "OP_SGT", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccada1e4d1bf85326e3d9fd777bca07e4f5", null ], + [ "OP_EQ", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca1634898deb6e4d1bcb15416034c641c5", null ], + [ "OP_ISZERO", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca8ced153b2cc921c5bf756eb640559cb5", null ], + [ "OP_AND", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccae2310d00f26e94b32317ecd168fb7e18", null ], + [ "OP_OR", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaf317be3def89f5f66558bbc402291176", null ], + [ "OP_XOR", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaa0587506ce6da96de3a95a97d84b0fc4", null ], + [ "OP_NOT", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca36a6b73cc4823f54891a013e2cc760d1", null ], + [ "OP_BYTE", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca089b958bd407a9108159c7b914a8888f", null ], + [ "OP_SHL", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca845012132d1f5f2d1cd125326476c25b", null ], + [ "OP_SHR", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca789f5e2846cb039c0273aff134011fd4", null ], + [ "OP_SAR", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca9dfb2c5bcc063b86581e48b2cc7a08ec", null ], + [ "OP_KECCAK256", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaabcd11f55bacab1640e656473e38a40b", null ], + [ "OP_ADDRESS", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccad6488047c2a34a0f2e288925c400c335", null ], + [ "OP_BALANCE", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccafd718cf0e4dec72338585b01ab1ebc6e", null ], + [ "OP_ORIGIN", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca79f6bea57f6249dc70256836406916f0", null ], + [ "OP_CALLER", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaba979f6172176aa3bb3375d4ce62d1c7", null ], + [ "OP_CALLVALUE", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca8266e821e33dca46749782984eb17a7f", null ], + [ "OP_CALLDATALOAD", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca1f6de130cc87ba648ff21927c8600757", null ], + [ "OP_CALLDATASIZE", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca78aa9a60ee30d6f614f97f58827f8461", null ], + [ "OP_CALLDATACOPY", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca4442a993f701f47227a7aeeb5c7a478c", null ], + [ "OP_CODESIZE", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca25d135b6d82a6a96726f38a997d2926b", null ], + [ "OP_CODECOPY", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccafdc2b4ef61cfa7ba2be8134c55b1112b", null ], + [ "OP_GASPRICE", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccab05cb4e5e58dacea78b5c3084126c056", null ], + [ "OP_EXTCODESIZE", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca35e084ebafec53af5f9debe7a66c3b0d", null ], + [ "OP_EXTCODECOPY", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca5047957431bb3a37ea082921e6c08629", null ], + [ "OP_RETURNDATASIZE", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca801847f279b8b2f94f78a395192da0a7", null ], + [ "OP_RETURNDATACOPY", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca0f4788a9a2810e22788870af6caa93dc", null ], + [ "OP_EXTCODEHASH", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccad2a732393443be805f9820bd4282057b", null ], + [ "OP_BLOCKHASH", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccac12c192482908955f6fc21d398650c5e", null ], + [ "OP_COINBASE", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaa91d6acad8d880ebdc1dd44730680810", null ], + [ "OP_TIMESTAMP", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca9a92839e1e98973f670bc58c8132a392", null ], + [ "OP_NUMBER", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca938c79e00e21ab6a1e95dd901142dded", null ], + [ "OP_PREVRANDAO", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccac26d6b554764bb319c486cd407a3d515", null ], + [ "OP_GASLIMIT", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca102406e5726ca2cd4df068bf6ea5085a", null ], + [ "OP_CHAINID", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca4a2cf591e34da64d02f6a524e39a2680", null ], + [ "OP_SELFBALANCE", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca9992aa6c24ed1ff282f7ac66287b3032", null ], + [ "OP_BASEFEE", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccac47df25124d861336d76f14e1ededa87", null ], + [ "OP_POP", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccafb3c2d934da3bfb01e4fd56338324e21", null ], + [ "OP_MLOAD", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca84e8048162510b02a7857f6758ac895f", null ], + [ "OP_MSTORE", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccac4286984f33c76ad9b8ed5f5a5d7e8cf", null ], + [ "OP_MSTORE8", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca4026e3128077ec4a2722a7e7092560f0", null ], + [ "OP_SLOAD", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca0b6a1db42a78d39d1e6f17d773803b1e", null ], + [ "OP_SSTORE", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca36235a5d6eb253561fa5a6fb1b1c5d69", null ], + [ "OP_JUMP", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca702651101fc28a886970546cf992ce3b", null ], + [ "OP_JUMPI", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccab794c328676a11836ae4766532defa61", null ], + [ "OP_PC", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca005764d30aef8f6d5eb62edcf0f4ec6b", null ], + [ "OP_MSIZE", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca828397bb1c4c01e698dbf261d1bc441f", null ], + [ "OP_GAS", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca0ca6d389494f52d4015ca328cd5ce625", null ], + [ "OP_JUMPDEST", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccacab080b9be351cfa775188b60c70f78b", null ], + [ "OP_PUSH0", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca5d68af312858d5778b82b6557abbf3fc", null ], + [ "OP_PUSH1", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca49b7e546326d363705b105e70d56e90d", null ], + [ "OP_PUSH2", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca9fc9f2d00c00eaa2976797604981bd62", null ], + [ "OP_PUSH3", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca7e55402bae8cdd0158c39cc7a79fdff1", null ], + [ "OP_PUSH4", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaad7e7914a7532c8db95bd0b34483979a", null ], + [ "OP_PUSH5", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca8129d5086c906b93d342d8778f071a37", null ], + [ "OP_PUSH6", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccae8ae07219178afe086c9a039501f4da6", null ], + [ "OP_PUSH7", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca321764a2335df6cd3653a17e78ade689", null ], + [ "OP_PUSH8", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca5054d0b80e36499600ed6f6048d20e02", null ], + [ "OP_PUSH9", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca1a807444225d892f43960c35f4a81103", null ], + [ "OP_PUSH10", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca93b1b5716363f6ffd9067162f548f4f8", null ], + [ "OP_PUSH11", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccadca61d8633a1d8fe1829cd7f34b47eb5", null ], + [ "OP_PUSH12", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaa60a18be0c4d1fc53c0fd75d44fec336", null ], + [ "OP_PUSH13", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca83996afe162910db938e156fc892811f", null ], + [ "OP_PUSH14", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca546e9dbc00de03220a7a823501cf2887", null ], + [ "OP_PUSH15", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaabaf1a1fe4f0419429815f03a7df2797", null ], + [ "OP_PUSH16", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca91178a1220c1de851f294ffe1e751039", null ], + [ "OP_PUSH17", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca9987fc94d8d87816a0aca23c38a11828", null ], + [ "OP_PUSH18", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccac39c242c8594a3d83cc5906ac1bff8ab", null ], + [ "OP_PUSH19", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca1f75873a4f5f36527fc5d0ae771db317", null ], + [ "OP_PUSH20", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca8556b7b909285100886b177c94fd8ad8", null ], + [ "OP_PUSH21", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca260fbc35996776c19b2f64e06b05e09f", null ], + [ "OP_PUSH22", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaa3e2c8cf5922d6b0ee93a4c9f9eff883", null ], + [ "OP_PUSH23", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca90637ec4823af261b7338df849476eff", null ], + [ "OP_PUSH24", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca3a55949bef986e46fc24a63f8bff55b5", null ], + [ "OP_PUSH25", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaf6dd72ee707ba1e475e164c7f4202c50", null ], + [ "OP_PUSH26", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaaaaf3d45221d757f896cb3d300975571", null ], + [ "OP_PUSH27", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaec20f2332c67a2edb243805a3b63dd52", null ], + [ "OP_PUSH28", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca7f5bf0fb5be839066d76c532c9686ed8", null ], + [ "OP_PUSH29", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca2136b65f54f10f50733f50c28b6b4309", null ], + [ "OP_PUSH30", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca9fa4efe48ccceb21123ce938ed0164ff", null ], + [ "OP_PUSH31", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaba1986e4030a3152125c6b599669cbd1", null ], + [ "OP_PUSH32", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca4b6b8d96e5cd2c018772e842ca3fecb7", null ], + [ "OP_DUP1", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca0b57bec1e27409d193fcabd91db87dcb", null ], + [ "OP_DUP2", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca09d0850a54b000a0d78e7fb6b65355d9", null ], + [ "OP_DUP3", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca7b7e57d42318829ac56e8419417313d9", null ], + [ "OP_DUP4", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccae192735fdc8a71bda807c98350c990a7", null ], + [ "OP_DUP5", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaa28301c5036b538a80a17b6739df77d2", null ], + [ "OP_DUP6", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca9e07295b8e5c526029115bffb47b0106", null ], + [ "OP_DUP7", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca9005d93b1f2da213c8ce9f95cda9b5dd", null ], + [ "OP_DUP8", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca14185f74875b81ca02eca736427c198f", null ], + [ "OP_DUP9", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccabef111264c3d3ab4c1e12e47ef90c53b", null ], + [ "OP_DUP10", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaa17009d0eb15442f960b3880ece74591", null ], + [ "OP_DUP11", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccad19e21a425cc38a9af3de7cd72b4bd59", null ], + [ "OP_DUP12", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca2739bb5f5b8df746c74e7b8651a965de", null ], + [ "OP_DUP13", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaa30d552ad6993a824f757d95ebcc4bbb", null ], + [ "OP_DUP14", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca2668f0f8314aa432db3e3e6448d0e2ba", null ], + [ "OP_DUP15", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca5f5877262e5258de1be366c51ec6b7d6", null ], + [ "OP_DUP16", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca8b633c43bcd477965adb5b278fe183fa", null ], + [ "OP_SWAP1", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca40aa9555f12e2c55568cb787f77774aa", null ], + [ "OP_SWAP2", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccae598d5aecb266e6e36a15974fd83bc7e", null ], + [ "OP_SWAP3", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca5514c19ee8e4e7abc8c8ee378d9269f8", null ], + [ "OP_SWAP4", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaa1277baf93eda5f7ed8b396e77bc49a6", null ], + [ "OP_SWAP5", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca4f397a738f1a8dda95d4b87b3355329c", null ], + [ "OP_SWAP6", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccad18ea92abe0b1aae662fdaa20b7c25fc", null ], + [ "OP_SWAP7", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca6157641e13228f0f66a47d62ccca8f9b", null ], + [ "OP_SWAP8", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca1c35be94c4de9331a0d835ca528d752b", null ], + [ "OP_SWAP9", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccafe181634ed3488a8581fcce6ce83a0ed", null ], + [ "OP_SWAP10", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca4de91d50f93dc2339dccf34c8d88ccbf", null ], + [ "OP_SWAP11", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca1bf97e31741d0c1196eb880e1ec77f7b", null ], + [ "OP_SWAP12", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca09b8ca54263da27f338038d71f20f81c", null ], + [ "OP_SWAP13", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca3ce55fda4a072b08c32d5952f845fe24", null ], + [ "OP_SWAP14", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaea5db95efab71e857581cfbe1adc3584", null ], + [ "OP_SWAP15", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca75bf18f2dd624cdfc92de5dc14d1609a", null ], + [ "OP_SWAP16", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaf111261cde76ecc2c00c9320999a992f", null ], + [ "OP_LOG0", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca20530ff71ea7fca0d7982ae91ce9f364", null ], + [ "OP_LOG1", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccabf8b44467ea1afbb8274b1189da8db54", null ], + [ "OP_LOG2", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca437c89a8da5483b705ed2d8a6ef2ef0d", null ], + [ "OP_LOG3", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca5b27747c4d4b787b494d56fdde829369", null ], + [ "OP_LOG4", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccacddd8e10355f7ec76903051327e0df8e", null ], + [ "OP_CREATE", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccab18e27cfdd22f7943cf54e149988ed77", null ], + [ "OP_CALL", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca098bbeea13096667b102f7fd90cbe38f", null ], + [ "OP_CALLCODE", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccadaa7f5ef1c0227b6ae3d2393bab2b88f", null ], + [ "OP_RETURN", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccad436c18b194473f5ec64c28b774e41b3", null ], + [ "OP_DELEGATECALL", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaaf7cd304793626277ac535955de23bad", null ], + [ "OP_CREATE2", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaa91b0deb7b94466978f0b3b23082d3f9", null ], + [ "OP_STATICCALL", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccae4c3209ce03509827ba394fec3de79e7", null ], + [ "OP_REVERT", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48ccaebb7bd58f27aa4c730bfcaf05db77b2f", null ], + [ "OP_INVALID", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca310dc72dd94edcb09d2c681abdd80a4e", null ], + [ "OP_SELFDESTRUCT", "group__instructions.html#ggae35f7b05b714e4dac7242a37154d48cca612051c0b30f11b598e9443f0effd2a4", null ] + ] ], + [ "evmc_get_instruction_metrics_table", "group__instructions.html#ga5872e8484591ba3de0960c70e856f29a", null ], + [ "evmc_get_instruction_names_table", "group__instructions.html#gab560ce330ba86ae3a568399ce68074ee", null ] +]; \ No newline at end of file diff --git a/instructions_8h_source.html b/instructions_8h_source.html new file mode 100644 index 000000000..c8d98f6ba --- /dev/null +++ b/instructions_8h_source.html @@ -0,0 +1,274 @@ + + + + + + + +EVMC: include/evmc/instructions.h Source File + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
instructions.h
+
+
+Go to the documentation of this file.
1// EVMC: Ethereum Client-VM Connector API.
+
2// Copyright 2018 The EVMC Authors.
+
3// Licensed under the Apache License, Version 2.0.
+
4
+
13#pragma once
+
14
+
15#include <evmc/evmc.h>
+
16#include <evmc/utils.h>
+
17
+
18#ifdef __cplusplus
+
19extern "C" {
+
20#endif
+
21
+ +
26{
+
27 OP_STOP = 0x00,
+
28 OP_ADD = 0x01,
+
29 OP_MUL = 0x02,
+
30 OP_SUB = 0x03,
+
31 OP_DIV = 0x04,
+
32 OP_SDIV = 0x05,
+
33 OP_MOD = 0x06,
+
34 OP_SMOD = 0x07,
+
35 OP_ADDMOD = 0x08,
+
36 OP_MULMOD = 0x09,
+
37 OP_EXP = 0x0a,
+
38 OP_SIGNEXTEND = 0x0b,
+
39
+
40 OP_LT = 0x10,
+
41 OP_GT = 0x11,
+
42 OP_SLT = 0x12,
+
43 OP_SGT = 0x13,
+
44 OP_EQ = 0x14,
+
45 OP_ISZERO = 0x15,
+
46 OP_AND = 0x16,
+
47 OP_OR = 0x17,
+
48 OP_XOR = 0x18,
+
49 OP_NOT = 0x19,
+
50 OP_BYTE = 0x1a,
+
51 OP_SHL = 0x1b,
+
52 OP_SHR = 0x1c,
+
53 OP_SAR = 0x1d,
+
54
+
55 OP_KECCAK256 = 0x20,
+
56
+
57 OP_ADDRESS = 0x30,
+
58 OP_BALANCE = 0x31,
+
59 OP_ORIGIN = 0x32,
+
60 OP_CALLER = 0x33,
+
61 OP_CALLVALUE = 0x34,
+
62 OP_CALLDATALOAD = 0x35,
+
63 OP_CALLDATASIZE = 0x36,
+
64 OP_CALLDATACOPY = 0x37,
+
65 OP_CODESIZE = 0x38,
+
66 OP_CODECOPY = 0x39,
+
67 OP_GASPRICE = 0x3a,
+
68 OP_EXTCODESIZE = 0x3b,
+
69 OP_EXTCODECOPY = 0x3c,
+
70 OP_RETURNDATASIZE = 0x3d,
+
71 OP_RETURNDATACOPY = 0x3e,
+
72 OP_EXTCODEHASH = 0x3f,
+
73
+
74 OP_BLOCKHASH = 0x40,
+
75 OP_COINBASE = 0x41,
+
76 OP_TIMESTAMP = 0x42,
+
77 OP_NUMBER = 0x43,
+
78 OP_PREVRANDAO = 0x44,
+
79 OP_GASLIMIT = 0x45,
+
80 OP_CHAINID = 0x46,
+
81 OP_SELFBALANCE = 0x47,
+
82 OP_BASEFEE = 0x48,
+
83
+
84 OP_POP = 0x50,
+
85 OP_MLOAD = 0x51,
+
86 OP_MSTORE = 0x52,
+
87 OP_MSTORE8 = 0x53,
+
88 OP_SLOAD = 0x54,
+
89 OP_SSTORE = 0x55,
+
90 OP_JUMP = 0x56,
+
91 OP_JUMPI = 0x57,
+
92 OP_PC = 0x58,
+
93 OP_MSIZE = 0x59,
+
94 OP_GAS = 0x5a,
+
95 OP_JUMPDEST = 0x5b,
+
96
+
97 OP_PUSH0 = 0x5f,
+
98 OP_PUSH1 = 0x60,
+
99 OP_PUSH2 = 0x61,
+
100 OP_PUSH3 = 0x62,
+
101 OP_PUSH4 = 0x63,
+
102 OP_PUSH5 = 0x64,
+
103 OP_PUSH6 = 0x65,
+
104 OP_PUSH7 = 0x66,
+
105 OP_PUSH8 = 0x67,
+
106 OP_PUSH9 = 0x68,
+
107 OP_PUSH10 = 0x69,
+
108 OP_PUSH11 = 0x6a,
+
109 OP_PUSH12 = 0x6b,
+
110 OP_PUSH13 = 0x6c,
+
111 OP_PUSH14 = 0x6d,
+
112 OP_PUSH15 = 0x6e,
+
113 OP_PUSH16 = 0x6f,
+
114 OP_PUSH17 = 0x70,
+
115 OP_PUSH18 = 0x71,
+
116 OP_PUSH19 = 0x72,
+
117 OP_PUSH20 = 0x73,
+
118 OP_PUSH21 = 0x74,
+
119 OP_PUSH22 = 0x75,
+
120 OP_PUSH23 = 0x76,
+
121 OP_PUSH24 = 0x77,
+
122 OP_PUSH25 = 0x78,
+
123 OP_PUSH26 = 0x79,
+
124 OP_PUSH27 = 0x7a,
+
125 OP_PUSH28 = 0x7b,
+
126 OP_PUSH29 = 0x7c,
+
127 OP_PUSH30 = 0x7d,
+
128 OP_PUSH31 = 0x7e,
+
129 OP_PUSH32 = 0x7f,
+
130 OP_DUP1 = 0x80,
+
131 OP_DUP2 = 0x81,
+
132 OP_DUP3 = 0x82,
+
133 OP_DUP4 = 0x83,
+
134 OP_DUP5 = 0x84,
+
135 OP_DUP6 = 0x85,
+
136 OP_DUP7 = 0x86,
+
137 OP_DUP8 = 0x87,
+
138 OP_DUP9 = 0x88,
+
139 OP_DUP10 = 0x89,
+
140 OP_DUP11 = 0x8a,
+
141 OP_DUP12 = 0x8b,
+
142 OP_DUP13 = 0x8c,
+
143 OP_DUP14 = 0x8d,
+
144 OP_DUP15 = 0x8e,
+
145 OP_DUP16 = 0x8f,
+
146 OP_SWAP1 = 0x90,
+
147 OP_SWAP2 = 0x91,
+
148 OP_SWAP3 = 0x92,
+
149 OP_SWAP4 = 0x93,
+
150 OP_SWAP5 = 0x94,
+
151 OP_SWAP6 = 0x95,
+
152 OP_SWAP7 = 0x96,
+
153 OP_SWAP8 = 0x97,
+
154 OP_SWAP9 = 0x98,
+
155 OP_SWAP10 = 0x99,
+
156 OP_SWAP11 = 0x9a,
+
157 OP_SWAP12 = 0x9b,
+
158 OP_SWAP13 = 0x9c,
+
159 OP_SWAP14 = 0x9d,
+
160 OP_SWAP15 = 0x9e,
+
161 OP_SWAP16 = 0x9f,
+
162 OP_LOG0 = 0xa0,
+
163 OP_LOG1 = 0xa1,
+
164 OP_LOG2 = 0xa2,
+
165 OP_LOG3 = 0xa3,
+
166 OP_LOG4 = 0xa4,
+
167
+
168 OP_CREATE = 0xf0,
+
169 OP_CALL = 0xf1,
+
170 OP_CALLCODE = 0xf2,
+
171 OP_RETURN = 0xf3,
+
172 OP_DELEGATECALL = 0xf4,
+
173 OP_CREATE2 = 0xf5,
+
174
+
175 OP_STATICCALL = 0xfa,
+
176
+
177 OP_REVERT = 0xfd,
+
178 OP_INVALID = 0xfe,
+
179 OP_SELFDESTRUCT = 0xff
+
180};
+
181
+ +
188{
+
190 int16_t gas_cost;
+
191
+ +
194
+ +
200};
+
201
+ +
210 enum evmc_revision revision);
+
211
+ +
222
+
223#ifdef __cplusplus
+
224}
+
225#endif
+
226
+ +
evmc_revision
EVM revision.
Definition: evmc.h:941
+
#define EVMC_EXPORT
Marks a function to be exported from a shared library.
Definition: utils.h:22
+
EVMC_EXPORT const struct evmc_instruction_metrics * evmc_get_instruction_metrics_table(enum evmc_revision revision)
Get the table of the EVM 1 instructions metrics.
+
EVMC_EXPORT const char *const * evmc_get_instruction_names_table(enum evmc_revision revision)
Get the table of the EVM 1 instruction names.
+
evmc_opcode
The list of EVM 1 opcodes from every EVM revision.
Definition: instructions.h:26
+
Metrics for an EVM 1 instruction.
Definition: instructions.h:188
+
int16_t gas_cost
The instruction gas cost.
Definition: instructions.h:190
+
int8_t stack_height_required
The minimum number of the EVM stack items required for the instruction.
Definition: instructions.h:193
+
int8_t stack_height_change
The EVM stack height change caused by the instruction execution, i.e.
Definition: instructions.h:199
+
A collection of helper macros to handle some non-portable features of C/C++ compilers.
+
+
+ + + + diff --git a/jquery.js b/jquery.js new file mode 100644 index 000000000..1dffb65b5 --- /dev/null +++ b/jquery.js @@ -0,0 +1,34 @@ +/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=y(e||this.defaultElement||this)[0],this.element=y(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=y(),this.hoverable=y(),this.focusable=y(),this.classesElementLookup={},e!==this&&(y.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=y(e.style?e.ownerDocument:e.document||e),this.window=y(this.document[0].defaultView||this.document[0].parentWindow)),this.options=y.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:y.noop,_create:y.noop,_init:y.noop,destroy:function(){var i=this;this._destroy(),y.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:y.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return y.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=y.widget.extend({},this.options[t]),n=0;n
"),i=e.children()[0];return y("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.widthx(D(s),D(n))?o.important="horizontal":o.important="vertical",p.using.call(this,t,o)}),h.offset(y.extend(l,{using:t}))})},y.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,h=s-o,a=o+e.collisionWidth-n-s;e.collisionWidth>n?0n?0=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),y.ui.plugin={add:function(t,e,i){var s,n=y.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&y(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){y(t).removeData("resizable").removeData("ui-resizable").off(".resizable")}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var t,e,i,s,n,o=this.options,h=this;if(this.handles=o.handles||(y(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=y(),this._addedHandles=y(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=y(this.handles[e]),this._on(this.handles[e],{mousedown:h._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=y(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){h.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),h.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=y(this.handles[e])[0])!==t.target&&!y.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=y(s.containment).scrollLeft()||0,i+=y(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=y(".ui-resizable-"+this.axis).css("cursor"),y("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),y.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,i=e?0:o.sizeDiff.width,e={width:o.helper.width()-i,height:o.helper.height()-s},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(y.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper&&!n.animate&&this._proportionallyResize()),y("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,n={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,s=n.maxHeight*this.aspectRatio,t=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),i>n.minHeight&&(n.minHeight=i),st.width,h=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,r=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),h&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=a-e.minWidth),s&&l&&(t.left=a-e.maxWidth),h&&i&&(t.top=r-e.minHeight),n&&i&&(t.top=r-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return y.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return y.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){y.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),y.ui.plugin.add("resizable","animate",{stop:function(e){var i=y(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,h=n?0:i.sizeDiff.width,n={width:i.size.width-h,height:i.size.height-o},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,o=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(y.extend(n,o&&h?{top:o,left:h}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&y(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),y.ui.plugin.add("resizable","containment",{start:function(){var i,s,n=y(this).resizable("instance"),t=n.options,e=n.element,o=t.containment,h=o instanceof y?o.get(0):/parent/.test(o)?e.parent().get(0):o;h&&(n.containerElement=y(h),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:y(document),left:0,top:0,width:y(document).width(),height:y(document).height()||document.body.parentNode.scrollHeight}):(i=y(h),s=[],y(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=n.containerOffset,e=n.containerSize.height,o=n.containerSize.width,o=n._hasScroll(h,"left")?h.scrollWidth:o,e=n._hasScroll(h)?h.scrollHeight:e,n.parentData={element:h,left:t.left,top:t.top,width:o,height:e}))},resize:function(t){var e=y(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,o=e._aspectRatio||t.shiftKey,h={top:0,left:0},a=e.containerElement,t=!0;a[0]!==document&&/static/.test(a.css("position"))&&(h=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-h.left),o&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),o&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0),i=e.containerElement.get(0)===e.element.parent().get(0),n=/relative|absolute/.test(e.containerElement.css("position")),i&&n?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-h.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-h.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,o&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,o&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=y(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=y(t.helper),h=o.offset(),a=o.outerWidth()-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o})}}),y.ui.plugin.add("resizable","alsoResize",{start:function(){var t=y(this).resizable("instance").options;y(t.alsoResize).each(function(){var t=y(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=y(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,h={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left:e.position.left-o.left||0};y(s.alsoResize).each(function(){var t=y(this),s=y(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];y.each(e,function(t,e){var i=(s[e]||0)+(h[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){y(this).removeData("ui-resizable-alsoresize")}}),y.ui.plugin.add("resizable","ghost",{start:function(){var t=y(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==y.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=y(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=y(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),y.ui.plugin.add("resizable","grid",{resize:function(){var t,e=y(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,h=e.axis,a="number"==typeof i.grid?[i.grid,i.grid]:i.grid,r=a[0]||1,l=a[1]||1,u=Math.round((s.width-n.width)/r)*r,p=Math.round((s.height-n.height)/l)*l,d=n.width+u,c=n.height+p,f=i.maxWidth&&i.maxWidthd,s=i.minHeight&&i.minHeight>c;i.grid=a,m&&(d+=r),s&&(c+=l),f&&(d-=r),g&&(c-=l),/^(se|s|e)$/.test(h)?(e.size.width=d,e.size.height=c):/^(ne)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.top=o.top-p):/^(sw)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.left=o.left-u):((c-l<=0||d-r<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0=f[g]?0:Math.min(f[g],n));!a&&1-1){targetElements.on(evt+EVENT_NAMESPACE,function elementToggle(event){$.powerTip.toggle(this,event)})}else{targetElements.on(evt+EVENT_NAMESPACE,function elementOpen(event){$.powerTip.show(this,event)})}});$.each(options.closeEvents,function(idx,evt){if($.inArray(evt,options.openEvents)<0){targetElements.on(evt+EVENT_NAMESPACE,function elementClose(event){$.powerTip.hide(this,!isMouseEvent(event))})}});targetElements.on("keydown"+EVENT_NAMESPACE,function elementKeyDown(event){if(event.keyCode===27){$.powerTip.hide(this,true)}})}return targetElements};$.fn.powerTip.defaults={fadeInTime:200,fadeOutTime:100,followMouse:false,popupId:"powerTip",popupClass:null,intentSensitivity:7,intentPollInterval:100,closeDelay:100,placement:"n",smartPlacement:false,offset:10,mouseOnToPopup:false,manual:false,openEvents:["mouseenter","focus"],closeEvents:["mouseleave","blur"]};$.fn.powerTip.smartPlacementLists={n:["n","ne","nw","s"],e:["e","ne","se","w","nw","sw","n","s","e"],s:["s","se","sw","n"],w:["w","nw","sw","e","ne","se","n","s","w"],nw:["nw","w","sw","n","s","se","nw"],ne:["ne","e","se","n","s","sw","ne"],sw:["sw","w","nw","s","n","ne","sw"],se:["se","e","ne","s","n","nw","se"],"nw-alt":["nw-alt","n","ne-alt","sw-alt","s","se-alt","w","e"],"ne-alt":["ne-alt","n","nw-alt","se-alt","s","sw-alt","e","w"],"sw-alt":["sw-alt","s","se-alt","nw-alt","n","ne-alt","w","e"],"se-alt":["se-alt","s","sw-alt","ne-alt","n","nw-alt","e","w"]};$.powerTip={show:function apiShowTip(element,event){if(isMouseEvent(event)){trackMouse(event);session.previousX=event.pageX;session.previousY=event.pageY;$(element).data(DATA_DISPLAYCONTROLLER).show()}else{$(element).first().data(DATA_DISPLAYCONTROLLER).show(true,true)}return element},reposition:function apiResetPosition(element){$(element).first().data(DATA_DISPLAYCONTROLLER).resetPosition();return element},hide:function apiCloseTip(element,immediate){var displayController;immediate=element?immediate:true;if(element){displayController=$(element).first().data(DATA_DISPLAYCONTROLLER)}else if(session.activeHover){displayController=session.activeHover.data(DATA_DISPLAYCONTROLLER)}if(displayController){displayController.hide(immediate)}return element},toggle:function apiToggle(element,event){if(session.activeHover&&session.activeHover.is(element)){$.powerTip.hide(element,!isMouseEvent(event))}else{$.powerTip.show(element,event)}return element}};$.powerTip.showTip=$.powerTip.show;$.powerTip.closeTip=$.powerTip.hide;function CSSCoordinates(){var me=this;me.top="auto";me.left="auto";me.right="auto";me.bottom="auto";me.set=function(property,value){if($.isNumeric(value)){me[property]=Math.round(value)}}}function DisplayController(element,options,tipController){var hoverTimer=null,myCloseDelay=null;function openTooltip(immediate,forceOpen){cancelTimer();if(!element.data(DATA_HASACTIVEHOVER)){if(!immediate){session.tipOpenImminent=true;hoverTimer=setTimeout(function intentDelay(){hoverTimer=null;checkForIntent()},options.intentPollInterval)}else{if(forceOpen){element.data(DATA_FORCEDOPEN,true)}closeAnyDelayed();tipController.showTip(element)}}else{cancelClose()}}function closeTooltip(disableDelay){if(myCloseDelay){myCloseDelay=session.closeDelayTimeout=clearTimeout(myCloseDelay);session.delayInProgress=false}cancelTimer();session.tipOpenImminent=false;if(element.data(DATA_HASACTIVEHOVER)){element.data(DATA_FORCEDOPEN,false);if(!disableDelay){session.delayInProgress=true;session.closeDelayTimeout=setTimeout(function closeDelay(){session.closeDelayTimeout=null;tipController.hideTip(element);session.delayInProgress=false;myCloseDelay=null},options.closeDelay);myCloseDelay=session.closeDelayTimeout}else{tipController.hideTip(element)}}}function checkForIntent(){var xDifference=Math.abs(session.previousX-session.currentX),yDifference=Math.abs(session.previousY-session.currentY),totalDifference=xDifference+yDifference;if(totalDifference",{id:options.popupId});if($body.length===0){$body=$("body")}$body.append(tipElement);session.tooltips=session.tooltips?session.tooltips.add(tipElement):tipElement}if(options.followMouse){if(!tipElement.data(DATA_HASMOUSEMOVE)){$document.on("mousemove"+EVENT_NAMESPACE,positionTipOnCursor);$window.on("scroll"+EVENT_NAMESPACE,positionTipOnCursor);tipElement.data(DATA_HASMOUSEMOVE,true)}}function beginShowTip(element){element.data(DATA_HASACTIVEHOVER,true);tipElement.queue(function queueTipInit(next){showTip(element);next()})}function showTip(element){var tipContent;if(!element.data(DATA_HASACTIVEHOVER)){return}if(session.isTipOpen){if(!session.isClosing){hideTip(session.activeHover)}tipElement.delay(100).queue(function queueTipAgain(next){showTip(element);next()});return}element.trigger("powerTipPreRender");tipContent=getTooltipContent(element);if(tipContent){tipElement.empty().append(tipContent)}else{return}element.trigger("powerTipRender");session.activeHover=element;session.isTipOpen=true;tipElement.data(DATA_MOUSEONTOTIP,options.mouseOnToPopup);tipElement.addClass(options.popupClass);if(!options.followMouse||element.data(DATA_FORCEDOPEN)){positionTipOnElement(element);session.isFixedTipOpen=true}else{positionTipOnCursor()}if(!element.data(DATA_FORCEDOPEN)&&!options.followMouse){$document.on("click"+EVENT_NAMESPACE,function documentClick(event){var target=event.target;if(target!==element[0]){if(options.mouseOnToPopup){if(target!==tipElement[0]&&!$.contains(tipElement[0],target)){$.powerTip.hide()}}else{$.powerTip.hide()}}})}if(options.mouseOnToPopup&&!options.manual){tipElement.on("mouseenter"+EVENT_NAMESPACE,function tipMouseEnter(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).cancel()}});tipElement.on("mouseleave"+EVENT_NAMESPACE,function tipMouseLeave(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).hide()}})}tipElement.fadeIn(options.fadeInTime,function fadeInCallback(){if(!session.desyncTimeout){session.desyncTimeout=setInterval(closeDesyncedTip,500)}element.trigger("powerTipOpen")})}function hideTip(element){session.isClosing=true;session.isTipOpen=false;session.desyncTimeout=clearInterval(session.desyncTimeout);element.data(DATA_HASACTIVEHOVER,false);element.data(DATA_FORCEDOPEN,false);$document.off("click"+EVENT_NAMESPACE);tipElement.off(EVENT_NAMESPACE);tipElement.fadeOut(options.fadeOutTime,function fadeOutCallback(){var coords=new CSSCoordinates;session.activeHover=null;session.isClosing=false;session.isFixedTipOpen=false;tipElement.removeClass();coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);tipElement.css(coords);element.trigger("powerTipClose")})}function positionTipOnCursor(){var tipWidth,tipHeight,coords,collisions,collisionCount;if(!session.isFixedTipOpen&&(session.isTipOpen||session.tipOpenImminent&&tipElement.data(DATA_HASMOUSEMOVE))){tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=new CSSCoordinates;coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);collisions=getViewportCollisions(coords,tipWidth,tipHeight);if(collisions!==Collision.none){collisionCount=countFlags(collisions);if(collisionCount===1){if(collisions===Collision.right){coords.set("left",session.scrollLeft+session.windowWidth-tipWidth)}else if(collisions===Collision.bottom){coords.set("top",session.scrollTop+session.windowHeight-tipHeight)}}else{coords.set("left",session.currentX-tipWidth-options.offset);coords.set("top",session.currentY-tipHeight-options.offset)}}tipElement.css(coords)}}function positionTipOnElement(element){var priorityList,finalPlacement;if(options.smartPlacement||options.followMouse&&element.data(DATA_FORCEDOPEN)){priorityList=$.fn.powerTip.smartPlacementLists[options.placement];$.each(priorityList,function(idx,pos){var collisions=getViewportCollisions(placeTooltip(element,pos),tipElement.outerWidth(),tipElement.outerHeight());finalPlacement=pos;return collisions!==Collision.none})}else{placeTooltip(element,options.placement);finalPlacement=options.placement}tipElement.removeClass("w nw sw e ne se n s w se-alt sw-alt ne-alt nw-alt");tipElement.addClass(finalPlacement)}function placeTooltip(element,placement){var iterationCount=0,tipWidth,tipHeight,coords=new CSSCoordinates;coords.set("top",0);coords.set("left",0);tipElement.css(coords);do{tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=placementCalculator.compute(element,placement,tipWidth,tipHeight,options.offset);tipElement.css(coords)}while(++iterationCount<=5&&(tipWidth!==tipElement.outerWidth()||tipHeight!==tipElement.outerHeight()));return coords}function closeDesyncedTip(){var isDesynced=false,hasDesyncableCloseEvent=$.grep(["mouseleave","mouseout","blur","focusout"],function(eventType){return $.inArray(eventType,options.closeEvents)!==-1}).length>0;if(session.isTipOpen&&!session.isClosing&&!session.delayInProgress&&hasDesyncableCloseEvent){if(session.activeHover.data(DATA_HASACTIVEHOVER)===false||session.activeHover.is(":disabled")){isDesynced=true}else if(!isMouseOver(session.activeHover)&&!session.activeHover.is(":focus")&&!session.activeHover.data(DATA_FORCEDOPEN)){if(tipElement.data(DATA_MOUSEONTOTIP)){if(!isMouseOver(tipElement)){isDesynced=true}}else{isDesynced=true}}if(isDesynced){hideTip(session.activeHover)}}}this.showTip=beginShowTip;this.hideTip=hideTip;this.resetPosition=positionTipOnElement}function isSvgElement(element){return Boolean(window.SVGElement&&element[0]instanceof SVGElement)}function isMouseEvent(event){return Boolean(event&&$.inArray(event.type,MOUSE_EVENTS)>-1&&typeof event.pageX==="number")}function initTracking(){if(!session.mouseTrackingActive){session.mouseTrackingActive=true;getViewportDimensions();$(getViewportDimensions);$document.on("mousemove"+EVENT_NAMESPACE,trackMouse);$window.on("resize"+EVENT_NAMESPACE,trackResize);$window.on("scroll"+EVENT_NAMESPACE,trackScroll)}}function getViewportDimensions(){session.scrollLeft=$window.scrollLeft();session.scrollTop=$window.scrollTop();session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackResize(){session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackScroll(){var x=$window.scrollLeft(),y=$window.scrollTop();if(x!==session.scrollLeft){session.currentX+=x-session.scrollLeft;session.scrollLeft=x}if(y!==session.scrollTop){session.currentY+=y-session.scrollTop;session.scrollTop=y}}function trackMouse(event){session.currentX=event.pageX;session.currentY=event.pageY}function isMouseOver(element){var elementPosition=element.offset(),elementBox=element[0].getBoundingClientRect(),elementWidth=elementBox.right-elementBox.left,elementHeight=elementBox.bottom-elementBox.top;return session.currentX>=elementPosition.left&&session.currentX<=elementPosition.left+elementWidth&&session.currentY>=elementPosition.top&&session.currentY<=elementPosition.top+elementHeight}function getTooltipContent(element){var tipText=element.data(DATA_POWERTIP),tipObject=element.data(DATA_POWERTIPJQ),tipTarget=element.data(DATA_POWERTIPTARGET),targetElement,content;if(tipText){if($.isFunction(tipText)){tipText=tipText.call(element[0])}content=tipText}else if(tipObject){if($.isFunction(tipObject)){tipObject=tipObject.call(element[0])}if(tipObject.length>0){content=tipObject.clone(true,true)}}else if(tipTarget){targetElement=$("#"+tipTarget);if(targetElement.length>0){content=targetElement.html()}}return content}function getViewportCollisions(coords,elementWidth,elementHeight){var viewportTop=session.scrollTop,viewportLeft=session.scrollLeft,viewportBottom=viewportTop+session.windowHeight,viewportRight=viewportLeft+session.windowWidth,collisions=Collision.none;if(coords.topviewportBottom||Math.abs(coords.bottom-session.windowHeight)>viewportBottom){collisions|=Collision.bottom}if(coords.leftviewportRight){collisions|=Collision.left}if(coords.left+elementWidth>viewportRight||coords.right1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);/*! SmartMenus jQuery Plugin - v1.1.0 - September 17, 2017 + * http://www.smartmenus.org/ + * Copyright Vasil Dinkov, Vadikom Web Ltd. http://vadikom.com; Licensed MIT */(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("jquery")):t(jQuery)})(function($){function initMouseDetection(t){var e=".smartmenus_mouse";if(mouseDetectionEnabled||t)mouseDetectionEnabled&&t&&($(document).off(e),mouseDetectionEnabled=!1);else{var i=!0,s=null,o={mousemove:function(t){var e={x:t.pageX,y:t.pageY,timeStamp:(new Date).getTime()};if(s){var o=Math.abs(s.x-e.x),a=Math.abs(s.y-e.y);if((o>0||a>0)&&2>=o&&2>=a&&300>=e.timeStamp-s.timeStamp&&(mouse=!0,i)){var n=$(t.target).closest("a");n.is("a")&&$.each(menuTrees,function(){return $.contains(this.$root[0],n[0])?(this.itemEnter({currentTarget:n[0]}),!1):void 0}),i=!1}}s=e}};o[touchEvents?"touchstart":"pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut"]=function(t){isTouchEvent(t.originalEvent)&&(mouse=!1)},$(document).on(getEventsNS(o,e)),mouseDetectionEnabled=!0}}function isTouchEvent(t){return!/^(4|mouse)$/.test(t.pointerType)}function getEventsNS(t,e){e||(e="");var i={};for(var s in t)i[s.split(" ").join(e+" ")+e]=t[s];return i}var menuTrees=[],mouse=!1,touchEvents="ontouchstart"in window,mouseDetectionEnabled=!1,requestAnimationFrame=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||function(t){clearTimeout(t)},canAnimate=!!$.fn.animate;return $.SmartMenus=function(t,e){this.$root=$(t),this.opts=e,this.rootId="",this.accessIdPrefix="",this.$subArrow=null,this.activatedItems=[],this.visibleSubMenus=[],this.showTimeout=0,this.hideTimeout=0,this.scrollTimeout=0,this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.idInc=0,this.$firstLink=null,this.$firstSub=null,this.disabled=!1,this.$disableOverlay=null,this.$touchScrollingSub=null,this.cssTransforms3d="perspective"in t.style||"webkitPerspective"in t.style,this.wasCollapsible=!1,this.init()},$.extend($.SmartMenus,{hideAll:function(){$.each(menuTrees,function(){this.menuHideAll()})},destroy:function(){for(;menuTrees.length;)menuTrees[0].destroy();initMouseDetection(!0)},prototype:{init:function(t){var e=this;if(!t){menuTrees.push(this),this.rootId=((new Date).getTime()+Math.random()+"").replace(/\D/g,""),this.accessIdPrefix="sm-"+this.rootId+"-",this.$root.hasClass("sm-rtl")&&(this.opts.rightToLeftSubMenus=!0);var i=".smartmenus";this.$root.data("smartmenus",this).attr("data-smartmenus-id",this.rootId).dataSM("level",1).on(getEventsNS({"mouseover focusin":$.proxy(this.rootOver,this),"mouseout focusout":$.proxy(this.rootOut,this),keydown:$.proxy(this.rootKeyDown,this)},i)).on(getEventsNS({mouseenter:$.proxy(this.itemEnter,this),mouseleave:$.proxy(this.itemLeave,this),mousedown:$.proxy(this.itemDown,this),focus:$.proxy(this.itemFocus,this),blur:$.proxy(this.itemBlur,this),click:$.proxy(this.itemClick,this)},i),"a"),i+=this.rootId,this.opts.hideOnClick&&$(document).on(getEventsNS({touchstart:$.proxy(this.docTouchStart,this),touchmove:$.proxy(this.docTouchMove,this),touchend:$.proxy(this.docTouchEnd,this),click:$.proxy(this.docClick,this)},i)),$(window).on(getEventsNS({"resize orientationchange":$.proxy(this.winResize,this)},i)),this.opts.subIndicators&&(this.$subArrow=$("").addClass("sub-arrow"),this.opts.subIndicatorsText&&this.$subArrow.html(this.opts.subIndicatorsText)),initMouseDetection()}if(this.$firstSub=this.$root.find("ul").each(function(){e.menuInit($(this))}).eq(0),this.$firstLink=this.$root.find("a").eq(0),this.opts.markCurrentItem){var s=/(index|default)\.[^#\?\/]*/i,o=/#.*/,a=window.location.href.replace(s,""),n=a.replace(o,"");this.$root.find("a").each(function(){var t=this.href.replace(s,""),i=$(this);(t==a||t==n)&&(i.addClass("current"),e.opts.markCurrentTree&&i.parentsUntil("[data-smartmenus-id]","ul").each(function(){$(this).dataSM("parent-a").addClass("current")}))})}this.wasCollapsible=this.isCollapsible()},destroy:function(t){if(!t){var e=".smartmenus";this.$root.removeData("smartmenus").removeAttr("data-smartmenus-id").removeDataSM("level").off(e),e+=this.rootId,$(document).off(e),$(window).off(e),this.opts.subIndicators&&(this.$subArrow=null)}this.menuHideAll();var i=this;this.$root.find("ul").each(function(){var t=$(this);t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.dataSM("shown-before")&&((i.opts.subMenusMinWidth||i.opts.subMenusMaxWidth)&&t.css({width:"",minWidth:"",maxWidth:""}).removeClass("sm-nowrap"),t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.css({zIndex:"",top:"",left:"",marginLeft:"",marginTop:"",display:""})),0==(t.attr("id")||"").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeDataSM("in-mega").removeDataSM("shown-before").removeDataSM("scroll-arrows").removeDataSM("parent-a").removeDataSM("level").removeDataSM("beforefirstshowfired").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeAttr("aria-expanded"),this.$root.find("a.has-submenu").each(function(){var t=$(this);0==t.attr("id").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeClass("has-submenu").removeDataSM("sub").removeAttr("aria-haspopup").removeAttr("aria-controls").removeAttr("aria-expanded").closest("li").removeDataSM("sub"),this.opts.subIndicators&&this.$root.find("span.sub-arrow").remove(),this.opts.markCurrentItem&&this.$root.find("a.current").removeClass("current"),t||(this.$root=null,this.$firstLink=null,this.$firstSub=null,this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),menuTrees.splice($.inArray(this,menuTrees),1))},disable:function(t){if(!this.disabled){if(this.menuHideAll(),!t&&!this.opts.isPopup&&this.$root.is(":visible")){var e=this.$root.offset();this.$disableOverlay=$('
').css({position:"absolute",top:e.top,left:e.left,width:this.$root.outerWidth(),height:this.$root.outerHeight(),zIndex:this.getStartZIndex(!0),opacity:0}).appendTo(document.body)}this.disabled=!0}},docClick:function(t){return this.$touchScrollingSub?(this.$touchScrollingSub=null,void 0):((this.visibleSubMenus.length&&!$.contains(this.$root[0],t.target)||$(t.target).closest("a").length)&&this.menuHideAll(),void 0)},docTouchEnd:function(){if(this.lastTouch){if(!(!this.visibleSubMenus.length||void 0!==this.lastTouch.x2&&this.lastTouch.x1!=this.lastTouch.x2||void 0!==this.lastTouch.y2&&this.lastTouch.y1!=this.lastTouch.y2||this.lastTouch.target&&$.contains(this.$root[0],this.lastTouch.target))){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var t=this;this.hideTimeout=setTimeout(function(){t.menuHideAll()},350)}this.lastTouch=null}},docTouchMove:function(t){if(this.lastTouch){var e=t.originalEvent.touches[0];this.lastTouch.x2=e.pageX,this.lastTouch.y2=e.pageY}},docTouchStart:function(t){var e=t.originalEvent.touches[0];this.lastTouch={x1:e.pageX,y1:e.pageY,target:e.target}},enable:function(){this.disabled&&(this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),this.disabled=!1)},getClosestMenu:function(t){for(var e=$(t).closest("ul");e.dataSM("in-mega");)e=e.parent().closest("ul");return e[0]||null},getHeight:function(t){return this.getOffset(t,!0)},getOffset:function(t,e){var i;"none"==t.css("display")&&(i={position:t[0].style.position,visibility:t[0].style.visibility},t.css({position:"absolute",visibility:"hidden"}).show());var s=t[0].getBoundingClientRect&&t[0].getBoundingClientRect(),o=s&&(e?s.height||s.bottom-s.top:s.width||s.right-s.left);return o||0===o||(o=e?t[0].offsetHeight:t[0].offsetWidth),i&&t.hide().css(i),o},getStartZIndex:function(t){var e=parseInt(this[t?"$root":"$firstSub"].css("z-index"));return!t&&isNaN(e)&&(e=parseInt(this.$root.css("z-index"))),isNaN(e)?1:e},getTouchPoint:function(t){return t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0]||t},getViewport:function(t){var e=t?"Height":"Width",i=document.documentElement["client"+e],s=window["inner"+e];return s&&(i=Math.min(i,s)),i},getViewportHeight:function(){return this.getViewport(!0)},getViewportWidth:function(){return this.getViewport()},getWidth:function(t){return this.getOffset(t)},handleEvents:function(){return!this.disabled&&this.isCSSOn()},handleItemEvents:function(t){return this.handleEvents()&&!this.isLinkInMegaMenu(t)},isCollapsible:function(){return"static"==this.$firstSub.css("position")},isCSSOn:function(){return"inline"!=this.$firstLink.css("display")},isFixed:function(){var t="fixed"==this.$root.css("position");return t||this.$root.parentsUntil("body").each(function(){return"fixed"==$(this).css("position")?(t=!0,!1):void 0}),t},isLinkInMegaMenu:function(t){return $(this.getClosestMenu(t[0])).hasClass("mega-menu")},isTouchMode:function(){return!mouse||this.opts.noMouseOver||this.isCollapsible()},itemActivate:function(t,e){var i=t.closest("ul"),s=i.dataSM("level");if(s>1&&(!this.activatedItems[s-2]||this.activatedItems[s-2][0]!=i.dataSM("parent-a")[0])){var o=this;$(i.parentsUntil("[data-smartmenus-id]","ul").get().reverse()).add(i).each(function(){o.itemActivate($(this).dataSM("parent-a"))})}if((!this.isCollapsible()||e)&&this.menuHideSubMenus(this.activatedItems[s-1]&&this.activatedItems[s-1][0]==t[0]?s:s-1),this.activatedItems[s-1]=t,this.$root.triggerHandler("activate.smapi",t[0])!==!1){var a=t.dataSM("sub");a&&(this.isTouchMode()||!this.opts.showOnClick||this.clickActivated)&&this.menuShow(a)}},itemBlur:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&this.$root.triggerHandler("blur.smapi",e[0])},itemClick:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(this.$touchScrollingSub&&this.$touchScrollingSub[0]==e.closest("ul")[0])return this.$touchScrollingSub=null,t.stopPropagation(),!1;if(this.$root.triggerHandler("click.smapi",e[0])===!1)return!1;var i=$(t.target).is(".sub-arrow"),s=e.dataSM("sub"),o=s?2==s.dataSM("level"):!1,a=this.isCollapsible(),n=/toggle$/.test(this.opts.collapsibleBehavior),r=/link$/.test(this.opts.collapsibleBehavior),h=/^accordion/.test(this.opts.collapsibleBehavior);if(s&&!s.is(":visible")){if((!r||!a||i)&&(this.opts.showOnClick&&o&&(this.clickActivated=!0),this.itemActivate(e,h),s.is(":visible")))return this.focusActivated=!0,!1}else if(a&&(n||i))return this.itemActivate(e,h),this.menuHide(s),n&&(this.focusActivated=!1),!1;return this.opts.showOnClick&&o||e.hasClass("disabled")||this.$root.triggerHandler("select.smapi",e[0])===!1?!1:void 0}},itemDown:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&e.dataSM("mousedown",!0)},itemEnter:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(!this.isTouchMode()){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);var i=this;this.showTimeout=setTimeout(function(){i.itemActivate(e)},this.opts.showOnClick&&1==e.closest("ul").dataSM("level")?1:this.opts.showTimeout)}this.$root.triggerHandler("mouseenter.smapi",e[0])}},itemFocus:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(!this.focusActivated||this.isTouchMode()&&e.dataSM("mousedown")||this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0]==e[0]||this.itemActivate(e,!0),this.$root.triggerHandler("focus.smapi",e[0]))},itemLeave:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(this.isTouchMode()||(e[0].blur(),this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0)),e.removeDataSM("mousedown"),this.$root.triggerHandler("mouseleave.smapi",e[0]))},menuHide:function(t){if(this.$root.triggerHandler("beforehide.smapi",t[0])!==!1&&(canAnimate&&t.stop(!0,!0),"none"!=t.css("display"))){var e=function(){t.css("z-index","")};this.isCollapsible()?canAnimate&&this.opts.collapsibleHideFunction?this.opts.collapsibleHideFunction.call(this,t,e):t.hide(this.opts.collapsibleHideDuration,e):canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,t,e):t.hide(this.opts.hideDuration,e),t.dataSM("scroll")&&(this.menuScrollStop(t),t.css({"touch-action":"","-ms-touch-action":"","-webkit-transform":"",transform:""}).off(".smartmenus_scroll").removeDataSM("scroll").dataSM("scroll-arrows").hide()),t.dataSM("parent-a").removeClass("highlighted").attr("aria-expanded","false"),t.attr({"aria-expanded":"false","aria-hidden":"true"});var i=t.dataSM("level");this.activatedItems.splice(i-1,1),this.visibleSubMenus.splice($.inArray(t,this.visibleSubMenus),1),this.$root.triggerHandler("hide.smapi",t[0])}},menuHideAll:function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);for(var t=this.opts.isPopup?1:0,e=this.visibleSubMenus.length-1;e>=t;e--)this.menuHide(this.visibleSubMenus[e]);this.opts.isPopup&&(canAnimate&&this.$root.stop(!0,!0),this.$root.is(":visible")&&(canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,this.$root):this.$root.hide(this.opts.hideDuration))),this.activatedItems=[],this.visibleSubMenus=[],this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.$root.triggerHandler("hideAll.smapi")},menuHideSubMenus:function(t){for(var e=this.activatedItems.length-1;e>=t;e--){var i=this.activatedItems[e].dataSM("sub");i&&this.menuHide(i)}},menuInit:function(t){if(!t.dataSM("in-mega")){t.hasClass("mega-menu")&&t.find("ul").dataSM("in-mega",!0);for(var e=2,i=t[0];(i=i.parentNode.parentNode)!=this.$root[0];)e++;var s=t.prevAll("a").eq(-1);s.length||(s=t.prevAll().find("a").eq(-1)),s.addClass("has-submenu").dataSM("sub",t),t.dataSM("parent-a",s).dataSM("level",e).parent().dataSM("sub",t);var o=s.attr("id")||this.accessIdPrefix+ ++this.idInc,a=t.attr("id")||this.accessIdPrefix+ ++this.idInc;s.attr({id:o,"aria-haspopup":"true","aria-controls":a,"aria-expanded":"false"}),t.attr({id:a,role:"group","aria-hidden":"true","aria-labelledby":o,"aria-expanded":"false"}),this.opts.subIndicators&&s[this.opts.subIndicatorsPos](this.$subArrow.clone())}},menuPosition:function(t){var e,i,s=t.dataSM("parent-a"),o=s.closest("li"),a=o.parent(),n=t.dataSM("level"),r=this.getWidth(t),h=this.getHeight(t),u=s.offset(),l=u.left,c=u.top,d=this.getWidth(s),m=this.getHeight(s),p=$(window),f=p.scrollLeft(),v=p.scrollTop(),b=this.getViewportWidth(),S=this.getViewportHeight(),g=a.parent().is("[data-sm-horizontal-sub]")||2==n&&!a.hasClass("sm-vertical"),M=this.opts.rightToLeftSubMenus&&!o.is("[data-sm-reverse]")||!this.opts.rightToLeftSubMenus&&o.is("[data-sm-reverse]"),w=2==n?this.opts.mainMenuSubOffsetX:this.opts.subMenusSubOffsetX,T=2==n?this.opts.mainMenuSubOffsetY:this.opts.subMenusSubOffsetY;if(g?(e=M?d-r-w:w,i=this.opts.bottomToTopSubMenus?-h-T:m+T):(e=M?w-r:d-w,i=this.opts.bottomToTopSubMenus?m-T-h:T),this.opts.keepInViewport){var y=l+e,I=c+i;if(M&&f>y?e=g?f-y+e:d-w:!M&&y+r>f+b&&(e=g?f+b-r-y+e:w-r),g||(S>h&&I+h>v+S?i+=v+S-h-I:(h>=S||v>I)&&(i+=v-I)),g&&(I+h>v+S+.49||v>I)||!g&&h>S+.49){var x=this;t.dataSM("scroll-arrows")||t.dataSM("scroll-arrows",$([$('')[0],$('')[0]]).on({mouseenter:function(){t.dataSM("scroll").up=$(this).hasClass("scroll-up"),x.menuScroll(t)},mouseleave:function(e){x.menuScrollStop(t),x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(t){t.preventDefault()}}).insertAfter(t));var A=".smartmenus_scroll";if(t.dataSM("scroll",{y:this.cssTransforms3d?0:i-m,step:1,itemH:m,subH:h,arrowDownH:this.getHeight(t.dataSM("scroll-arrows").eq(1))}).on(getEventsNS({mouseover:function(e){x.menuScrollOver(t,e)},mouseout:function(e){x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(e){x.menuScrollMousewheel(t,e)}},A)).dataSM("scroll-arrows").css({top:"auto",left:"0",marginLeft:e+(parseInt(t.css("border-left-width"))||0),width:r-(parseInt(t.css("border-left-width"))||0)-(parseInt(t.css("border-right-width"))||0),zIndex:t.css("z-index")}).eq(g&&this.opts.bottomToTopSubMenus?0:1).show(),this.isFixed()){var C={};C[touchEvents?"touchstart touchmove touchend":"pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp"]=function(e){x.menuScrollTouch(t,e)},t.css({"touch-action":"none","-ms-touch-action":"none"}).on(getEventsNS(C,A))}}}t.css({top:"auto",left:"0",marginLeft:e,marginTop:i-m})},menuScroll:function(t,e,i){var s,o=t.dataSM("scroll"),a=t.dataSM("scroll-arrows"),n=o.up?o.upEnd:o.downEnd;if(!e&&o.momentum){if(o.momentum*=.92,s=o.momentum,.5>s)return this.menuScrollStop(t),void 0}else s=i||(e||!this.opts.scrollAccelerate?this.opts.scrollStep:Math.floor(o.step));var r=t.dataSM("level");if(this.activatedItems[r-1]&&this.activatedItems[r-1].dataSM("sub")&&this.activatedItems[r-1].dataSM("sub").is(":visible")&&this.menuHideSubMenus(r-1),o.y=o.up&&o.y>=n||!o.up&&n>=o.y?o.y:Math.abs(n-o.y)>s?o.y+(o.up?s:-s):n,t.css(this.cssTransforms3d?{"-webkit-transform":"translate3d(0, "+o.y+"px, 0)",transform:"translate3d(0, "+o.y+"px, 0)"}:{marginTop:o.y}),mouse&&(o.up&&o.y>o.downEnd||!o.up&&o.y0;t.dataSM("scroll-arrows").eq(i?0:1).is(":visible")&&(t.dataSM("scroll").up=i,this.menuScroll(t,!0))}e.preventDefault()},menuScrollOut:function(t,e){mouse&&(/^scroll-(up|down)/.test((e.relatedTarget||"").className)||(t[0]==e.relatedTarget||$.contains(t[0],e.relatedTarget))&&this.getClosestMenu(e.relatedTarget)==t[0]||t.dataSM("scroll-arrows").css("visibility","hidden"))},menuScrollOver:function(t,e){if(mouse&&!/^scroll-(up|down)/.test(e.target.className)&&this.getClosestMenu(e.target)==t[0]){this.menuScrollRefreshData(t);var i=t.dataSM("scroll"),s=$(window).scrollTop()-t.dataSM("parent-a").offset().top-i.itemH;t.dataSM("scroll-arrows").eq(0).css("margin-top",s).end().eq(1).css("margin-top",s+this.getViewportHeight()-i.arrowDownH).end().css("visibility","visible")}},menuScrollRefreshData:function(t){var e=t.dataSM("scroll"),i=$(window).scrollTop()-t.dataSM("parent-a").offset().top-e.itemH;this.cssTransforms3d&&(i=-(parseFloat(t.css("margin-top"))-i)),$.extend(e,{upEnd:i,downEnd:i+this.getViewportHeight()-e.subH})},menuScrollStop:function(t){return this.scrollTimeout?(cancelAnimationFrame(this.scrollTimeout),this.scrollTimeout=0,t.dataSM("scroll").step=1,!0):void 0},menuScrollTouch:function(t,e){if(e=e.originalEvent,isTouchEvent(e)){var i=this.getTouchPoint(e);if(this.getClosestMenu(i.target)==t[0]){var s=t.dataSM("scroll");if(/(start|down)$/i.test(e.type))this.menuScrollStop(t)?(e.preventDefault(),this.$touchScrollingSub=t):this.$touchScrollingSub=null,this.menuScrollRefreshData(t),$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp});else if(/move$/i.test(e.type)){var o=void 0!==s.touchY?s.touchY:s.touchStartY;if(void 0!==o&&o!=i.pageY){this.$touchScrollingSub=t;var a=i.pageY>o;void 0!==s.up&&s.up!=a&&$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp}),$.extend(s,{up:a,touchY:i.pageY}),this.menuScroll(t,!0,Math.abs(i.pageY-o))}e.preventDefault()}else void 0!==s.touchY&&((s.momentum=15*Math.pow(Math.abs(i.pageY-s.touchStartY)/(e.timeStamp-s.touchStartTime),2))&&(this.menuScrollStop(t),this.menuScroll(t),e.preventDefault()),delete s.touchY)}}},menuShow:function(t){if((t.dataSM("beforefirstshowfired")||(t.dataSM("beforefirstshowfired",!0),this.$root.triggerHandler("beforefirstshow.smapi",t[0])!==!1))&&this.$root.triggerHandler("beforeshow.smapi",t[0])!==!1&&(t.dataSM("shown-before",!0),canAnimate&&t.stop(!0,!0),!t.is(":visible"))){var e=t.dataSM("parent-a"),i=this.isCollapsible();if((this.opts.keepHighlighted||i)&&e.addClass("highlighted"),i)t.removeClass("sm-nowrap").css({zIndex:"",width:"auto",minWidth:"",maxWidth:"",top:"",left:"",marginLeft:"",marginTop:""});else{if(t.css("z-index",this.zIndexInc=(this.zIndexInc||this.getStartZIndex())+1),(this.opts.subMenusMinWidth||this.opts.subMenusMaxWidth)&&(t.css({width:"auto",minWidth:"",maxWidth:""}).addClass("sm-nowrap"),this.opts.subMenusMinWidth&&t.css("min-width",this.opts.subMenusMinWidth),this.opts.subMenusMaxWidth)){var s=this.getWidth(t);t.css("max-width",this.opts.subMenusMaxWidth),s>this.getWidth(t)&&t.removeClass("sm-nowrap").css("width",this.opts.subMenusMaxWidth)}this.menuPosition(t)}var o=function(){t.css("overflow","")};i?canAnimate&&this.opts.collapsibleShowFunction?this.opts.collapsibleShowFunction.call(this,t,o):t.show(this.opts.collapsibleShowDuration,o):canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,t,o):t.show(this.opts.showDuration,o),e.attr("aria-expanded","true"),t.attr({"aria-expanded":"true","aria-hidden":"false"}),this.visibleSubMenus.push(t),this.$root.triggerHandler("show.smapi",t[0])}},popupHide:function(t){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},t?1:this.opts.hideTimeout)},popupShow:function(t,e){if(!this.opts.isPopup)return alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.'),void 0;if(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),this.$root.dataSM("shown-before",!0),canAnimate&&this.$root.stop(!0,!0),!this.$root.is(":visible")){this.$root.css({left:t,top:e});var i=this,s=function(){i.$root.css("overflow","")};canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,this.$root,s):this.$root.show(this.opts.showDuration,s),this.visibleSubMenus[0]=this.$root}},refresh:function(){this.destroy(!0),this.init(!0)},rootKeyDown:function(t){if(this.handleEvents())switch(t.keyCode){case 27:var e=this.activatedItems[0];if(e){this.menuHideAll(),e[0].focus();var i=e.dataSM("sub");i&&this.menuHide(i)}break;case 32:var s=$(t.target);if(s.is("a")&&this.handleItemEvents(s)){var i=s.dataSM("sub");i&&!i.is(":visible")&&(this.itemClick({currentTarget:t.target}),t.preventDefault())}}},rootOut:function(t){if(this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),!this.opts.showOnClick||!this.opts.hideOnClick)){var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},this.opts.hideTimeout)}},rootOver:function(t){this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0)},winResize:function(t){if(this.handleEvents()){if(!("onorientationchange"in window)||"orientationchange"==t.type){var e=this.isCollapsible();this.wasCollapsible&&e||(this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0].blur(),this.menuHideAll()),this.wasCollapsible=e}}else if(this.$disableOverlay){var i=this.$root.offset();this.$disableOverlay.css({top:i.top,left:i.left,width:this.$root.outerWidth(),height:this.$root.outerHeight()})}}}}),$.fn.dataSM=function(t,e){return e?this.data(t+"_smartmenus",e):this.data(t+"_smartmenus")},$.fn.removeDataSM=function(t){return this.removeData(t+"_smartmenus")},$.fn.smartmenus=function(options){if("string"==typeof options){var args=arguments,method=options;return Array.prototype.shift.call(args),this.each(function(){var t=$(this).data("smartmenus");t&&t[method]&&t[method].apply(t,args)})}return this.each(function(){var dataOpts=$(this).data("sm-options")||null;if(dataOpts)try{dataOpts=eval("("+dataOpts+")")}catch(e){dataOpts=null,alert('ERROR\n\nSmartMenus jQuery init:\nInvalid "data-sm-options" attribute value syntax.')}new $.SmartMenus(this,$.extend({},$.fn.smartmenus.defaults,options,dataOpts))})},$.fn.smartmenus.defaults={isPopup:!1,mainMenuSubOffsetX:0,mainMenuSubOffsetY:0,subMenusSubOffsetX:0,subMenusSubOffsetY:0,subMenusMinWidth:"10em",subMenusMaxWidth:"20em",subIndicators:!0,subIndicatorsPos:"append",subIndicatorsText:"",scrollStep:30,scrollAccelerate:!0,showTimeout:250,hideTimeout:500,showDuration:0,showFunction:null,hideDuration:0,hideFunction:function(t,e){t.fadeOut(200,e)},collapsibleShowDuration:0,collapsibleShowFunction:function(t,e){t.slideDown(200,e)},collapsibleHideDuration:0,collapsibleHideFunction:function(t,e){t.slideUp(200,e)},showOnClick:!1,hideOnClick:!0,noMouseOver:!1,keepInViewport:!0,keepHighlighted:!0,markCurrentItem:!1,markCurrentTree:!0,rightToLeftSubMenus:!1,bottomToTopSubMenus:!1,collapsibleBehavior:"default"},$}); \ No newline at end of file diff --git a/loader_8h.html b/loader_8h.html new file mode 100644 index 000000000..ee202dea0 --- /dev/null +++ b/loader_8h.html @@ -0,0 +1,127 @@ + + + + + + + +EVMC: include/evmc/loader.h File Reference + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+ +
loader.h File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Typedefs

typedef struct evmc_vm *(* evmc_create_fn) (void)
 The function pointer type for EVMC create functions.
 
+ + + + +

+Enumerations

enum  evmc_loader_error_code {
+  EVMC_LOADER_SUCCESS = 0 +, EVMC_LOADER_CANNOT_OPEN = 1 +, EVMC_LOADER_SYMBOL_NOT_FOUND = 2 +, EVMC_LOADER_INVALID_ARGUMENT = 3 +,
+  EVMC_LOADER_VM_CREATION_FAILURE = 4 +, EVMC_LOADER_ABI_VERSION_MISMATCH = 5 +, EVMC_LOADER_INVALID_OPTION_NAME = 6 +, EVMC_LOADER_INVALID_OPTION_VALUE = 7 +,
+  EVMC_LOADER_UNSPECIFIED_ERROR = -1 +
+ }
 Error codes for the EVMC loader. More...
 
+ + + + + + + + + + + + + +

+Functions

evmc_create_fn evmc_load (const char *filename, enum evmc_loader_error_code *error_code)
 Dynamically loads the EVMC module with a VM implementation.
 
struct evmc_vmevmc_load_and_create (const char *filename, enum evmc_loader_error_code *error_code)
 Dynamically loads the EVMC module and creates the VM instance.
 
struct evmc_vmevmc_load_and_configure (const char *config, enum evmc_loader_error_code *error_code)
 Dynamically loads the EVMC module, then creates and configures the VM instance.
 
const char * evmc_last_error_msg (void)
 Returns the human-readable message describing the most recent error that occurred in EVMC loading since the last call to this function.
 
+

Detailed Description

+

EVMC Loader Library.

+

The EVMC Loader Library supports loading VMs implemented as Dynamically Loaded Libraries (DLLs, shared objects).

+ +

Definition in file loader.h.

+
+
+ + + + diff --git a/loader_8h.js b/loader_8h.js new file mode 100644 index 000000000..2c8aa1d8f --- /dev/null +++ b/loader_8h.js @@ -0,0 +1,19 @@ +var loader_8h = +[ + [ "evmc_create_fn", "group__loader.html#gaa47b31e30330c2614e4d40e14d014822", null ], + [ "evmc_loader_error_code", "group__loader.html#gadf193ed1d2d7e9053e9c592fc201bd7d", [ + [ "EVMC_LOADER_SUCCESS", "group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da0cead101d164fef2ac74efd4d6e1ae6d", null ], + [ "EVMC_LOADER_CANNOT_OPEN", "group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da199bb0c460fa6263b26badcc6f6e65fb", null ], + [ "EVMC_LOADER_SYMBOL_NOT_FOUND", "group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da397b783d11709ec470bf5782c377deb2", null ], + [ "EVMC_LOADER_INVALID_ARGUMENT", "group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da36c6ba4f96cdd1b5407aa0f26a9aa379", null ], + [ "EVMC_LOADER_VM_CREATION_FAILURE", "group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da504de7833560037be4d2c620345767f5", null ], + [ "EVMC_LOADER_ABI_VERSION_MISMATCH", "group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da0d4eb3a48d3f8c500b96f43e1aa7c458", null ], + [ "EVMC_LOADER_INVALID_OPTION_NAME", "group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da53b3d46623f93646389aaf65d977aff2", null ], + [ "EVMC_LOADER_INVALID_OPTION_VALUE", "group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7dad2625a5c71f0c585cf0493c47c805e1b", null ], + [ "EVMC_LOADER_UNSPECIFIED_ERROR", "group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da2cc1b237858f7df09e7e1bf016b44683", null ] + ] ], + [ "evmc_last_error_msg", "group__loader.html#gabc6999f43f5bdc388bf3e1662b1c4e97", null ], + [ "evmc_load", "group__loader.html#gabcf5733eb4dd80c1ce060aec9ed60600", null ], + [ "evmc_load_and_configure", "group__loader.html#ga3e29ca285fe13db086daf0bf98b4a046", null ], + [ "evmc_load_and_create", "group__loader.html#ga53c5982e90b8dcbae860b98cae9951da", null ] +]; \ No newline at end of file diff --git a/loader_8h_source.html b/loader_8h_source.html new file mode 100644 index 000000000..332d5308b --- /dev/null +++ b/loader_8h_source.html @@ -0,0 +1,137 @@ + + + + + + + +EVMC: include/evmc/loader.h Source File + + + + + + + + + + +
+
+ + + + + + +
+
EVMC +
+
+
+ + + + + + +
+
+ +
+
+
+ +
+
+
loader.h
+
+
+Go to the documentation of this file.
1// EVMC: Ethereum Client-VM Connector API.
+
2// Copyright 2018 The EVMC Authors.
+
3// Licensed under the Apache License, Version 2.0.
+
4
+
14#pragma once
+
15
+
16#ifdef __cplusplus
+
17extern "C" {
+
18#endif
+
19
+
21typedef struct evmc_vm* (*evmc_create_fn)(void);
+
22
+ +
28{
+ +
31
+ +
34
+ +
37
+ +
40
+ +
43
+ +
46
+ +
49
+ +
52
+ +
56};
+
57
+
95evmc_create_fn evmc_load(const char* filename, enum evmc_loader_error_code* error_code);
+
96
+
118struct evmc_vm* evmc_load_and_create(const char* filename, enum evmc_loader_error_code* error_code);
+
119
+
154struct evmc_vm* evmc_load_and_configure(const char* config,
+
155 enum evmc_loader_error_code* error_code);
+
156
+
170const char* evmc_last_error_msg(void);
+
171
+
172#ifdef __cplusplus
+
173}
+
174#endif
+
175
+
struct evmc_vm * evmc_load_and_configure(const char *config, enum evmc_loader_error_code *error_code)
Dynamically loads the EVMC module, then creates and configures the VM instance.
+
struct evmc_vm * evmc_load_and_create(const char *filename, enum evmc_loader_error_code *error_code)
Dynamically loads the EVMC module and creates the VM instance.
+
struct evmc_vm *(* evmc_create_fn)(void)
The function pointer type for EVMC create functions.
Definition: loader.h:21
+
const char * evmc_last_error_msg(void)
Returns the human-readable message describing the most recent error that occurred in EVMC loading sin...
+
evmc_create_fn evmc_load(const char *filename, enum evmc_loader_error_code *error_code)
Dynamically loads the EVMC module with a VM implementation.
+
evmc_loader_error_code
Error codes for the EVMC loader.
Definition: loader.h:28
+
@ EVMC_LOADER_SUCCESS
The loader succeeded.
Definition: loader.h:30
+
@ EVMC_LOADER_ABI_VERSION_MISMATCH
The ABI version of the VM instance has mismatched.
Definition: loader.h:45
+
@ EVMC_LOADER_CANNOT_OPEN
The loader cannot open the given file name.
Definition: loader.h:33
+
@ EVMC_LOADER_UNSPECIFIED_ERROR
This error value will be never returned by the EVMC loader, but can be used by users to init evmc_loa...
Definition: loader.h:55
+
@ EVMC_LOADER_INVALID_ARGUMENT
The invalid argument value provided.
Definition: loader.h:39
+
@ EVMC_LOADER_SYMBOL_NOT_FOUND
The VM create function not found.
Definition: loader.h:36
+
@ EVMC_LOADER_VM_CREATION_FAILURE
The creation of a VM instance has failed.
Definition: loader.h:42
+
@ EVMC_LOADER_INVALID_OPTION_NAME
The VM option is invalid.
Definition: loader.h:48
+
@ EVMC_LOADER_INVALID_OPTION_VALUE
The VM option value is invalid.
Definition: loader.h:51
+
The VM instance.
Definition: evmc.h:1140
+
+
+ + + + diff --git a/menu.js b/menu.js new file mode 100644 index 000000000..b0b26936a --- /dev/null +++ b/menu.js @@ -0,0 +1,136 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { + function makeTree(data,relPath) { + var result=''; + if ('children' in data) { + result+='
    '; + for (var i in data.children) { + var url; + var link; + link = data.children[i].url; + if (link.substring(0,1)=='^') { + url = link.substring(1); + } else { + url = relPath+link; + } + result+='
  • '+ + data.children[i].text+''+ + makeTree(data.children[i],relPath)+'
  • '; + } + result+='
'; + } + return result; + } + var searchBoxHtml; + if (searchEnabled) { + if (serverSide) { + searchBoxHtml='
'+ + '
'+ + '
 '+ + ''+ + '
'+ + '
'+ + '
'+ + '
'; + } else { + searchBoxHtml='
'+ + ''+ + ' '+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
'; + } + } + + $('#main-nav').before('
'+ + ''+ + ''+ + '
'); + $('#main-nav').append(makeTree(menudata,relPath)); + $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); + if (searchBoxHtml) { + $('#main-menu').append('
  • '); + } + var $mainMenuState = $('#main-menu-state'); + var prevWidth = 0; + if ($mainMenuState.length) { + function initResizableIfExists() { + if (typeof initResizable==='function') initResizable(); + } + // animate mobile menu + $mainMenuState.change(function(e) { + var $menu = $('#main-menu'); + var options = { duration: 250, step: initResizableIfExists }; + if (this.checked) { + options['complete'] = function() { $menu.css('display', 'block') }; + $menu.hide().slideDown(options); + } else { + options['complete'] = function() { $menu.css('display', 'none') }; + $menu.show().slideUp(options); + } + }); + // set default menu visibility + function resetState() { + var $menu = $('#main-menu'); + var $mainMenuState = $('#main-menu-state'); + var newWidth = $(window).outerWidth(); + if (newWidth!=prevWidth) { + if ($(window).outerWidth()<768) { + $mainMenuState.prop('checked',false); $menu.hide(); + $('#searchBoxPos1').html(searchBoxHtml); + $('#searchBoxPos2').hide(); + } else { + $menu.show(); + $('#searchBoxPos1').empty(); + $('#searchBoxPos2').html(searchBoxHtml); + $('#searchBoxPos2').show(); + } + if (typeof searchBox!=='undefined') { + searchBox.CloseResultsWindow(); + } + prevWidth = newWidth; + } + } + $(window).ready(function() { resetState(); initResizableIfExists(); }); + $(window).resize(resetState); + } + $('#main-menu').smartmenus(); +} +/* @license-end */ diff --git a/menudata.js b/menudata.js new file mode 100644 index 000000000..d20a9d584 --- /dev/null +++ b/menudata.js @@ -0,0 +1,130 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file +*/ +var menudata={children:[ +{text:"Main Page",url:"index.html"}, +{text:"Related Pages",url:"pages.html"}, +{text:"Modules",url:"modules.html"}, +{text:"Namespaces",url:"namespaces.html",children:[ +{text:"Namespace List",url:"namespaces.html"}, +{text:"Namespace Members",url:"namespacemembers.html",children:[ +{text:"All",url:"namespacemembers.html",children:[ +{text:"b",url:"namespacemembers.html#index_b"}, +{text:"f",url:"namespacemembers.html#index_f"}, +{text:"h",url:"namespacemembers.html#index_h"}, +{text:"i",url:"namespacemembers.html#index_i"}, +{text:"l",url:"namespacemembers.html#index_l"}, +{text:"m",url:"namespacemembers.html#index_m"}, +{text:"o",url:"namespacemembers.html#index_o"}, +{text:"s",url:"namespacemembers.html#index_s"}, +{text:"t",url:"namespacemembers.html#index_t"}, +{text:"u",url:"namespacemembers.html#index_u"}, +{text:"v",url:"namespacemembers.html#index_v"}]}, +{text:"Functions",url:"namespacemembers_func.html",children:[ +{text:"f",url:"namespacemembers_func.html#index_f"}, +{text:"h",url:"namespacemembers_func.html#index_h"}, +{text:"i",url:"namespacemembers_func.html#index_i"}, +{text:"l",url:"namespacemembers_func.html#index_l"}, +{text:"o",url:"namespacemembers_func.html#index_o"}, +{text:"s",url:"namespacemembers_func.html#index_s"}, +{text:"t",url:"namespacemembers_func.html#index_t"}, +{text:"v",url:"namespacemembers_func.html#index_v"}]}, +{text:"Variables",url:"namespacemembers_vars.html"}, +{text:"Typedefs",url:"namespacemembers_type.html"}]}]}, +{text:"Classes",url:"annotated.html",children:[ +{text:"Class List",url:"annotated.html"}, +{text:"Class Index",url:"classes.html"}, +{text:"Class Hierarchy",url:"hierarchy.html"}, +{text:"Class Members",url:"functions.html",children:[ +{text:"All",url:"functions.html",children:[ +{text:"a",url:"functions.html#index_a"}, +{text:"b",url:"functions_b.html#index_b"}, +{text:"c",url:"functions_c.html#index_c"}, +{text:"d",url:"functions_d.html#index_d"}, +{text:"e",url:"functions_e.html#index_e"}, +{text:"f",url:"functions_f.html#index_f"}, +{text:"g",url:"functions_g.html#index_g"}, +{text:"h",url:"functions_h.html#index_h"}, +{text:"i",url:"functions_i.html#index_i"}, +{text:"k",url:"functions_k.html#index_k"}, +{text:"l",url:"functions_l.html#index_l"}, +{text:"m",url:"functions_m.html#index_m"}, +{text:"n",url:"functions_n.html#index_n"}, +{text:"o",url:"functions_o.html#index_o"}, +{text:"p",url:"functions_p.html#index_p"}, +{text:"r",url:"functions_r.html#index_r"}, +{text:"s",url:"functions_s.html#index_s"}, +{text:"t",url:"functions_t.html#index_t"}, +{text:"v",url:"functions_v.html#index_v"}, +{text:"~",url:"functions_~.html#index__7E"}]}, +{text:"Functions",url:"functions_func.html",children:[ +{text:"a",url:"functions_func.html#index_a"}, +{text:"b",url:"functions_func.html#index_b"}, +{text:"c",url:"functions_func.html#index_c"}, +{text:"e",url:"functions_func.html#index_e"}, +{text:"f",url:"functions_func.html#index_f"}, +{text:"g",url:"functions_func.html#index_g"}, +{text:"h",url:"functions_func.html#index_h"}, +{text:"i",url:"functions_func.html#index_i"}, +{text:"l",url:"functions_func.html#index_l"}, +{text:"m",url:"functions_func.html#index_m"}, +{text:"n",url:"functions_func.html#index_n"}, +{text:"o",url:"functions_func.html#index_o"}, +{text:"r",url:"functions_func.html#index_r"}, +{text:"s",url:"functions_func.html#index_s"}, +{text:"t",url:"functions_func.html#index_t"}, +{text:"v",url:"functions_func.html#index_v"}, +{text:"~",url:"functions_func.html#index__7E"}]}, +{text:"Variables",url:"functions_vars.html",children:[ +{text:"a",url:"functions_vars.html#index_a"}, +{text:"b",url:"functions_vars.html#index_b"}, +{text:"c",url:"functions_vars.html#index_c"}, +{text:"d",url:"functions_vars.html#index_d"}, +{text:"e",url:"functions_vars.html#index_e"}, +{text:"f",url:"functions_vars.html#index_f"}, +{text:"g",url:"functions_vars.html#index_g"}, +{text:"h",url:"functions_vars.html#index_h"}, +{text:"i",url:"functions_vars.html#index_i"}, +{text:"k",url:"functions_vars.html#index_k"}, +{text:"m",url:"functions_vars.html#index_m"}, +{text:"n",url:"functions_vars.html#index_n"}, +{text:"o",url:"functions_vars.html#index_o"}, +{text:"p",url:"functions_vars.html#index_p"}, +{text:"r",url:"functions_vars.html#index_r"}, +{text:"s",url:"functions_vars.html#index_s"}, +{text:"t",url:"functions_vars.html#index_t"}, +{text:"v",url:"functions_vars.html#index_v"}]}, +{text:"Typedefs",url:"functions_type.html"}]}]}, +{text:"Files",url:"files.html",children:[ +{text:"File List",url:"files.html"}, +{text:"File Members",url:"globals.html",children:[ +{text:"All",url:"globals.html",children:[ +{text:"e",url:"globals.html#index_e"}, +{text:"o",url:"globals.html#index_o"}]}, +{text:"Functions",url:"globals_func.html"}, +{text:"Typedefs",url:"globals_type.html"}, +{text:"Enumerations",url:"globals_enum.html"}, +{text:"Enumerator",url:"globals_eval.html",children:[ +{text:"e",url:"globals_eval.html#index_e"}]}, +{text:"Macros",url:"globals_defs.html"}]}]}]} diff --git a/mocked__host_8hpp_source.html b/mocked__host_8hpp_source.html new file mode 100644 index 000000000..799972a41 --- /dev/null +++ b/mocked__host_8hpp_source.html @@ -0,0 +1,568 @@ + + + + + + + +EVMC: include/evmc/mocked_host.hpp Source File + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    mocked_host.hpp
    +
    +
    +
    1// EVMC: Ethereum Client-VM Connector API.
    +
    2// Copyright 2019 The EVMC Authors.
    +
    3// Licensed under the Apache License, Version 2.0.
    +
    4#pragma once
    +
    5
    +
    6#include <evmc/evmc.hpp>
    +
    7#include <algorithm>
    +
    8#include <cassert>
    +
    9#include <string>
    +
    10#include <unordered_map>
    +
    11#include <vector>
    +
    12
    +
    13namespace evmc
    +
    14{
    + +
    17{
    + +
    20
    + +
    23
    + +
    26
    +
    28 StorageValue() noexcept = default;
    +
    29
    +
    31 StorageValue(const bytes32& _value, // NOLINT(hicpp-explicit-conversions)
    +
    32 evmc_access_status _access_status = EVMC_ACCESS_COLD) noexcept
    +
    33 : current{_value}, original{_value}, access_status{_access_status}
    +
    34 {}
    +
    35
    +
    37 StorageValue(const bytes32& _value,
    +
    38 const bytes32& _original,
    +
    39 evmc_access_status _access_status = EVMC_ACCESS_COLD) noexcept
    +
    40 : current{_value}, original{_original}, access_status{_access_status}
    +
    41 {}
    +
    42};
    +
    43
    + +
    46{
    +
    48 int nonce = 0;
    +
    49
    + +
    52
    + +
    55
    + +
    58
    +
    60 std::unordered_map<bytes32, StorageValue> storage;
    +
    61
    +
    63 std::unordered_map<bytes32, bytes32> transient_storage;
    +
    64
    +
    66 void set_balance(uint64_t x) noexcept
    +
    67 {
    + +
    69 for (std::size_t i = 0; i < sizeof(x); ++i)
    +
    70 balance.bytes[sizeof(balance) - 1 - i] = static_cast<uint8_t>(x >> (8 * i));
    +
    71 }
    +
    72};
    +
    73
    +
    75class MockedHost : public Host
    +
    76{
    +
    77public:
    + +
    80 {
    + +
    83
    + +
    86
    +
    88 std::vector<bytes32> topics;
    +
    89
    +
    91 bool operator==(const log_record& other) const noexcept
    +
    92 {
    +
    93 return creator == other.creator && data == other.data && topics == other.topics;
    +
    94 }
    +
    95 };
    +
    96
    +
    98 std::unordered_map<address, MockedAccount> accounts;
    +
    99
    + +
    102
    + +
    105
    + +
    108
    +
    110 mutable std::vector<int64_t> recorded_blockhashes;
    +
    111
    +
    113 mutable std::vector<address> recorded_account_accesses;
    +
    114
    +
    117 static constexpr auto max_recorded_account_accesses = 200;
    +
    118
    +
    120 std::vector<evmc_message> recorded_calls;
    +
    121
    +
    124 static constexpr auto max_recorded_calls = 100;
    +
    125
    +
    127 std::vector<log_record> recorded_logs;
    +
    128
    +
    131 std::unordered_map<address, std::vector<address>> recorded_selfdestructs;
    +
    132
    +
    133private:
    +
    135 std::vector<bytes> m_recorded_calls_inputs;
    +
    136
    +
    139 void record_account_access(const address& addr) const
    +
    140 {
    +
    141 if (recorded_account_accesses.empty())
    + +
    143
    + +
    145 recorded_account_accesses.emplace_back(addr);
    +
    146 }
    +
    147
    +
    148public:
    +
    150 bool account_exists(const address& addr) const noexcept override
    +
    151 {
    +
    152 record_account_access(addr);
    +
    153 return accounts.count(addr) != 0;
    +
    154 }
    +
    155
    +
    157 bytes32 get_storage(const address& addr, const bytes32& key) const noexcept override
    +
    158 {
    +
    159 record_account_access(addr);
    +
    160
    +
    161 const auto account_iter = accounts.find(addr);
    +
    162 if (account_iter == accounts.end())
    +
    163 return {};
    +
    164
    +
    165 const auto storage_iter = account_iter->second.storage.find(key);
    +
    166 if (storage_iter != account_iter->second.storage.end())
    +
    167 return storage_iter->second.current;
    +
    168 return {};
    +
    169 }
    +
    170
    + +
    173 const bytes32& key,
    +
    174 const bytes32& value) noexcept override
    +
    175 {
    +
    176 record_account_access(addr);
    +
    177
    +
    178 // Get the reference to the storage entry value.
    +
    179 // This will create the account in case it was not present.
    +
    180 // This is convenient for unit testing and standalone EVM execution to preserve the
    +
    181 // storage values after the execution terminates.
    +
    182 auto& s = accounts[addr].storage[key];
    +
    183
    +
    184 // Follow the EIP-2200 specification as closely as possible.
    +
    185 // https://eips.ethereum.org/EIPS/eip-2200
    +
    186 // Warning: this is not the most efficient implementation. The storage status can be
    +
    187 // figured out by combining only 4 checks:
    +
    188 // - original != current (dirty)
    +
    189 // - original == value (restored)
    +
    190 // - current != 0
    +
    191 // - value != 0
    +
    192 const auto status = [&original = s.original, &current = s.current, &value]() {
    +
    193 // Clause 1 is irrelevant:
    +
    194 // 1. "If gasleft is less than or equal to gas stipend,
    +
    195 // fail the current call frame with ‘out of gas’ exception"
    +
    196
    +
    197 // 2. "If current value equals new value (this is a no-op)"
    +
    198 if (current == value)
    +
    199 {
    +
    200 // "SLOAD_GAS is deducted"
    + +
    202 }
    +
    203 // 3. "If current value does not equal new value"
    +
    204 else
    +
    205 {
    +
    206 // 3.1. "If original value equals current value
    +
    207 // (this storage slot has not been changed by the current execution context)"
    +
    208 if (original == current)
    +
    209 {
    +
    210 // 3.1.1 "If original value is 0"
    +
    211 if (is_zero(original))
    +
    212 {
    +
    213 // "SSTORE_SET_GAS is deducted"
    +
    214 return EVMC_STORAGE_ADDED;
    +
    215 }
    +
    216 // 3.1.2 "Otherwise"
    +
    217 else
    +
    218 {
    +
    219 // "SSTORE_RESET_GAS gas is deducted"
    +
    220 auto st = EVMC_STORAGE_MODIFIED;
    +
    221
    +
    222 // "If new value is 0"
    +
    223 if (is_zero(value))
    +
    224 {
    +
    225 // "add SSTORE_CLEARS_SCHEDULE gas to refund counter"
    + +
    227 }
    +
    228
    +
    229 return st;
    +
    230 }
    +
    231 }
    +
    232 // 3.2. "If original value does not equal current value
    +
    233 // (this storage slot is dirty),
    +
    234 // SLOAD_GAS gas is deducted.
    +
    235 // Apply both of the following clauses."
    +
    236 else
    +
    237 {
    +
    238 // Because we need to apply "both following clauses"
    +
    239 // we first collect information which clause is triggered
    +
    240 // then assign status code to combination of these clauses.
    +
    241 enum
    +
    242 {
    +
    243 None = 0,
    +
    244 RemoveClearsSchedule = 1 << 0,
    +
    245 AddClearsSchedule = 1 << 1,
    +
    246 RestoredBySet = 1 << 2,
    +
    247 RestoredByReset = 1 << 3,
    +
    248 };
    +
    249 int triggered_clauses = None;
    +
    250
    +
    251 // 3.2.1. "If original value is not 0"
    +
    252 if (!is_zero(original))
    +
    253 {
    +
    254 // 3.2.1.1. "If current value is 0"
    +
    255 if (is_zero(current))
    +
    256 {
    +
    257 // "(also means that new value is not 0)"
    +
    258 assert(!is_zero(value));
    +
    259 // "remove SSTORE_CLEARS_SCHEDULE gas from refund counter"
    +
    260 triggered_clauses |= RemoveClearsSchedule;
    +
    261 }
    +
    262 // 3.2.1.2. "If new value is 0"
    +
    263 if (is_zero(value))
    +
    264 {
    +
    265 // "(also means that current value is not 0)"
    +
    266 assert(!is_zero(current));
    +
    267 // "add SSTORE_CLEARS_SCHEDULE gas to refund counter"
    +
    268 triggered_clauses |= AddClearsSchedule;
    +
    269 }
    +
    270 }
    +
    271
    +
    272 // 3.2.2. "If original value equals new value (this storage slot is reset)"
    +
    273 // Except: we use term 'storage slot restored'.
    +
    274 if (original == value)
    +
    275 {
    +
    276 // 3.2.2.1. "If original value is 0"
    +
    277 if (is_zero(original))
    +
    278 {
    +
    279 // "add SSTORE_SET_GAS - SLOAD_GAS to refund counter"
    +
    280 triggered_clauses |= RestoredBySet;
    +
    281 }
    +
    282 // 3.2.2.2. "Otherwise"
    +
    283 else
    +
    284 {
    +
    285 // "add SSTORE_RESET_GAS - SLOAD_GAS gas to refund counter"
    +
    286 triggered_clauses |= RestoredByReset;
    +
    287 }
    +
    288 }
    +
    289
    +
    290 switch (triggered_clauses)
    +
    291 {
    +
    292 case RemoveClearsSchedule:
    + +
    294 case AddClearsSchedule:
    + +
    296 case RemoveClearsSchedule | RestoredByReset:
    + +
    298 case RestoredBySet:
    + +
    300 case RestoredByReset:
    + +
    302 case None:
    + +
    304 default:
    +
    305 assert(false); // Other combinations are impossible.
    +
    306 return evmc_storage_status{};
    +
    307 }
    +
    308 }
    +
    309 }
    +
    310 }();
    +
    311
    +
    312 s.current = value; // Finally update the current storage value.
    +
    313 return status;
    +
    314 }
    +
    315
    +
    317 uint256be get_balance(const address& addr) const noexcept override
    +
    318 {
    +
    319 record_account_access(addr);
    +
    320 const auto it = accounts.find(addr);
    +
    321 if (it == accounts.end())
    +
    322 return {};
    +
    323
    +
    324 return it->second.balance;
    +
    325 }
    +
    326
    +
    328 size_t get_code_size(const address& addr) const noexcept override
    +
    329 {
    +
    330 record_account_access(addr);
    +
    331 const auto it = accounts.find(addr);
    +
    332 if (it == accounts.end())
    +
    333 return 0;
    +
    334 return it->second.code.size();
    +
    335 }
    +
    336
    +
    338 bytes32 get_code_hash(const address& addr) const noexcept override
    +
    339 {
    +
    340 record_account_access(addr);
    +
    341 const auto it = accounts.find(addr);
    +
    342 if (it == accounts.end())
    +
    343 return {};
    +
    344 return it->second.codehash;
    +
    345 }
    +
    346
    +
    348 size_t copy_code(const address& addr,
    +
    349 size_t code_offset,
    +
    350 uint8_t* buffer_data,
    +
    351 size_t buffer_size) const noexcept override
    +
    352 {
    +
    353 record_account_access(addr);
    +
    354 const auto it = accounts.find(addr);
    +
    355 if (it == accounts.end())
    +
    356 return 0;
    +
    357
    +
    358 const auto& code = it->second.code;
    +
    359
    +
    360 if (code_offset >= code.size())
    +
    361 return 0;
    +
    362
    +
    363 const auto n = std::min(buffer_size, code.size() - code_offset);
    +
    364
    +
    365 if (n > 0)
    +
    366 std::copy_n(&code[code_offset], n, buffer_data);
    +
    367 return n;
    +
    368 }
    +
    369
    +
    371 bool selfdestruct(const address& addr, const address& beneficiary) noexcept override
    +
    372 {
    +
    373 record_account_access(addr);
    +
    374 auto& beneficiaries = recorded_selfdestructs[addr];
    +
    375 beneficiaries.emplace_back(beneficiary);
    +
    376 return beneficiaries.size() == 1;
    +
    377 }
    +
    378
    +
    380 Result call(const evmc_message& msg) noexcept override
    +
    381 {
    +
    382 record_account_access(msg.recipient);
    +
    383
    +
    384 if (recorded_calls.empty())
    +
    385 {
    + +
    387 m_recorded_calls_inputs.reserve(max_recorded_calls); // Iterators will not invalidate.
    +
    388 }
    +
    389
    + +
    391 {
    +
    392 recorded_calls.emplace_back(msg);
    +
    393 auto& call_msg = recorded_calls.back();
    +
    394 if (call_msg.input_size > 0)
    +
    395 {
    +
    396 m_recorded_calls_inputs.emplace_back(call_msg.input_data, call_msg.input_size);
    +
    397 const auto& input_copy = m_recorded_calls_inputs.back();
    +
    398 call_msg.input_data = input_copy.data();
    +
    399 }
    +
    400 }
    +
    401 return Result{call_result};
    +
    402 }
    +
    403
    +
    405 evmc_tx_context get_tx_context() const noexcept override { return tx_context; }
    +
    406
    +
    408 bytes32 get_block_hash(int64_t block_number) const noexcept override
    +
    409 {
    +
    410 recorded_blockhashes.emplace_back(block_number);
    +
    411 return block_hash;
    +
    412 }
    +
    413
    +
    415 void emit_log(const address& addr,
    +
    416 const uint8_t* data,
    +
    417 size_t data_size,
    +
    418 const bytes32 topics[],
    +
    419 size_t topics_count) noexcept override
    +
    420 {
    +
    421 recorded_logs.push_back({addr, {data, data_size}, {topics, topics + topics_count}});
    +
    422 }
    +
    423
    +
    440 evmc_access_status access_account(const address& addr) noexcept override
    +
    441 {
    +
    442 // Check if the address have been already accessed.
    +
    443 const auto already_accessed =
    +
    444 std::find(recorded_account_accesses.begin(), recorded_account_accesses.end(), addr) !=
    + +
    446
    +
    447 record_account_access(addr);
    +
    448
    +
    449 // Accessing precompiled contracts is always warm.
    +
    450 if (addr >= 0x0000000000000000000000000000000000000001_address &&
    +
    451 addr <= 0x0000000000000000000000000000000000000009_address)
    +
    452 return EVMC_ACCESS_WARM;
    +
    453
    +
    454 return already_accessed ? EVMC_ACCESS_WARM : EVMC_ACCESS_COLD;
    +
    455 }
    +
    456
    +
    471 evmc_access_status access_storage(const address& addr, const bytes32& key) noexcept override
    +
    472 {
    +
    473 auto& value = accounts[addr].storage[key];
    +
    474 const auto access_status = value.access_status;
    +
    475 value.access_status = EVMC_ACCESS_WARM;
    +
    476 return access_status;
    +
    477 }
    +
    478
    +
    484 bytes32 get_transient_storage(const address& addr, const bytes32& key) const noexcept override
    +
    485 {
    +
    486 record_account_access(addr);
    +
    487
    +
    488 const auto account_iter = accounts.find(addr);
    +
    489 if (account_iter == accounts.end())
    +
    490 return {};
    +
    491
    +
    492 const auto storage_iter = account_iter->second.transient_storage.find(key);
    +
    493 if (storage_iter != account_iter->second.transient_storage.end())
    +
    494 return storage_iter->second;
    +
    495 return {};
    +
    496 }
    +
    497
    + +
    504 const bytes32& key,
    +
    505 const bytes32& value) noexcept override
    +
    506 {
    +
    507 record_account_access(addr);
    +
    508 accounts[addr].transient_storage[key] = value;
    +
    509 }
    +
    510};
    +
    511} // namespace evmc
    +
    Abstract class to be used by Host implementations.
    Definition: evmc.hpp:621
    +
    Mocked EVMC Host implementation.
    Definition: mocked_host.hpp:76
    +
    size_t get_code_size(const address &addr) const noexcept override
    Get the account's code size (EVMC host method).
    +
    size_t copy_code(const address &addr, size_t code_offset, uint8_t *buffer_data, size_t buffer_size) const noexcept override
    Copy the account's code to the given buffer (EVMC host method).
    +
    uint256be get_balance(const address &addr) const noexcept override
    Get the account's balance (EVMC Host method).
    +
    void emit_log(const address &addr, const uint8_t *data, size_t data_size, const bytes32 topics[], size_t topics_count) noexcept override
    Emit LOG (EVMC host method).
    +
    evmc_tx_context get_tx_context() const noexcept override
    Get transaction context (EVMC host method).
    +
    evmc_result call_result
    The call result to be returned by the call() method.
    +
    bytes32 block_hash
    The block header hash value to be returned by get_block_hash().
    +
    evmc_access_status access_account(const address &addr) noexcept override
    Record an account access.
    +
    bool account_exists(const address &addr) const noexcept override
    Returns true if an account exists (EVMC Host method).
    +
    static constexpr auto max_recorded_account_accesses
    The maximum number of entries in recorded_account_accesses record.
    +
    std::unordered_map< address, MockedAccount > accounts
    The set of all accounts in the Host, organized by their addresses.
    Definition: mocked_host.hpp:98
    +
    Result call(const evmc_message &msg) noexcept override
    Call/create other contract (EVMC host method).
    +
    bytes32 get_storage(const address &addr, const bytes32 &key) const noexcept override
    Get the account's storage value at the given key (EVMC Host method).
    +
    std::vector< log_record > recorded_logs
    The record of all LOGs passed to the emit_log() method.
    +
    evmc_access_status access_storage(const address &addr, const bytes32 &key) noexcept override
    Access the account's storage value at the given key.
    +
    bytes32 get_code_hash(const address &addr) const noexcept override
    Get the account's code hash (EVMC host method).
    +
    static constexpr auto max_recorded_calls
    The maximum number of entries in recorded_calls record.
    +
    bytes32 get_transient_storage(const address &addr, const bytes32 &key) const noexcept override
    Get account's transient storage.
    +
    evmc_storage_status set_storage(const address &addr, const bytes32 &key, const bytes32 &value) noexcept override
    Set the account's storage value (EVMC Host method).
    +
    bool selfdestruct(const address &addr, const address &beneficiary) noexcept override
    Selfdestruct the account (EVMC host method).
    +
    std::unordered_map< address, std::vector< address > > recorded_selfdestructs
    The record of all SELFDESTRUCTs from the selfdestruct() method as a map selfdestructed_address => [be...
    +
    std::vector< int64_t > recorded_blockhashes
    The record of all block numbers for which get_block_hash() was called.
    +
    bytes32 get_block_hash(int64_t block_number) const noexcept override
    Get the block header hash (EVMC host method).
    +
    evmc_tx_context tx_context
    The EVMC transaction context to be returned by get_tx_context().
    +
    void set_transient_storage(const address &addr, const bytes32 &key, const bytes32 &value) noexcept override
    Set account's transient storage.
    +
    std::vector< address > recorded_account_accesses
    The record of all account accesses.
    +
    std::vector< evmc_message > recorded_calls
    The record of all call messages requested in the call() method.
    +
    The EVM code execution result.
    Definition: evmc.hpp:329
    + +
    evmc_access_status
    Access status per EIP-2929: Gas cost increases for state access opcodes.
    Definition: evmc.h:784
    +
    evmc_storage_status
    The effect of an attempt to modify a contract storage item.
    Definition: evmc.h:569
    +
    @ EVMC_ACCESS_COLD
    The entry hasn't been accessed before – it's the first access.
    Definition: evmc.h:788
    +
    @ EVMC_ACCESS_WARM
    The entry is already in accessed_addresses or accessed_storage_keys.
    Definition: evmc.h:793
    +
    @ EVMC_STORAGE_ADDED_DELETED
    A storage item is deleted by changing the current dirty nonzero to the original zero value.
    Definition: evmc.h:633
    +
    @ EVMC_STORAGE_MODIFIED_RESTORED
    A storage item is modified by changing the current dirty nonzero to the original nonzero value other ...
    Definition: evmc.h:640
    +
    @ EVMC_STORAGE_DELETED_RESTORED
    A storage item is added by changing the current dirty zero to the original value.
    Definition: evmc.h:626
    +
    @ EVMC_STORAGE_ADDED
    A new storage item is added by changing the current clean zero to a nonzero value.
    Definition: evmc.h:591
    +
    @ EVMC_STORAGE_MODIFIED_DELETED
    A storage item is deleted by changing the current dirty nonzero to the zero value and the original va...
    Definition: evmc.h:619
    +
    @ EVMC_STORAGE_ASSIGNED
    The new/same value is assigned to the storage item without affecting the cost structure.
    Definition: evmc.h:584
    +
    @ EVMC_STORAGE_DELETED
    A storage item is deleted by changing the current clean nonzero to the zero value.
    Definition: evmc.h:598
    +
    @ EVMC_STORAGE_DELETED_ADDED
    A storage item is added by changing the current dirty zero to a nonzero value other than the original...
    Definition: evmc.h:612
    +
    @ EVMC_STORAGE_MODIFIED
    A storage item is modified by changing the current clean nonzero to other nonzero value.
    Definition: evmc.h:605
    +
    EVMC C++ API - wrappers and bindings for C++.
    Definition: bytes.hpp:12
    +
    constexpr bool is_zero(const address &a) noexcept
    Checks if the given address is the zero address.
    Definition: evmc.hpp:258
    +
    std::basic_string< unsigned char, byte_traits< unsigned char > > bytes
    String of unsigned chars representing bytes.
    Definition: bytes.hpp:89
    +
    Mocked account.
    Definition: mocked_host.hpp:46
    +
    bytes32 codehash
    The code hash. Can be a value not related to the actual code.
    Definition: mocked_host.hpp:54
    +
    std::unordered_map< bytes32, StorageValue > storage
    The account storage map.
    Definition: mocked_host.hpp:60
    +
    int nonce
    The account nonce.
    Definition: mocked_host.hpp:48
    +
    bytes code
    The account code.
    Definition: mocked_host.hpp:51
    +
    uint256be balance
    The account balance.
    Definition: mocked_host.hpp:57
    +
    std::unordered_map< bytes32, bytes32 > transient_storage
    The account transient storage.
    Definition: mocked_host.hpp:63
    +
    void set_balance(uint64_t x) noexcept
    Helper method for setting balance by numeric type.
    Definition: mocked_host.hpp:66
    + +
    address creator
    The address of the account which created the log.
    Definition: mocked_host.hpp:82
    +
    bool operator==(const log_record &other) const noexcept
    Equal operator.
    Definition: mocked_host.hpp:91
    +
    std::vector< bytes32 > topics
    The log topics.
    Definition: mocked_host.hpp:88
    +
    bytes data
    The data attached to the log.
    Definition: mocked_host.hpp:85
    +
    Extended value (with original value and access flag) for account storage.
    Definition: mocked_host.hpp:17
    +
    bytes32 original
    The original storage value.
    Definition: mocked_host.hpp:22
    +
    evmc_access_status access_status
    Is the storage key cold or warm.
    Definition: mocked_host.hpp:25
    +
    StorageValue() noexcept=default
    Default constructor.
    +
    StorageValue(const bytes32 &_value, const bytes32 &_original, evmc_access_status _access_status=EVMC_ACCESS_COLD) noexcept
    Constructor with original value and optional access status.
    Definition: mocked_host.hpp:37
    +
    bytes32 current
    The current storage value.
    Definition: mocked_host.hpp:19
    +
    The big-endian 160-bit hash suitable for keeping an Ethereum address.
    Definition: evmc.hpp:27
    +
    The fixed size array of 32 bytes for storing 256-bit EVM values.
    Definition: evmc.hpp:71
    +
    uint8_t bytes[32]
    The 32 bytes.
    Definition: evmc.h:59
    +
    The message describing an EVM call, including a zero-depth calls from a transaction origin.
    Definition: evmc.h:98
    +
    The EVM code execution result.
    Definition: evmc.h:416
    +
    The transaction and block data for execution.
    Definition: evmc.h:214
    +
    +
    + + + + diff --git a/modules.html b/modules.html new file mode 100644 index 000000000..aad43ea95 --- /dev/null +++ b/modules.html @@ -0,0 +1,84 @@ + + + + + + + +EVMC: Modules + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    Modules
    +
    +
    +
    Here is a list of all modules:
    +
    [detail level 12]
    + + + + + + +
     EVMCEVMC: Ethereum Client-VM Connector API
     EVMC HelpersEVMC Helpers
     Result Optional StorageHelpers for optional storage of evmc_result
     EVM InstructionsEVM Instruction Tables
     EVMC LoaderEVMC Loader Library
     EVMC C++
    +
    +
    +
    + + + + diff --git a/modules.js b/modules.js new file mode 100644 index 000000000..c2e484820 --- /dev/null +++ b/modules.js @@ -0,0 +1,8 @@ +var modules = +[ + [ "EVMC", "group__EVMC.html", "group__EVMC" ], + [ "EVMC Helpers", "group__helpers.html", "group__helpers" ], + [ "EVM Instructions", "group__instructions.html", "group__instructions" ], + [ "EVMC Loader", "group__loader.html", "group__loader" ], + [ "EVMC C++", "group__cpp.html", "group__cpp" ] +]; \ No newline at end of file diff --git a/namespaceevmc.html b/namespaceevmc.html new file mode 100644 index 000000000..d3fa760cb --- /dev/null +++ b/namespaceevmc.html @@ -0,0 +1,1577 @@ + + + + + + + +EVMC: evmc Namespace Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    evmc Namespace Reference
    +
    +
    + +

    EVMC C++ API - wrappers and bindings for C++. +More...

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Classes

    struct  address
     The big-endian 160-bit hash suitable for keeping an Ethereum address. More...
     
    struct  byte_traits
     The char traits for byte-like types. More...
     
    struct  bytes32
     The fixed size array of 32 bytes for storing 256-bit EVM values. More...
     
    struct  filter_iterator
     The filter iterator adaptor creates a view of an iterator range in which some elements of the range are skipped. More...
     
    class  Host
     Abstract class to be used by Host implementations. More...
     
    class  HostContext
     Wrapper around EVMC host context / host interface. More...
     
    class  HostInterface
     The EVMC Host interface. More...
     
    struct  MockedAccount
     Mocked account. More...
     
    class  MockedHost
     Mocked EVMC Host implementation. More...
     
    class  Result
     The EVM code execution result. More...
     
    struct  skip_space_iterator
     The input filter iterator which skips whitespace characters from the base input iterator. More...
     
    struct  StorageValue
     Extended value (with original value and access flag) for account storage. More...
     
    class  VM
     The VM instance. More...
     
    + + + + + + + + + + +

    +Typedefs

    using bytes = std::basic_string< unsigned char, byte_traits< unsigned char > >
     String of unsigned chars representing bytes.
     
    using bytes_view = std::basic_string_view< unsigned char, byte_traits< unsigned char > >
     String view of unsigned chars representing bytes.
     
    using uint256be = bytes32
     The alias for evmc::bytes32 to represent a big-endian 256-bit integer.
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    constexpr uint64_t load64be (const uint8_t *data) noexcept
     Loads 64 bits / 8 bytes of data from the given data array in big-endian order.
     
    constexpr uint64_t load64le (const uint8_t *data) noexcept
     Loads 64 bits / 8 bytes of data from the given data array in little-endian order.
     
    constexpr uint32_t load32be (const uint8_t *data) noexcept
     Loads 32 bits / 4 bytes of data from the given data array in big-endian order.
     
    constexpr uint32_t load32le (const uint8_t *data) noexcept
     Loads 32 bits / 4 bytes of data from the given data array in little-endian order.
     
    constexpr bool operator== (const address &a, const address &b) noexcept
     The "equal to" comparison operator for the evmc::address type.
     
    constexpr bool operator!= (const address &a, const address &b) noexcept
     The "not equal to" comparison operator for the evmc::address type.
     
    constexpr bool operator< (const address &a, const address &b) noexcept
     The "less than" comparison operator for the evmc::address type.
     
    constexpr bool operator> (const address &a, const address &b) noexcept
     The "greater than" comparison operator for the evmc::address type.
     
    constexpr bool operator<= (const address &a, const address &b) noexcept
     The "less than or equal to" comparison operator for the evmc::address type.
     
    constexpr bool operator>= (const address &a, const address &b) noexcept
     The "greater than or equal to" comparison operator for the evmc::address type.
     
    constexpr bool operator== (const bytes32 &a, const bytes32 &b) noexcept
     The "equal to" comparison operator for the evmc::bytes32 type.
     
    constexpr bool operator!= (const bytes32 &a, const bytes32 &b) noexcept
     The "not equal to" comparison operator for the evmc::bytes32 type.
     
    constexpr bool operator< (const bytes32 &a, const bytes32 &b) noexcept
     The "less than" comparison operator for the evmc::bytes32 type.
     
    constexpr bool operator> (const bytes32 &a, const bytes32 &b) noexcept
     The "greater than" comparison operator for the evmc::bytes32 type.
     
    constexpr bool operator<= (const bytes32 &a, const bytes32 &b) noexcept
     The "less than or equal to" comparison operator for the evmc::bytes32 type.
     
    constexpr bool operator>= (const bytes32 &a, const bytes32 &b) noexcept
     The "greater than or equal to" comparison operator for the evmc::bytes32 type.
     
    constexpr bool is_zero (const address &a) noexcept
     Checks if the given address is the zero address.
     
    constexpr bool is_zero (const bytes32 &a) noexcept
     Checks if the given bytes32 object has all zero bytes.
     
    const char * to_string (evmc_status_code status_code) noexcept
     Returns text representation of the evmc_status_code.
     
    const char * to_string (evmc_revision rev) noexcept
     Returns the name of the evmc_revision.
     
    constexpr bool isspace (char ch) noexcept
     The constexpr variant of std::isspace().
     
    constexpr bool is_not_space (char ch) noexcept
     Checks if a character is not a white space.
     
    +template<typename BaseIterator >
     skip_space_iterator (BaseIterator, BaseIterator) -> skip_space_iterator< BaseIterator >
     Class template argument deduction guide.
     
    std::string hex (uint8_t b) noexcept
     Encode a byte to a hex string.
     
    std::string hex (bytes_view bs)
     Encodes bytes as hex string.
     
    template<typename InputIt , typename OutputIt >
    constexpr bool from_hex (InputIt begin, InputIt end, OutputIt out) noexcept
     Decodes hex-encoded sequence of characters.
     
    bool validate_hex (std::string_view hex) noexcept
     Validates hex encoded string.
     
    std::optional< bytesfrom_hex (std::string_view hex)
     Decodes hex encoded string to bytes.
     
    template<typename T >
    constexpr std::optional< T > from_hex (std::string_view s) noexcept
     Decodes hex-encoded string into custom type T with .bytes array of uint8_t.
     
    template<typename InputIterator >
    std::optional< bytesfrom_spaced_hex (InputIterator begin, InputIterator end) noexcept
     Decodes hex encoded string to bytes.
     
    std::optional< bytesfrom_spaced_hex (std::string_view hex) noexcept
     Decodes hex encoded string to bytes.
     
    + + + + +

    +Variables

    constexpr auto make_result = evmc_make_result
     Alias for evmc_make_result().
     
    +

    Detailed Description

    +

    EVMC C++ API - wrappers and bindings for C++.

    +

    Typedef Documentation

    + +

    ◆ bytes

    + +
    +
    + + + + +
    using evmc::bytes = typedef std::basic_string<unsigned char, byte_traits<unsigned char> >
    +
    + +

    String of unsigned chars representing bytes.

    + +

    Definition at line 89 of file bytes.hpp.

    + +
    +
    + +

    ◆ bytes_view

    + +
    +
    + + + + +
    using evmc::bytes_view = typedef std::basic_string_view<unsigned char, byte_traits<unsigned char> >
    +
    + +

    String view of unsigned chars representing bytes.

    + +

    Definition at line 92 of file bytes.hpp.

    + +
    +
    + +

    ◆ uint256be

    + +
    +
    + + + + +
    using evmc::uint256be = typedef bytes32
    +
    + +

    The alias for evmc::bytes32 to represent a big-endian 256-bit integer.

    + +

    Definition at line 124 of file evmc.hpp.

    + +
    +
    +

    Function Documentation

    + +

    ◆ from_hex() [1/3]

    + +
    +
    +
    +template<typename InputIt , typename OutputIt >
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    constexpr bool evmc::from_hex (InputIt begin,
    InputIt end,
    OutputIt out 
    )
    +
    +inlineconstexprnoexcept
    +
    + +

    Decodes hex-encoded sequence of characters.

    +

    It is guaranteed that the output will not be longer than half of the input length.

    +
    Parameters
    + + + + +
    beginThe input begin iterator. It only must satisfy input iterator concept.
    endThe input end iterator. It only must satisfy input iterator concept.
    outThe output iterator. It must satisfy output iterator concept.
    +
    +
    +
    Returns
    True if successful, false if input is invalid hex.
    + +

    Definition at line 58 of file hex.hpp.

    +
    59{
    +
    60 int hi_nibble = -1; // Init with invalid value, should never be used.
    +
    61 size_t i = 0;
    +
    62 for (auto it = begin; it != end; ++it, ++i)
    +
    63 {
    +
    64 const auto h = *it;
    +
    65 const int v = evmc::internal::from_hex_digit(h);
    +
    66 if (v < 0)
    +
    67 {
    +
    68 if (i == 1 && hi_nibble == 0 && h == 'x') // 0x prefix
    +
    69 continue;
    +
    70 return false;
    +
    71 }
    +
    72
    +
    73 if (i % 2 == 0)
    +
    74 hi_nibble = v << 4;
    +
    75 else
    +
    76 *out++ = static_cast<uint8_t>(hi_nibble | v);
    +
    77 }
    +
    78
    +
    79 return i % 2 == 0;
    +
    80}
    +
    +
    +
    + +

    ◆ from_hex() [2/3]

    + +
    +
    + + + + + +
    + + + + + + + + +
    std::optional< bytes > evmc::from_hex (std::string_view hex)
    +
    +inline
    +
    + +

    Decodes hex encoded string to bytes.

    +

    In case the input is invalid the returned value is std::nullopt. This can happen if a non-hex digit or odd number of digits is encountered.

    + +

    Definition at line 101 of file hex.hpp.

    +
    102{
    +
    103 bytes bs;
    +
    104 bs.reserve(hex.size() / 2);
    +
    105 if (!from_hex(hex.begin(), hex.end(), std::back_inserter(bs)))
    +
    106 return {};
    +
    107 return bs;
    +
    108}
    +
    std::string hex(uint8_t b) noexcept
    Encode a byte to a hex string.
    Definition: hex.hpp:16
    +
    constexpr bool from_hex(InputIt begin, InputIt end, OutputIt out) noexcept
    Decodes hex-encoded sequence of characters.
    Definition: hex.hpp:58
    +
    std::basic_string< unsigned char, byte_traits< unsigned char > > bytes
    String of unsigned chars representing bytes.
    Definition: bytes.hpp:89
    +
    +
    +
    + +

    ◆ from_hex() [3/3]

    + +
    +
    +
    +template<typename T >
    + + + + + +
    + + + + + + + + +
    constexpr std::optional< T > evmc::from_hex (std::string_view s)
    +
    +constexprnoexcept
    +
    + +

    Decodes hex-encoded string into custom type T with .bytes array of uint8_t.

    +

    When the input is smaller than the result type, the result is padded with zeros on the left (the result bytes of lowest indices are filled with zeros). TODO: Support optional left alignment.

    + +

    Definition at line 116 of file hex.hpp.

    +
    117{
    +
    118 // Omit the optional 0x prefix.
    +
    119 if (s.size() >= 2 && s[0] == '0' && s[1] == 'x')
    +
    120 s.remove_prefix(2);
    +
    121
    +
    122 T r{}; // The T must have .bytes array. This may be lifted if std::bit_cast is available.
    +
    123 constexpr auto num_out_bytes = std::size(r.bytes);
    +
    124 const auto num_in_bytes = s.length() / 2;
    +
    125 if (num_in_bytes > num_out_bytes)
    +
    126 return {};
    +
    127 if (!from_hex(s.begin(), s.end(), &r.bytes[num_out_bytes - num_in_bytes]))
    +
    128 return {};
    +
    129 return r;
    +
    130}
    +
    +
    +
    + +

    ◆ from_spaced_hex() [1/2]

    + +
    +
    +
    +template<typename InputIterator >
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    std::optional< bytes > evmc::from_spaced_hex (InputIterator begin,
    InputIterator end 
    )
    +
    +noexcept
    +
    + +

    Decodes hex encoded string to bytes.

    +

    The whitespace in the input is ignored.

    +

    In case the input is invalid the returned value is std::nullopt. This can happen if a non-hex digit or odd number of digits is encountered. The whitespace (as defined by std::isspace) in the input is ignored.

    + +

    Definition at line 138 of file hex.hpp.

    +
    139{
    +
    140 bytes bs;
    +
    141 if (!from_hex(skip_space_iterator{begin, end}, skip_space_iterator{end, end},
    +
    142 std::back_inserter(bs)))
    +
    143 return {};
    +
    144 return bs;
    +
    145}
    +
    The input filter iterator which skips whitespace characters from the base input iterator.
    +
    +
    +
    + +

    ◆ from_spaced_hex() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    std::optional< bytes > evmc::from_spaced_hex (std::string_view hex)
    +
    +inlinenoexcept
    +
    + +

    Decodes hex encoded string to bytes.

    +

    The whitespace in the input is ignored.

    +

    In case the input is invalid the returned value is std::nullopt. This can happen if a non-hex digit or odd number of digits is encountered. The whitespace (as defined by std::isspace) in the input is ignored.

    + +

    Definition at line 148 of file hex.hpp.

    +
    149{
    +
    150 return from_spaced_hex(hex.begin(), hex.end());
    +
    151}
    +
    std::optional< bytes > from_spaced_hex(InputIterator begin, InputIterator end) noexcept
    Decodes hex encoded string to bytes.
    Definition: hex.hpp:138
    +
    +
    +
    + +

    ◆ hex() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    std::string evmc::hex (bytes_view bs)
    +
    +inline
    +
    + +

    Encodes bytes as hex string.

    + +

    Definition at line 23 of file hex.hpp.

    +
    24{
    +
    25 std::string str;
    +
    26 str.reserve(bs.size() * 2);
    +
    27 for (const auto b : bs)
    +
    28 str += hex(b);
    +
    29 return str;
    +
    30}
    +
    +
    +
    + +

    ◆ hex() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    std::string evmc::hex (uint8_t b)
    +
    +inlinenoexcept
    +
    + +

    Encode a byte to a hex string.

    + +

    Definition at line 16 of file hex.hpp.

    +
    17{
    +
    18 static constexpr auto hex_digits = "0123456789abcdef";
    +
    19 return {hex_digits[b >> 4], hex_digits[b & 0xf]};
    +
    20}
    +
    +
    +
    + +

    ◆ is_not_space()

    + +
    +
    + + + + + +
    + + + + + + + + +
    constexpr bool evmc::is_not_space (char ch)
    +
    +inlineconstexprnoexcept
    +
    + +

    Checks if a character is not a white space.

    + +

    Definition at line 18 of file filter_iterator.hpp.

    +
    19{
    +
    20 return !isspace(ch);
    +
    21}
    +
    constexpr bool isspace(char ch) noexcept
    The constexpr variant of std::isspace().
    +
    +
    +
    + +

    ◆ is_zero() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    constexpr bool evmc::is_zero (const addressa)
    +
    +inlineconstexprnoexcept
    +
    + +

    Checks if the given address is the zero address.

    + +

    Definition at line 258 of file evmc.hpp.

    +
    259{
    +
    260 return a == address{};
    +
    261}
    +
    The big-endian 160-bit hash suitable for keeping an Ethereum address.
    Definition: evmc.hpp:27
    +
    +
    +
    + +

    ◆ is_zero() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    constexpr bool evmc::is_zero (const bytes32a)
    +
    +inlineconstexprnoexcept
    +
    + +

    Checks if the given bytes32 object has all zero bytes.

    + +

    Definition at line 269 of file evmc.hpp.

    +
    270{
    +
    271 return a == bytes32{};
    +
    272}
    +
    The fixed size array of 32 bytes for storing 256-bit EVM values.
    Definition: evmc.hpp:71
    +
    +
    +
    + +

    ◆ isspace()

    + +
    +
    + + + + + +
    + + + + + + + + +
    constexpr bool evmc::isspace (char ch)
    +
    +inlineconstexprnoexcept
    +
    + +

    The constexpr variant of std::isspace().

    + +

    Definition at line 11 of file filter_iterator.hpp.

    +
    12{
    +
    13 // Implementation taken from LLVM's libc.
    +
    14 return ch == ' ' || (static_cast<unsigned>(ch) - '\t') < 5;
    +
    15}
    +
    +
    +
    + +

    ◆ load32be()

    + +
    +
    + + + + + +
    + + + + + + + + +
    constexpr uint32_t evmc::load32be (const uint8_t * data)
    +
    +inlineconstexprnoexcept
    +
    + +

    Loads 32 bits / 4 bytes of data from the given data array in big-endian order.

    + +

    Definition at line 144 of file evmc.hpp.

    +
    145{
    +
    146 return (uint32_t{data[0]} << 24) | (uint32_t{data[1]} << 16) | (uint32_t{data[2]} << 8) |
    +
    147 uint32_t{data[3]};
    +
    148}
    +
    +
    +
    + +

    ◆ load32le()

    + +
    +
    + + + + + +
    + + + + + + + + +
    constexpr uint32_t evmc::load32le (const uint8_t * data)
    +
    +inlineconstexprnoexcept
    +
    + +

    Loads 32 bits / 4 bytes of data from the given data array in little-endian order.

    + +

    Definition at line 151 of file evmc.hpp.

    +
    152{
    +
    153 return uint32_t{data[0]} | (uint32_t{data[1]} << 8) | (uint32_t{data[2]} << 16) |
    +
    154 (uint32_t{data[3]} << 24);
    +
    155}
    +
    +
    +
    + +

    ◆ load64be()

    + +
    +
    + + + + + +
    + + + + + + + + +
    constexpr uint64_t evmc::load64be (const uint8_t * data)
    +
    +inlineconstexprnoexcept
    +
    + +

    Loads 64 bits / 8 bytes of data from the given data array in big-endian order.

    + +

    Definition at line 128 of file evmc.hpp.

    +
    129{
    +
    130 return (uint64_t{data[0]} << 56) | (uint64_t{data[1]} << 48) | (uint64_t{data[2]} << 40) |
    +
    131 (uint64_t{data[3]} << 32) | (uint64_t{data[4]} << 24) | (uint64_t{data[5]} << 16) |
    +
    132 (uint64_t{data[6]} << 8) | uint64_t{data[7]};
    +
    133}
    +
    +
    +
    + +

    ◆ load64le()

    + +
    +
    + + + + + +
    + + + + + + + + +
    constexpr uint64_t evmc::load64le (const uint8_t * data)
    +
    +inlineconstexprnoexcept
    +
    + +

    Loads 64 bits / 8 bytes of data from the given data array in little-endian order.

    + +

    Definition at line 136 of file evmc.hpp.

    +
    137{
    +
    138 return uint64_t{data[0]} | (uint64_t{data[1]} << 8) | (uint64_t{data[2]} << 16) |
    +
    139 (uint64_t{data[3]} << 24) | (uint64_t{data[4]} << 32) | (uint64_t{data[5]} << 40) |
    +
    140 (uint64_t{data[6]} << 48) | (uint64_t{data[7]} << 56);
    +
    141}
    +
    +
    +
    + +

    ◆ operator!=() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    constexpr bool evmc::operator!= (const addressa,
    const addressb 
    )
    +
    +inlineconstexprnoexcept
    +
    + +

    The "not equal to" comparison operator for the evmc::address type.

    + +

    Definition at line 179 of file evmc.hpp.

    +
    180{
    +
    181 return !(a == b);
    +
    182}
    +
    +
    +
    + +

    ◆ operator!=() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    constexpr bool evmc::operator!= (const bytes32a,
    const bytes32b 
    )
    +
    +inlineconstexprnoexcept
    +
    + +

    The "not equal to" comparison operator for the evmc::bytes32 type.

    + +

    Definition at line 222 of file evmc.hpp.

    +
    223{
    +
    224 return !(a == b);
    +
    225}
    +
    +
    +
    + +

    ◆ operator<() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    constexpr bool evmc::operator< (const addressa,
    const addressb 
    )
    +
    +inlineconstexprnoexcept
    +
    + +

    The "less than" comparison operator for the evmc::address type.

    + +

    Definition at line 185 of file evmc.hpp.

    +
    186{
    +
    187 return load64be(&a.bytes[0]) < load64be(&b.bytes[0]) ||
    +
    188 (load64be(&a.bytes[0]) == load64be(&b.bytes[0]) &&
    +
    189 (load64be(&a.bytes[8]) < load64be(&b.bytes[8]) ||
    +
    190 (load64be(&a.bytes[8]) == load64be(&b.bytes[8]) &&
    +
    191 load32be(&a.bytes[16]) < load32be(&b.bytes[16]))));
    +
    192}
    +
    constexpr uint64_t load64be(const uint8_t *data) noexcept
    Loads 64 bits / 8 bytes of data from the given data array in big-endian order.
    Definition: evmc.hpp:128
    +
    constexpr uint32_t load32be(const uint8_t *data) noexcept
    Loads 32 bits / 4 bytes of data from the given data array in big-endian order.
    Definition: evmc.hpp:144
    +
    uint8_t bytes[20]
    The 20 bytes of the hash.
    Definition: evmc.h:71
    +
    +
    +
    + +

    ◆ operator<() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    constexpr bool evmc::operator< (const bytes32a,
    const bytes32b 
    )
    +
    +inlineconstexprnoexcept
    +
    + +

    The "less than" comparison operator for the evmc::bytes32 type.

    + +

    Definition at line 228 of file evmc.hpp.

    +
    229{
    +
    230 return load64be(&a.bytes[0]) < load64be(&b.bytes[0]) ||
    +
    231 (load64be(&a.bytes[0]) == load64be(&b.bytes[0]) &&
    +
    232 (load64be(&a.bytes[8]) < load64be(&b.bytes[8]) ||
    +
    233 (load64be(&a.bytes[8]) == load64be(&b.bytes[8]) &&
    +
    234 (load64be(&a.bytes[16]) < load64be(&b.bytes[16]) ||
    +
    235 (load64be(&a.bytes[16]) == load64be(&b.bytes[16]) &&
    +
    236 load64be(&a.bytes[24]) < load64be(&b.bytes[24]))))));
    +
    237}
    +
    uint8_t bytes[32]
    The 32 bytes.
    Definition: evmc.h:59
    +
    +
    +
    + +

    ◆ operator<=() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    constexpr bool evmc::operator<= (const addressa,
    const addressb 
    )
    +
    +inlineconstexprnoexcept
    +
    + +

    The "less than or equal to" comparison operator for the evmc::address type.

    + +

    Definition at line 201 of file evmc.hpp.

    +
    202{
    +
    203 return !(b < a);
    +
    204}
    +
    +
    +
    + +

    ◆ operator<=() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    constexpr bool evmc::operator<= (const bytes32a,
    const bytes32b 
    )
    +
    +inlineconstexprnoexcept
    +
    + +

    The "less than or equal to" comparison operator for the evmc::bytes32 type.

    + +

    Definition at line 246 of file evmc.hpp.

    +
    247{
    +
    248 return !(b < a);
    +
    249}
    +
    +
    +
    + +

    ◆ operator==() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    constexpr bool evmc::operator== (const addressa,
    const addressb 
    )
    +
    +inlineconstexprnoexcept
    +
    + +

    The "equal to" comparison operator for the evmc::address type.

    + +

    Definition at line 171 of file evmc.hpp.

    +
    172{
    +
    173 return load64le(&a.bytes[0]) == load64le(&b.bytes[0]) &&
    +
    174 load64le(&a.bytes[8]) == load64le(&b.bytes[8]) &&
    +
    175 load32le(&a.bytes[16]) == load32le(&b.bytes[16]);
    +
    176}
    +
    constexpr uint64_t load64le(const uint8_t *data) noexcept
    Loads 64 bits / 8 bytes of data from the given data array in little-endian order.
    Definition: evmc.hpp:136
    +
    constexpr uint32_t load32le(const uint8_t *data) noexcept
    Loads 32 bits / 4 bytes of data from the given data array in little-endian order.
    Definition: evmc.hpp:151
    +
    +
    +
    + +

    ◆ operator==() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    constexpr bool evmc::operator== (const bytes32a,
    const bytes32b 
    )
    +
    +inlineconstexprnoexcept
    +
    + +

    The "equal to" comparison operator for the evmc::bytes32 type.

    + +

    Definition at line 213 of file evmc.hpp.

    +
    214{
    +
    215 return load64le(&a.bytes[0]) == load64le(&b.bytes[0]) &&
    +
    216 load64le(&a.bytes[8]) == load64le(&b.bytes[8]) &&
    +
    217 load64le(&a.bytes[16]) == load64le(&b.bytes[16]) &&
    +
    218 load64le(&a.bytes[24]) == load64le(&b.bytes[24]);
    +
    219}
    +
    +
    +
    + +

    ◆ operator>() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    constexpr bool evmc::operator> (const addressa,
    const addressb 
    )
    +
    +inlineconstexprnoexcept
    +
    + +

    The "greater than" comparison operator for the evmc::address type.

    + +

    Definition at line 195 of file evmc.hpp.

    +
    196{
    +
    197 return b < a;
    +
    198}
    +
    +
    +
    + +

    ◆ operator>() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    constexpr bool evmc::operator> (const bytes32a,
    const bytes32b 
    )
    +
    +inlineconstexprnoexcept
    +
    + +

    The "greater than" comparison operator for the evmc::bytes32 type.

    + +

    Definition at line 240 of file evmc.hpp.

    +
    241{
    +
    242 return b < a;
    +
    243}
    +
    +
    +
    + +

    ◆ operator>=() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    constexpr bool evmc::operator>= (const addressa,
    const addressb 
    )
    +
    +inlineconstexprnoexcept
    +
    + +

    The "greater than or equal to" comparison operator for the evmc::address type.

    + +

    Definition at line 207 of file evmc.hpp.

    +
    208{
    +
    209 return !(a < b);
    +
    210}
    +
    +
    +
    + +

    ◆ operator>=() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    constexpr bool evmc::operator>= (const bytes32a,
    const bytes32b 
    )
    +
    +inlineconstexprnoexcept
    +
    + +

    The "greater than or equal to" comparison operator for the evmc::bytes32 type.

    + +

    Definition at line 252 of file evmc.hpp.

    +
    253{
    +
    254 return !(a < b);
    +
    255}
    +
    +
    +
    + +

    ◆ to_string() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    const char * evmc::to_string (evmc_revision rev)
    +
    +inlinenoexcept
    +
    + +

    Returns the name of the evmc_revision.

    + +

    Definition at line 315 of file evmc.hpp.

    +
    316{
    +
    317 return evmc_revision_to_string(rev);
    +
    318}
    +
    static const char * evmc_revision_to_string(enum evmc_revision rev)
    Returns the name of the evmc_revision.
    Definition: helpers.h:272
    +
    +
    +
    + +

    ◆ to_string() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    const char * evmc::to_string (evmc_status_code status_code)
    +
    +inlinenoexcept
    +
    + +

    Returns text representation of the evmc_status_code.

    + +

    Definition at line 309 of file evmc.hpp.

    +
    310{
    +
    311 return evmc_status_code_to_string(status_code);
    +
    312}
    +
    static const char * evmc_status_code_to_string(enum evmc_status_code status_code)
    Returns text representation of the evmc_status_code.
    Definition: helpers.h:221
    +
    +
    +
    + +

    ◆ validate_hex()

    + +
    +
    + + + + + +
    + + + + + + + + +
    bool evmc::validate_hex (std::string_view hex)
    +
    +inlinenoexcept
    +
    + +

    Validates hex encoded string.

    +
    Returns
    True if the input is valid hex.
    + +

    Definition at line 85 of file hex.hpp.

    +
    86{
    +
    87 struct noop_output_iterator
    +
    88 {
    +
    89 uint8_t sink = {};
    +
    90 uint8_t& operator*() noexcept { return sink; }
    +
    91 noop_output_iterator operator++(int) noexcept { return *this; } // NOLINT(cert-dcl21-cpp)
    +
    92 };
    +
    93
    +
    94 return from_hex(hex.begin(), hex.end(), noop_output_iterator{});
    +
    95}
    +
    +
    +
    +

    Variable Documentation

    + +

    ◆ make_result

    + +
    +
    + + + + + +
    + + + + +
    constexpr auto evmc::make_result = evmc_make_result
    +
    +constexpr
    +
    + +

    Alias for evmc_make_result().

    + +

    Definition at line 322 of file evmc.hpp.

    + +
    +
    +
    +
    + + + + diff --git a/namespaceevmc.js b/namespaceevmc.js new file mode 100644 index 000000000..940f575f4 --- /dev/null +++ b/namespaceevmc.js @@ -0,0 +1,51 @@ +var namespaceevmc = +[ + [ "address", "structevmc_1_1address.html", "structevmc_1_1address" ], + [ "byte_traits", "structevmc_1_1byte__traits.html", "structevmc_1_1byte__traits" ], + [ "bytes32", "structevmc_1_1bytes32.html", "structevmc_1_1bytes32" ], + [ "filter_iterator", "structevmc_1_1filter__iterator.html", "structevmc_1_1filter__iterator" ], + [ "Host", "classevmc_1_1Host.html", "classevmc_1_1Host" ], + [ "HostContext", "classevmc_1_1HostContext.html", "classevmc_1_1HostContext" ], + [ "HostInterface", "classevmc_1_1HostInterface.html", "classevmc_1_1HostInterface" ], + [ "MockedAccount", "structevmc_1_1MockedAccount.html", "structevmc_1_1MockedAccount" ], + [ "MockedHost", "classevmc_1_1MockedHost.html", "classevmc_1_1MockedHost" ], + [ "Result", "classevmc_1_1Result.html", "classevmc_1_1Result" ], + [ "skip_space_iterator", "structevmc_1_1skip__space__iterator.html", null ], + [ "StorageValue", "structevmc_1_1StorageValue.html", "structevmc_1_1StorageValue" ], + [ "VM", "classevmc_1_1VM.html", "classevmc_1_1VM" ], + [ "bytes", "namespaceevmc.html#affa3c8d90f2ba11532f22a8cd7c4e01d", null ], + [ "bytes_view", "namespaceevmc.html#a665f6ff44dc091ee7a5aef42e302b522", null ], + [ "uint256be", "namespaceevmc.html#a92bc6b73f1ce3a2b2eea018cf902c4da", null ], + [ "from_hex", "namespaceevmc.html#a3f5eb1dbbbae0df50203409b623477dc", null ], + [ "from_hex", "namespaceevmc.html#a05235e8772a59a6d9c4717853a8b76da", null ], + [ "from_hex", "namespaceevmc.html#acf5a514afe5cec3f8d577ba47ccc6d08", null ], + [ "from_spaced_hex", "namespaceevmc.html#ad691d603a37e0a3da31328ae3c8c1555", null ], + [ "from_spaced_hex", "namespaceevmc.html#af872bba89fb9d7032e96cc08e5979ebf", null ], + [ "hex", "namespaceevmc.html#adb1773c2909e66879ce13de2a49c5fee", null ], + [ "hex", "namespaceevmc.html#a19a82782b528ebd37782eb145cf4152c", null ], + [ "is_not_space", "namespaceevmc.html#a39883bab64bef2d49a583c8511048c63", null ], + [ "is_zero", "namespaceevmc.html#afc53d0e831bda94fbf31a64d224c8d24", null ], + [ "is_zero", "namespaceevmc.html#a2277f8eca7df22f45a4476d3fe6342fe", null ], + [ "isspace", "namespaceevmc.html#a96ba330d120e018682ab8b24730d6d68", null ], + [ "load32be", "namespaceevmc.html#a2170432bbbef84b33ce6dda30904068e", null ], + [ "load32le", "namespaceevmc.html#ada9ae3e2b40c36dbea8b6fe8ab70375b", null ], + [ "load64be", "namespaceevmc.html#a1a253fea559bb97f713b91903ffc860e", null ], + [ "load64le", "namespaceevmc.html#acd1275224a4eb5f6a672507d144065df", null ], + [ "operator!=", "namespaceevmc.html#acef96efd7f9847cc089834dff73054bd", null ], + [ "operator!=", "namespaceevmc.html#a5917d256b4c67912a47d3a54f849f751", null ], + [ "operator<", "namespaceevmc.html#a0a5557fb3dc3c04da6ef466ec3bb4d4c", null ], + [ "operator<", "namespaceevmc.html#a4a0c61db81ebf11230c1506f7fc9e003", null ], + [ "operator<=", "namespaceevmc.html#ac0dc436fe57925210dcd0481a79e9784", null ], + [ "operator<=", "namespaceevmc.html#a8580df251c76ac9b0a1561cbfda93274", null ], + [ "operator==", "namespaceevmc.html#a3f6b3b885e1053cebe81913583212e70", null ], + [ "operator==", "namespaceevmc.html#a338b7c7a6dd5c12c0e37e5e8ef729100", null ], + [ "operator>", "namespaceevmc.html#a44333e715985f766f2493b20ed665fbd", null ], + [ "operator>", "namespaceevmc.html#a04835f698b6a2a5d2fbc3f8234518aed", null ], + [ "operator>=", "namespaceevmc.html#aa1739e6e990dbd1fd3d30b249b1d0d58", null ], + [ "operator>=", "namespaceevmc.html#ad830a8c519d4baf674a220480efc8ad3", null ], + [ "skip_space_iterator", "namespaceevmc.html#a3757e10e4ad4bb06ca15ef61a2d807b7", null ], + [ "to_string", "namespaceevmc.html#a773edff68f6e013b3c809bb4c6ea33d3", null ], + [ "to_string", "namespaceevmc.html#a44c9aad0ac3f324d817e18720a1e37de", null ], + [ "validate_hex", "namespaceevmc.html#a1c60196566199593d6b023b792f1ac78", null ], + [ "make_result", "namespaceevmc.html#a9843b267dc279832b0ff9578b7dacdb7", null ] +]; \ No newline at end of file diff --git a/namespacemembers.html b/namespacemembers.html new file mode 100644 index 000000000..eb1006711 --- /dev/null +++ b/namespacemembers.html @@ -0,0 +1,138 @@ + + + + + + + +EVMC: Namespace Members + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    Here is a list of all documented namespace members with links to the namespaces they belong to:
    + +

    - b -

    + + +

    - f -

      +
    • from_hex() : evmc
    • +
    • from_spaced_hex() : evmc
    • +
    + + +

    - h -

    + + +

    - i -

      +
    • is_not_space() : evmc
    • +
    • is_zero() : evmc
    • +
    • isspace() : evmc
    • +
    + + +

    - l -

      +
    • load32be() : evmc
    • +
    • load32le() : evmc
    • +
    • load64be() : evmc
    • +
    • load64le() : evmc
    • +
    + + +

    - m -

      +
    • make_result : evmc
    • +
    + + +

    - o -

      +
    • operator!=() : evmc
    • +
    • operator<() : evmc
    • +
    • operator<=() : evmc
    • +
    • operator==() : evmc
    • +
    • operator>() : evmc
    • +
    • operator>=() : evmc
    • +
    + + +

    - s -

      +
    • skip_space_iterator() : evmc
    • +
    + + +

    - t -

      +
    • to_string() : evmc
    • +
    + + +

    - u -

      +
    • uint256be : evmc
    • +
    + + +

    - v -

      +
    • validate_hex() : evmc
    • +
    +
    +
    + + + + diff --git a/namespacemembers_func.html b/namespacemembers_func.html new file mode 100644 index 000000000..ef0143f3c --- /dev/null +++ b/namespacemembers_func.html @@ -0,0 +1,122 @@ + + + + + + + +EVMC: Namespace Members + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +  + +

    - f -

      +
    • from_hex() : evmc
    • +
    • from_spaced_hex() : evmc
    • +
    + + +

    - h -

    + + +

    - i -

      +
    • is_not_space() : evmc
    • +
    • is_zero() : evmc
    • +
    • isspace() : evmc
    • +
    + + +

    - l -

      +
    • load32be() : evmc
    • +
    • load32le() : evmc
    • +
    • load64be() : evmc
    • +
    • load64le() : evmc
    • +
    + + +

    - o -

      +
    • operator!=() : evmc
    • +
    • operator<() : evmc
    • +
    • operator<=() : evmc
    • +
    • operator==() : evmc
    • +
    • operator>() : evmc
    • +
    • operator>=() : evmc
    • +
    + + +

    - s -

      +
    • skip_space_iterator() : evmc
    • +
    + + +

    - t -

      +
    • to_string() : evmc
    • +
    + + +

    - v -

      +
    • validate_hex() : evmc
    • +
    +
    +
    + + + + diff --git a/namespacemembers_type.html b/namespacemembers_type.html new file mode 100644 index 000000000..c3ae07a0f --- /dev/null +++ b/namespacemembers_type.html @@ -0,0 +1,76 @@ + + + + + + + +EVMC: Namespace Members + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    +
    + + + + diff --git a/namespacemembers_vars.html b/namespacemembers_vars.html new file mode 100644 index 000000000..67ba798bc --- /dev/null +++ b/namespacemembers_vars.html @@ -0,0 +1,74 @@ + + + + + + + +EVMC: Namespace Members + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
      +
    • make_result : evmc
    • +
    +
    +
    + + + + diff --git a/namespaces.html b/namespaces.html new file mode 100644 index 000000000..ba743dfa1 --- /dev/null +++ b/namespaces.html @@ -0,0 +1,93 @@ + + + + + + + +EVMC: Namespace List + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    Namespace List
    +
    +
    +
    Here is a list of all documented namespaces with brief descriptions:
    +
    [detail level 123]
    + + + + + + + + + + + + + + + +
     NevmcEVMC C++ API - wrappers and bindings for C++
     CaddressThe big-endian 160-bit hash suitable for keeping an Ethereum address
     Cbyte_traitsThe char traits for byte-like types
     Cbytes32The fixed size array of 32 bytes for storing 256-bit EVM values
     Cfilter_iteratorThe filter iterator adaptor creates a view of an iterator range in which some elements of the range are skipped
     CHostAbstract class to be used by Host implementations
     CHostContextWrapper around EVMC host context / host interface
     CHostInterfaceThe EVMC Host interface
     CMockedAccountMocked account
     CMockedHostMocked EVMC Host implementation
     Clog_recordLOG record
     CResultThe EVM code execution result.
     Cskip_space_iteratorThe input filter iterator which skips whitespace characters from the base input iterator
     CStorageValueExtended value (with original value and access flag) for account storage
     CVMThe VM instance.
    +
    +
    +
    + + + + diff --git a/namespaces_dup.js b/namespaces_dup.js new file mode 100644 index 000000000..bc773138d --- /dev/null +++ b/namespaces_dup.js @@ -0,0 +1,4 @@ +var namespaces_dup = +[ + [ "evmc", "namespaceevmc.html", "namespaceevmc" ] +]; \ No newline at end of file diff --git a/nav_f.png b/nav_f.png new file mode 100644 index 000000000..72a58a529 Binary files /dev/null and b/nav_f.png differ diff --git a/nav_fd.png b/nav_fd.png new file mode 100644 index 000000000..032fbdd4c Binary files /dev/null and b/nav_fd.png differ diff --git a/nav_g.png b/nav_g.png new file mode 100644 index 000000000..2093a237a Binary files /dev/null and b/nav_g.png differ diff --git a/nav_h.png b/nav_h.png new file mode 100644 index 000000000..33389b101 Binary files /dev/null and b/nav_h.png differ diff --git a/nav_hd.png b/nav_hd.png new file mode 100644 index 000000000..de80f18ad Binary files /dev/null and b/nav_hd.png differ diff --git a/navtree.css b/navtree.css new file mode 100644 index 000000000..c8a7766a7 --- /dev/null +++ b/navtree.css @@ -0,0 +1,150 @@ +#nav-tree .children_ul { + margin:0; + padding:4px; +} + +#nav-tree ul { + list-style:none outside none; + margin:0px; + padding:0px; +} + +#nav-tree li { + white-space:nowrap; + margin:0px; + padding:0px; +} + +#nav-tree .plus { + margin:0px; +} + +#nav-tree .selected { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + color: var(--nav-text-active-color); + text-shadow: var(--nav-text-active-shadow); +} + +#nav-tree .selected .arrow { + color: var(--nav-arrow-selected-color); + text-shadow: none; +} + +#nav-tree img { + margin:0px; + padding:0px; + border:0px; + vertical-align: middle; +} + +#nav-tree a { + text-decoration:none; + padding:0px; + margin:0px; + outline:none; +} + +#nav-tree .label { + margin:0px; + padding:0px; + font: 12px var(--font-family-nav); +} + +#nav-tree .label a { + padding:2px; +} + +#nav-tree .selected a { + text-decoration:none; + color:var(--nav-text-active-color); +} + +#nav-tree .children_ul { + margin:0px; + padding:0px; +} + +#nav-tree .item { + margin:0px; + padding:0px; +} + +#nav-tree { + padding: 0px 0px; + font-size:14px; + overflow:auto; +} + +#doc-content { + overflow:auto; + display:block; + padding:0px; + margin:0px; + -webkit-overflow-scrolling : touch; /* iOS 5+ */ +} + +#side-nav { + padding:0 6px 0 0; + margin: 0px; + display:block; + position: absolute; + left: 0px; + width: $width; + overflow : hidden; +} + +.ui-resizable .ui-resizable-handle { + display:block; +} + +.ui-resizable-e { + background-image:var(--nav-splitbar-image); + background-size:100%; + background-repeat:repeat-y; + background-attachment: scroll; + cursor:ew-resize; + height:100%; + right:0; + top:0; + width:6px; +} + +.ui-resizable-handle { + display:none; + font-size:0.1px; + position:absolute; + z-index:1; +} + +#nav-tree-contents { + margin: 6px 0px 0px 0px; +} + +#nav-tree { + background-repeat:repeat-x; + background-color: var(--nav-background-color); + -webkit-overflow-scrolling : touch; /* iOS 5+ */ +} + +#nav-sync { + position:absolute; + top:5px; + right:24px; + z-index:0; +} + +#nav-sync img { + opacity:0.3; +} + +#nav-sync img:hover { + opacity:0.9; +} + +@media print +{ + #nav-tree { display: none; } + div.ui-resizable-handle { display: none; position: relative; } +} + diff --git a/navtree.js b/navtree.js new file mode 100644 index 000000000..27983687a --- /dev/null +++ b/navtree.js @@ -0,0 +1,549 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +var navTreeSubIndices = new Array(); +var arrowDown = '▼'; +var arrowRight = '►'; + +function getData(varName) +{ + var i = varName.lastIndexOf('/'); + var n = i>=0 ? varName.substring(i+1) : varName; + return eval(n.replace(/\-/g,'_')); +} + +function stripPath(uri) +{ + return uri.substring(uri.lastIndexOf('/')+1); +} + +function stripPath2(uri) +{ + var i = uri.lastIndexOf('/'); + var s = uri.substring(i+1); + var m = uri.substring(0,i+1).match(/\/d\w\/d\w\w\/$/); + return m ? uri.substring(i-6) : s; +} + +function hashValue() +{ + return $(location).attr('hash').substring(1).replace(/[^\w\-]/g,''); +} + +function hashUrl() +{ + return '#'+hashValue(); +} + +function pathName() +{ + return $(location).attr('pathname').replace(/[^-A-Za-z0-9+&@#/%?=~_|!:,.;\(\)]/g, ''); +} + +function localStorageSupported() +{ + try { + return 'localStorage' in window && window['localStorage'] !== null && window.localStorage.getItem; + } + catch(e) { + return false; + } +} + +function storeLink(link) +{ + if (!$("#nav-sync").hasClass('sync') && localStorageSupported()) { + window.localStorage.setItem('navpath',link); + } +} + +function deleteLink() +{ + if (localStorageSupported()) { + window.localStorage.setItem('navpath',''); + } +} + +function cachedLink() +{ + if (localStorageSupported()) { + return window.localStorage.getItem('navpath'); + } else { + return ''; + } +} + +function getScript(scriptName,func,show) +{ + var head = document.getElementsByTagName("head")[0]; + var script = document.createElement('script'); + script.id = scriptName; + script.type = 'text/javascript'; + script.onload = func; + script.src = scriptName+'.js'; + head.appendChild(script); +} + +function createIndent(o,domNode,node,level) +{ + var level=-1; + var n = node; + while (n.parentNode) { level++; n=n.parentNode; } + if (node.childrenData) { + var imgNode = document.createElement("span"); + imgNode.className = 'arrow'; + imgNode.style.paddingLeft=(16*level).toString()+'px'; + imgNode.innerHTML=arrowRight; + node.plus_img = imgNode; + node.expandToggle = document.createElement("a"); + node.expandToggle.href = "javascript:void(0)"; + node.expandToggle.onclick = function() { + if (node.expanded) { + $(node.getChildrenUL()).slideUp("fast"); + node.plus_img.innerHTML=arrowRight; + node.expanded = false; + } else { + expandNode(o, node, false, false); + } + } + node.expandToggle.appendChild(imgNode); + domNode.appendChild(node.expandToggle); + } else { + var span = document.createElement("span"); + span.className = 'arrow'; + span.style.width = 16*(level+1)+'px'; + span.innerHTML = ' '; + domNode.appendChild(span); + } +} + +var animationInProgress = false; + +function gotoAnchor(anchor,aname,updateLocation) +{ + var pos, docContent = $('#doc-content'); + var ancParent = $(anchor.parent()); + if (ancParent.hasClass('memItemLeft') || + ancParent.hasClass('memtitle') || + ancParent.hasClass('fieldname') || + ancParent.hasClass('fieldtype') || + ancParent.is(':header')) + { + pos = ancParent.position().top; + } else if (anchor.position()) { + pos = anchor.position().top; + } + if (pos) { + var dist = Math.abs(Math.min( + pos-docContent.offset().top, + docContent[0].scrollHeight- + docContent.height()-docContent.scrollTop())); + animationInProgress=true; + docContent.animate({ + scrollTop: pos + docContent.scrollTop() - docContent.offset().top + },Math.max(50,Math.min(500,dist)),function(){ + if (updateLocation) window.location.href=aname; + animationInProgress=false; + }); + } +} + +function newNode(o, po, text, link, childrenData, lastNode) +{ + var node = new Object(); + node.children = Array(); + node.childrenData = childrenData; + node.depth = po.depth + 1; + node.relpath = po.relpath; + node.isLast = lastNode; + + node.li = document.createElement("li"); + po.getChildrenUL().appendChild(node.li); + node.parentNode = po; + + node.itemDiv = document.createElement("div"); + node.itemDiv.className = "item"; + + node.labelSpan = document.createElement("span"); + node.labelSpan.className = "label"; + + createIndent(o,node.itemDiv,node,0); + node.itemDiv.appendChild(node.labelSpan); + node.li.appendChild(node.itemDiv); + + var a = document.createElement("a"); + node.labelSpan.appendChild(a); + node.label = document.createTextNode(text); + node.expanded = false; + a.appendChild(node.label); + if (link) { + var url; + if (link.substring(0,1)=='^') { + url = link.substring(1); + link = url; + } else { + url = node.relpath+link; + } + a.className = stripPath(link.replace('#',':')); + if (link.indexOf('#')!=-1) { + var aname = '#'+link.split('#')[1]; + var srcPage = stripPath(pathName()); + var targetPage = stripPath(link.split('#')[0]); + a.href = srcPage!=targetPage ? url : "javascript:void(0)"; + a.onclick = function(){ + storeLink(link); + if (!$(a).parent().parent().hasClass('selected')) + { + $('.item').removeClass('selected'); + $('.item').removeAttr('id'); + $(a).parent().parent().addClass('selected'); + $(a).parent().parent().attr('id','selected'); + } + var anchor = $(aname); + gotoAnchor(anchor,aname,true); + }; + } else { + a.href = url; + a.onclick = function() { storeLink(link); } + } + } else { + if (childrenData != null) + { + a.className = "nolink"; + a.href = "javascript:void(0)"; + a.onclick = node.expandToggle.onclick; + } + } + + node.childrenUL = null; + node.getChildrenUL = function() { + if (!node.childrenUL) { + node.childrenUL = document.createElement("ul"); + node.childrenUL.className = "children_ul"; + node.childrenUL.style.display = "none"; + node.li.appendChild(node.childrenUL); + } + return node.childrenUL; + }; + + return node; +} + +function showRoot() +{ + var headerHeight = $("#top").height(); + var footerHeight = $("#nav-path").height(); + var windowHeight = $(window).height() - headerHeight - footerHeight; + (function (){ // retry until we can scroll to the selected item + try { + var navtree=$('#nav-tree'); + navtree.scrollTo('#selected',100,{offset:-windowHeight/2}); + } catch (err) { + setTimeout(arguments.callee, 0); + } + })(); +} + +function expandNode(o, node, imm, showRoot) +{ + if (node.childrenData && !node.expanded) { + if (typeof(node.childrenData)==='string') { + var varName = node.childrenData; + getScript(node.relpath+varName,function(){ + node.childrenData = getData(varName); + expandNode(o, node, imm, showRoot); + }, showRoot); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).slideDown("fast"); + node.plus_img.innerHTML = arrowDown; + node.expanded = true; + } + } +} + +function glowEffect(n,duration) +{ + n.addClass('glow').delay(duration).queue(function(next){ + $(this).removeClass('glow');next(); + }); +} + +function highlightAnchor() +{ + var aname = hashUrl(); + var anchor = $(aname); + if (anchor.parent().attr('class')=='memItemLeft'){ + var rows = $('.memberdecls tr[class$="'+hashValue()+'"]'); + glowEffect(rows.children(),300); // member without details + } else if (anchor.parent().attr('class')=='fieldname'){ + glowEffect(anchor.parent().parent(),1000); // enum value + } else if (anchor.parent().attr('class')=='fieldtype'){ + glowEffect(anchor.parent().parent(),1000); // struct field + } else if (anchor.parent().is(":header")) { + glowEffect(anchor.parent(),1000); // section header + } else { + glowEffect(anchor.next(),1000); // normal member + } +} + +function selectAndHighlight(hash,n) +{ + var a; + if (hash) { + var link=stripPath(pathName())+':'+hash.substring(1); + a=$('.item a[class$="'+link+'"]'); + } + if (a && a.length) { + a.parent().parent().addClass('selected'); + a.parent().parent().attr('id','selected'); + highlightAnchor(); + } else if (n) { + $(n.itemDiv).addClass('selected'); + $(n.itemDiv).attr('id','selected'); + } + var topOffset=5; + if (typeof page_layout!=='undefined' && page_layout==1) { + topOffset+=$('#top').outerHeight(); + } + if ($('#nav-tree-contents .item:first').hasClass('selected')) { + topOffset+=25; + } + $('#nav-sync').css('top',topOffset+'px'); + showRoot(); +} + +function showNode(o, node, index, hash) +{ + if (node && node.childrenData) { + if (typeof(node.childrenData)==='string') { + var varName = node.childrenData; + getScript(node.relpath+varName,function(){ + node.childrenData = getData(varName); + showNode(o,node,index,hash); + },true); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).css({'display':'block'}); + node.plus_img.innerHTML = arrowDown; + node.expanded = true; + var n = node.children[o.breadcrumbs[index]]; + if (index+11) hash = '#'+parts[1].replace(/[^\w\-]/g,''); + else hash=''; + } + if (hash.match(/^#l\d+$/)) { + var anchor=$('a[name='+hash.substring(1)+']'); + glowEffect(anchor.parent(),1000); // line number + hash=''; // strip line number anchors + } + var url=root+hash; + var i=-1; + while (NAVTREEINDEX[i+1]<=url) i++; + if (i==-1) { i=0; root=NAVTREE[0][1]; } // fallback: show index + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath) + } else { + getScript(relpath+'navtreeindex'+i,function(){ + navTreeSubIndices[i] = eval('NAVTREEINDEX'+i); + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath); + } + },true); + } +} + +function showSyncOff(n,relpath) +{ + n.html(''); +} + +function showSyncOn(n,relpath) +{ + n.html(''); +} + +function toggleSyncButton(relpath) +{ + var navSync = $('#nav-sync'); + if (navSync.hasClass('sync')) { + navSync.removeClass('sync'); + showSyncOff(navSync,relpath); + storeLink(stripPath2(pathName())+hashUrl()); + } else { + navSync.addClass('sync'); + showSyncOn(navSync,relpath); + deleteLink(); + } +} + +var loadTriggered = false; +var readyTriggered = false; +var loadObject,loadToRoot,loadUrl,loadRelPath; + +$(window).on('load',function(){ + if (readyTriggered) { // ready first + navTo(loadObject,loadToRoot,loadUrl,loadRelPath); + showRoot(); + } + loadTriggered=true; +}); + +function initNavTree(toroot,relpath) +{ + var o = new Object(); + o.toroot = toroot; + o.node = new Object(); + o.node.li = document.getElementById("nav-tree-contents"); + o.node.childrenData = NAVTREE; + o.node.children = new Array(); + o.node.childrenUL = document.createElement("ul"); + o.node.getChildrenUL = function() { return o.node.childrenUL; }; + o.node.li.appendChild(o.node.childrenUL); + o.node.depth = 0; + o.node.relpath = relpath; + o.node.expanded = false; + o.node.isLast = true; + o.node.plus_img = document.createElement("span"); + o.node.plus_img.className = 'arrow'; + o.node.plus_img.innerHTML = arrowRight; + + if (localStorageSupported()) { + var navSync = $('#nav-sync'); + if (cachedLink()) { + showSyncOff(navSync,relpath); + navSync.removeClass('sync'); + } else { + showSyncOn(navSync,relpath); + } + navSync.click(function(){ toggleSyncButton(relpath); }); + } + + if (loadTriggered) { // load before ready + navTo(o,toroot,hashUrl(),relpath); + showRoot(); + } else { // ready before load + loadObject = o; + loadToRoot = toroot; + loadUrl = hashUrl(); + loadRelPath = relpath; + readyTriggered=true; + } + + $(window).bind('hashchange', function(){ + if (window.location.hash && window.location.hash.length>1){ + var a; + if ($(location).attr('hash')){ + var clslink=stripPath(pathName())+':'+hashValue(); + a=$('.item a[class$="'+clslink.replace(/ + + + + + + +EVMC: Related Pages + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    Related Pages
    +
    +
    +
    Here is a list of all related documentation pages:
    +
    +
    + + + + diff --git a/resize.js b/resize.js new file mode 100644 index 000000000..aaeb6fc0a --- /dev/null +++ b/resize.js @@ -0,0 +1,155 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +var once=1; +function initResizable() +{ + var cookie_namespace = 'doxygen'; + var sidenav,navtree,content,header,barWidth=6,desktop_vp=768,titleHeight; + + function readSetting(cookie) + { + if (window.chrome) { + var val = localStorage.getItem(cookie_namespace+'_width'); + if (val) return val; + } else { + var myCookie = cookie_namespace+"_"+cookie+"="; + if (document.cookie) { + var index = document.cookie.indexOf(myCookie); + if (index != -1) { + var valStart = index + myCookie.length; + var valEnd = document.cookie.indexOf(";", valStart); + if (valEnd == -1) { + valEnd = document.cookie.length; + } + var val = document.cookie.substring(valStart, valEnd); + return val; + } + } + } + return 250; + } + + function writeSetting(cookie, val) + { + if (window.chrome) { + localStorage.setItem(cookie_namespace+"_width",val); + } else { + var date = new Date(); + date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week + expiration = date.toGMTString(); + document.cookie = cookie_namespace + "_" + cookie + "=" + val + "; SameSite=Lax; expires=" + expiration+"; path=/"; + } + } + + function resizeWidth() + { + var windowWidth = $(window).width() + "px"; + var sidenavWidth = $(sidenav).outerWidth(); + content.css({marginLeft:parseInt(sidenavWidth)+"px"}); + if (typeof page_layout!=='undefined' && page_layout==1) { + footer.css({marginLeft:parseInt(sidenavWidth)+"px"}); + } + writeSetting('width',sidenavWidth-barWidth); + } + + function restoreWidth(navWidth) + { + var windowWidth = $(window).width() + "px"; + content.css({marginLeft:parseInt(navWidth)+barWidth+"px"}); + if (typeof page_layout!=='undefined' && page_layout==1) { + footer.css({marginLeft:parseInt(navWidth)+barWidth+"px"}); + } + sidenav.css({width:navWidth + "px"}); + } + + function resizeHeight() + { + var headerHeight = header.outerHeight(); + var footerHeight = footer.outerHeight(); + var windowHeight = $(window).height(); + var contentHeight,navtreeHeight,sideNavHeight; + if (typeof page_layout==='undefined' || page_layout==0) { /* DISABLE_INDEX=NO */ + contentHeight = windowHeight - headerHeight - footerHeight; + navtreeHeight = contentHeight; + sideNavHeight = contentHeight; + } else if (page_layout==1) { /* DISABLE_INDEX=YES */ + contentHeight = windowHeight - footerHeight; + navtreeHeight = windowHeight - headerHeight; + sideNavHeight = windowHeight; + } + content.css({height:contentHeight + "px"}); + navtree.css({height:navtreeHeight + "px"}); + sidenav.css({height:sideNavHeight + "px"}); + if (location.hash.slice(1)) { + (document.getElementById(location.hash.slice(1))||document.body).scrollIntoView(); + } + } + + function collapseExpand() + { + var newWidth; + if (sidenav.width()>0) { + newWidth=0; + } + else { + var width = readSetting('width'); + newWidth = (width>250 && width<$(window).width()) ? width : 250; + } + restoreWidth(newWidth); + var sidenavWidth = $(sidenav).outerWidth(); + writeSetting('width',sidenavWidth-barWidth); + } + + header = $("#top"); + sidenav = $("#side-nav"); + content = $("#doc-content"); + navtree = $("#nav-tree"); + footer = $("#nav-path"); + $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } }); + $(sidenav).resizable({ minWidth: 0 }); + $(window).resize(function() { resizeHeight(); }); + var device = navigator.userAgent.toLowerCase(); + var touch_device = device.match(/(iphone|ipod|ipad|android)/); + if (touch_device) { /* wider split bar for touch only devices */ + $(sidenav).css({ paddingRight:'20px' }); + $('.ui-resizable-e').css({ width:'20px' }); + $('#nav-sync').css({ right:'34px' }); + barWidth=20; + } + var width = readSetting('width'); + if (width) { restoreWidth(width); } else { resizeWidth(); } + resizeHeight(); + var url = location.href; + var i=url.indexOf("#"); + if (i>=0) window.location.hash=url.substr(i); + var _preventDefault = function(evt) { evt.preventDefault(); }; + $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault); + if (once) { + $(".ui-resizable-handle").dblclick(collapseExpand); + once=0 + } + $(window).on('load',resizeHeight); +} +/* @license-end */ diff --git a/splitbar.png b/splitbar.png new file mode 100644 index 000000000..fe895f2c5 Binary files /dev/null and b/splitbar.png differ diff --git a/splitbard.png b/splitbard.png new file mode 100644 index 000000000..8367416d7 Binary files /dev/null and b/splitbard.png differ diff --git a/storagestatus.html b/storagestatus.html new file mode 100644 index 000000000..6a66df64c --- /dev/null +++ b/storagestatus.html @@ -0,0 +1,221 @@ + + + + + + + +EVMC: EVM Storage Change Status + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    EVM Storage Change Status
    +
    +
    +

    The description of evmc_storage_status enum design and its relation to the specification in EIP-2200 and others.

    +

    +Specification

    +
    +

    ‍This is the EIP-2200 specification with modifications:

      +
    • the clause tree has been converted to ordered lists to be referenceable,
    • +
    • the cost constant names has been replaced with matching Yellow Paper names.
    • +
    +
    +
      +
    1. If gasleft is less than or equal to gas stipend, fail the current call frame with 'out of gas' exception.
    2. +
    3. If current value equals new value (this is a no-op), Gwarmaccess is deducted.
    4. +
    5. If current value does not equal new value
        +
      1. If original value equals current value (this storage slot has not been changed by the current execution context)
          +
        1. If original value is 0, Gsset is deducted.
        2. +
        3. Otherwise, Gsreset gas is deducted.
            +
          1. If new value is 0, add Rsclear gas to refund counter.
          2. +
          +
        4. +
        +
      2. +
      3. If original value does not equal current value (this storage slot is dirty), Gwarmaccess gas is deducted. Apply both of the following clauses.
          +
        1. If original value is not 0
            +
          1. If current value is 0 (also means that new value is not 0), remove Rsclear gas from refund counter.
          2. +
          3. If new value is 0 (also means that current value is not 0), add Rsclear gas to refund counter.
          4. +
          +
        2. +
        3. If original value equals new value (this storage slot is reset)
            +
          1. If original value is 0, add Gsset - Gwarmaccess to refund counter.
          2. +
          3. Otherwise, add Gsreset - Gwarmaccess gas to refund counter.
          4. +
          +
        4. +
        +
      4. +
      +
    6. +
    +

    +Cost constants

    + + + + + + + + + + + +
    Yellow Paper EIP-2200 EIP-2200 Value EIP-2929 Value
    Gwarmaccess SLOAD_GAS 800 100
    Gsset SSTORE_SET_GAS 20000 20000
    Gsreset SSTORE_RESET_GAS 5000 2900
    Rsclear SSTORE_CLEARS_SCHEDULE 15000 15000
    +

    +Storage change statuses

    +
      +
    • 0 - zero value
    • +
    • X - non-zero value
    • +
    • Y - non-zero value different from X
    • +
    • Z - non-zero value different form X and Y
    • +
    • o - original value
    • +
    • c - current value
    • +
    • v - new value
    • +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    name o c v dirty restored clause gas cost gas refund
    ASSIGNED 000 no yes 2 Gwarmaccess 0
    X00 yes no 2
    0YY yes no 2
    XYY yes no 2
    YYY no yes 2
    0YZ yes no 3.2
    XYZ yes no 3.2
    ADDED 00Z no no 3.1.1 Gsset 0
    DELETED XX0 no no 3.1.2.1 Gsreset Rsclear
    MODIFIED XXZ no no 3.1.2 Gsreset 0
    DELETED_ADDED X0Z yes no 3.2.1.1 Gwarmaccess -Rsclear
    MODIFIED_DELETED XY0 yes no 3.2.1.2 Gwarmaccess Rsclear
    DELETED_RESTORED X0X yes yes 3.2.1.1 + 3.2.2.2 Gwarmaccess -Rsclear + Gsreset - Gwarmaccess
    ADDED_DELETED 0Y0 yes yes 3.2.2.1 Gwarmaccess Gsset - Gwarmaccess
    MODIFIED_RESTORED XYX yes yes 3.2.2.2 Gwarmaccess Gsreset - Gwarmaccess
    +

    +Efficient implementation

    +

    All distinctive storage change statuses can be unambiguously selected by combination of the 4 following checks:

      +
    • o ≠ c, i.e. original != current (dirty),
    • +
    • o = v, i.e original == new (restored),
    • +
    • c ≠ 0, i.e current != 0,
    • +
    • v ≠ 0, i.e new != 0.
    • +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    name o c v o ≠ c o = v c ≠ 0 v ≠ 0 checksum proof
    ASSIGNED 000 0100 4 (0b0100)
    X00 1000 8 (0b1000)
    0YY 1011 11 (0b1011)
    XYY 1011 11 (0b1011)
    YYY 0111 7 (0b0111)
    0YZ 1011 11 (0b1011)
    XYZ 1011 11 (0b1011)
    ADDED 00Z 0001 1 (0b0001)
    DELETED XX0 0010 2 (0b0010)
    MODIFIED XXZ 0011 3 (0b0011)
    DELETED_ADDED X0Z 1001 9 (0b1001)
    MODIFIED_DELETED XY0 1010 10 (0b1010)
    DELETED_RESTORED X0X 1101 13 (0b1101)
    ADDED_DELETED 0Y0 1110 14 (0b1110)
    MODIFIED_RESTORED XYX 1111 15 (0b1111)
    impossible 0000 0 (0b0000) o=c ∧ o≠v ∧ c=0 ⇒ v≠0
    0101 5 (0b0101) o=c ∧ o=v ∧ c=0 ⇒ v=0
    0110 6 (0b0110) o=c ∧ o=v ∧ c≠0 ⇒ v≠0
    1100 12 (0b1100) o≠c ∧ o=v ∧ c=0 ⇒ v≠0
    +
    +
    +
    + + + + diff --git a/structevmc_1_1MockedAccount-members.html b/structevmc_1_1MockedAccount-members.html new file mode 100644 index 000000000..3b0d6e5ea --- /dev/null +++ b/structevmc_1_1MockedAccount-members.html @@ -0,0 +1,84 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    evmc::MockedAccount Member List
    +
    + +
    + + + + diff --git a/structevmc_1_1MockedAccount.html b/structevmc_1_1MockedAccount.html new file mode 100644 index 000000000..5cfd29311 --- /dev/null +++ b/structevmc_1_1MockedAccount.html @@ -0,0 +1,267 @@ + + + + + + + +EVMC: evmc::MockedAccount Struct Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    evmc::MockedAccount Struct Reference
    +
    +
    + +

    Mocked account. + More...

    + +

    #include <mocked_host.hpp>

    + + + + + +

    +Public Member Functions

    void set_balance (uint64_t x) noexcept
     Helper method for setting balance by numeric type.
     
    + + + + + + + + + + + + + + + + + + + +

    +Public Attributes

    int nonce = 0
     The account nonce.
     
    bytes code
     The account code.
     
    bytes32 codehash
     The code hash. Can be a value not related to the actual code.
     
    uint256be balance
     The account balance.
     
    std::unordered_map< bytes32, StorageValuestorage
     The account storage map.
     
    std::unordered_map< bytes32, bytes32transient_storage
     The account transient storage.
     
    +

    Detailed Description

    +

    Mocked account.

    + +

    Definition at line 45 of file mocked_host.hpp.

    +

    Member Function Documentation

    + +

    ◆ set_balance()

    + +
    +
    + + + + + +
    + + + + + + + + +
    void evmc::MockedAccount::set_balance (uint64_t x)
    +
    +inlinenoexcept
    +
    + +

    Helper method for setting balance by numeric type.

    + +

    Definition at line 66 of file mocked_host.hpp.

    +
    67 {
    + +
    69 for (std::size_t i = 0; i < sizeof(x); ++i)
    +
    70 balance.bytes[sizeof(balance) - 1 - i] = static_cast<uint8_t>(x >> (8 * i));
    +
    71 }
    +
    bytes32 uint256be
    The alias for evmc::bytes32 to represent a big-endian 256-bit integer.
    Definition: evmc.hpp:124
    +
    uint256be balance
    The account balance.
    Definition: mocked_host.hpp:57
    +
    uint8_t bytes[32]
    The 32 bytes.
    Definition: evmc.h:59
    +
    +
    +
    +

    Member Data Documentation

    + +

    ◆ balance

    + +
    +
    + + + + +
    uint256be evmc::MockedAccount::balance
    +
    + +

    The account balance.

    + +

    Definition at line 57 of file mocked_host.hpp.

    + +
    +
    + +

    ◆ code

    + +
    +
    + + + + +
    bytes evmc::MockedAccount::code
    +
    + +

    The account code.

    + +

    Definition at line 51 of file mocked_host.hpp.

    + +
    +
    + +

    ◆ codehash

    + +
    +
    + + + + +
    bytes32 evmc::MockedAccount::codehash
    +
    + +

    The code hash. Can be a value not related to the actual code.

    + +

    Definition at line 54 of file mocked_host.hpp.

    + +
    +
    + +

    ◆ nonce

    + +
    +
    + + + + +
    int evmc::MockedAccount::nonce = 0
    +
    + +

    The account nonce.

    + +

    Definition at line 48 of file mocked_host.hpp.

    + +
    +
    + +

    ◆ storage

    + +
    +
    + + + + +
    std::unordered_map<bytes32, StorageValue> evmc::MockedAccount::storage
    +
    + +

    The account storage map.

    + +

    Definition at line 60 of file mocked_host.hpp.

    + +
    +
    + +

    ◆ transient_storage

    + +
    +
    + + + + +
    std::unordered_map<bytes32, bytes32> evmc::MockedAccount::transient_storage
    +
    + +

    The account transient storage.

    + +

    Definition at line 63 of file mocked_host.hpp.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + diff --git a/structevmc_1_1MockedAccount.js b/structevmc_1_1MockedAccount.js new file mode 100644 index 000000000..ce3fbe929 --- /dev/null +++ b/structevmc_1_1MockedAccount.js @@ -0,0 +1,10 @@ +var structevmc_1_1MockedAccount = +[ + [ "set_balance", "structevmc_1_1MockedAccount.html#ac757b616c2622fcf5a361a8a08ba2bde", null ], + [ "balance", "structevmc_1_1MockedAccount.html#a70a90d4df3e2a1b3f37a670835f5179a", null ], + [ "code", "structevmc_1_1MockedAccount.html#a6da53c27a9106c49a59582494f8ef37a", null ], + [ "codehash", "structevmc_1_1MockedAccount.html#a4702798be7eb84d982ad66dd335d56a6", null ], + [ "nonce", "structevmc_1_1MockedAccount.html#a64c2a2707e01eed3806881e385b182ed", null ], + [ "storage", "structevmc_1_1MockedAccount.html#a64a8f040cd7b78735187473f403f8a69", null ], + [ "transient_storage", "structevmc_1_1MockedAccount.html#ac4eb3f66ba551f849248c79bb2cd7969", null ] +]; \ No newline at end of file diff --git a/structevmc_1_1MockedHost_1_1log__record-members.html b/structevmc_1_1MockedHost_1_1log__record-members.html new file mode 100644 index 000000000..acc6a0344 --- /dev/null +++ b/structevmc_1_1MockedHost_1_1log__record-members.html @@ -0,0 +1,81 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    evmc::MockedHost::log_record Member List
    +
    +
    + +

    This is the complete list of members for evmc::MockedHost::log_record, including all inherited members.

    + + + + + +
    creatorevmc::MockedHost::log_record
    dataevmc::MockedHost::log_record
    operator==(const log_record &other) const noexceptevmc::MockedHost::log_recordinline
    topicsevmc::MockedHost::log_record
    +
    + + + + diff --git a/structevmc_1_1MockedHost_1_1log__record.html b/structevmc_1_1MockedHost_1_1log__record.html new file mode 100644 index 000000000..ca1cfdcff --- /dev/null +++ b/structevmc_1_1MockedHost_1_1log__record.html @@ -0,0 +1,202 @@ + + + + + + + +EVMC: evmc::MockedHost::log_record Struct Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    evmc::MockedHost::log_record Struct Reference
    +
    +
    + +

    LOG record. + More...

    + +

    #include <mocked_host.hpp>

    + + + + + +

    +Public Member Functions

    bool operator== (const log_record &other) const noexcept
     Equal operator.
     
    + + + + + + + + + + +

    +Public Attributes

    address creator
     The address of the account which created the log.
     
    bytes data
     The data attached to the log.
     
    std::vector< bytes32topics
     The log topics.
     
    +

    Detailed Description

    +

    LOG record.

    + +

    Definition at line 79 of file mocked_host.hpp.

    +

    Member Function Documentation

    + +

    ◆ operator==()

    + +
    +
    + + + + + +
    + + + + + + + + +
    bool evmc::MockedHost::log_record::operator== (const log_recordother) const
    +
    +inlinenoexcept
    +
    + +

    Equal operator.

    + +

    Definition at line 91 of file mocked_host.hpp.

    +
    92 {
    +
    93 return creator == other.creator && data == other.data && topics == other.topics;
    +
    94 }
    +
    address creator
    The address of the account which created the log.
    Definition: mocked_host.hpp:82
    +
    std::vector< bytes32 > topics
    The log topics.
    Definition: mocked_host.hpp:88
    +
    bytes data
    The data attached to the log.
    Definition: mocked_host.hpp:85
    +
    +
    +
    +

    Member Data Documentation

    + +

    ◆ creator

    + +
    +
    + + + + +
    address evmc::MockedHost::log_record::creator
    +
    + +

    The address of the account which created the log.

    + +

    Definition at line 82 of file mocked_host.hpp.

    + +
    +
    + +

    ◆ data

    + +
    +
    + + + + +
    bytes evmc::MockedHost::log_record::data
    +
    + +

    The data attached to the log.

    + +

    Definition at line 85 of file mocked_host.hpp.

    + +
    +
    + +

    ◆ topics

    + +
    +
    + + + + +
    std::vector<bytes32> evmc::MockedHost::log_record::topics
    +
    + +

    The log topics.

    + +

    Definition at line 88 of file mocked_host.hpp.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + diff --git a/structevmc_1_1MockedHost_1_1log__record.js b/structevmc_1_1MockedHost_1_1log__record.js new file mode 100644 index 000000000..982db5f8e --- /dev/null +++ b/structevmc_1_1MockedHost_1_1log__record.js @@ -0,0 +1,7 @@ +var structevmc_1_1MockedHost_1_1log__record = +[ + [ "operator==", "structevmc_1_1MockedHost_1_1log__record.html#ab83bb9261867dde22d6079e5ce31c334", null ], + [ "creator", "structevmc_1_1MockedHost_1_1log__record.html#a968c68ed59820fcb7d3cfc2d9f18edaa", null ], + [ "data", "structevmc_1_1MockedHost_1_1log__record.html#af14109822fc0d0cbc98da01a4474ad3d", null ], + [ "topics", "structevmc_1_1MockedHost_1_1log__record.html#ad25378459fe50c4f317aeff51ebb30c0", null ] +]; \ No newline at end of file diff --git a/structevmc_1_1StorageValue-members.html b/structevmc_1_1StorageValue-members.html new file mode 100644 index 000000000..9a2c4f4b1 --- /dev/null +++ b/structevmc_1_1StorageValue-members.html @@ -0,0 +1,83 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    evmc::StorageValue Member List
    +
    +
    + +

    This is the complete list of members for evmc::StorageValue, including all inherited members.

    + + + + + + + +
    access_statusevmc::StorageValue
    currentevmc::StorageValue
    originalevmc::StorageValue
    StorageValue() noexcept=defaultevmc::StorageValue
    StorageValue(const bytes32 &_value, evmc_access_status _access_status=EVMC_ACCESS_COLD) noexceptevmc::StorageValueinline
    StorageValue(const bytes32 &_value, const bytes32 &_original, evmc_access_status _access_status=EVMC_ACCESS_COLD) noexceptevmc::StorageValueinline
    +
    + + + + diff --git a/structevmc_1_1StorageValue.html b/structevmc_1_1StorageValue.html new file mode 100644 index 000000000..5e85d34c5 --- /dev/null +++ b/structevmc_1_1StorageValue.html @@ -0,0 +1,266 @@ + + + + + + + +EVMC: evmc::StorageValue Struct Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    evmc::StorageValue Struct Reference
    +
    +
    + +

    Extended value (with original value and access flag) for account storage. + More...

    + +

    #include <mocked_host.hpp>

    + + + + + + + + + + + +

    +Public Member Functions

    StorageValue () noexcept=default
     Default constructor.
     
     StorageValue (const bytes32 &_value, evmc_access_status _access_status=EVMC_ACCESS_COLD) noexcept
     Constructor sets the current and original to the same value. Optional access status.
     
     StorageValue (const bytes32 &_value, const bytes32 &_original, evmc_access_status _access_status=EVMC_ACCESS_COLD) noexcept
     Constructor with original value and optional access status.
     
    + + + + + + + + + + +

    +Public Attributes

    bytes32 current
     The current storage value.
     
    bytes32 original
     The original storage value.
     
    evmc_access_status access_status = EVMC_ACCESS_COLD
     Is the storage key cold or warm.
     
    +

    Detailed Description

    +

    Extended value (with original value and access flag) for account storage.

    + +

    Definition at line 16 of file mocked_host.hpp.

    +

    Constructor & Destructor Documentation

    + +

    ◆ StorageValue() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    evmc::StorageValue::StorageValue (const bytes32_value,
    evmc_access_status _access_status = EVMC_ACCESS_COLD 
    )
    +
    +inlinenoexcept
    +
    + +

    Constructor sets the current and original to the same value. Optional access status.

    + +

    Definition at line 31 of file mocked_host.hpp.

    +
    33 : current{_value}, original{_value}, access_status{_access_status}
    +
    34 {}
    +
    bytes32 original
    The original storage value.
    Definition: mocked_host.hpp:22
    +
    evmc_access_status access_status
    Is the storage key cold or warm.
    Definition: mocked_host.hpp:25
    +
    bytes32 current
    The current storage value.
    Definition: mocked_host.hpp:19
    +
    +
    +
    + +

    ◆ StorageValue() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    evmc::StorageValue::StorageValue (const bytes32_value,
    const bytes32_original,
    evmc_access_status _access_status = EVMC_ACCESS_COLD 
    )
    +
    +inlinenoexcept
    +
    + +

    Constructor with original value and optional access status.

    + +

    Definition at line 37 of file mocked_host.hpp.

    +
    40 : current{_value}, original{_original}, access_status{_access_status}
    +
    41 {}
    +
    +
    +
    +

    Member Data Documentation

    + +

    ◆ access_status

    + +
    +
    + + + + +
    evmc_access_status evmc::StorageValue::access_status = EVMC_ACCESS_COLD
    +
    + +

    Is the storage key cold or warm.

    + +

    Definition at line 25 of file mocked_host.hpp.

    + +
    +
    + +

    ◆ current

    + +
    +
    + + + + +
    bytes32 evmc::StorageValue::current
    +
    + +

    The current storage value.

    + +

    Definition at line 19 of file mocked_host.hpp.

    + +
    +
    + +

    ◆ original

    + +
    +
    + + + + +
    bytes32 evmc::StorageValue::original
    +
    + +

    The original storage value.

    + +

    Definition at line 22 of file mocked_host.hpp.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + diff --git a/structevmc_1_1StorageValue.js b/structevmc_1_1StorageValue.js new file mode 100644 index 000000000..697204f3f --- /dev/null +++ b/structevmc_1_1StorageValue.js @@ -0,0 +1,9 @@ +var structevmc_1_1StorageValue = +[ + [ "StorageValue", "structevmc_1_1StorageValue.html#a5ec327fa40ffcb164bedd3a5f107043b", null ], + [ "StorageValue", "structevmc_1_1StorageValue.html#aa3515eabce919006173cefbef511b6f6", null ], + [ "StorageValue", "structevmc_1_1StorageValue.html#a6fdbfff5abed7d6811774bb92d4afd3c", null ], + [ "access_status", "structevmc_1_1StorageValue.html#a5979ec460bbf9dd0e8bd7c197c616d8f", null ], + [ "current", "structevmc_1_1StorageValue.html#a788e7987db7350c0204f432fcc0f47e6", null ], + [ "original", "structevmc_1_1StorageValue.html#a184c770e04d62e9fe02b76a7eb63f9b6", null ] +]; \ No newline at end of file diff --git a/structevmc_1_1address-members.html b/structevmc_1_1address-members.html new file mode 100644 index 000000000..7bc17ac5c --- /dev/null +++ b/structevmc_1_1address-members.html @@ -0,0 +1,82 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    evmc::address Member List
    +
    +
    + +

    This is the complete list of members for evmc::address, including all inherited members.

    + + + + + + +
    address(evmc_address init={}) noexceptevmc::addressinline
    address(uint64_t v) noexceptevmc::addressinlineexplicit
    bytesevmc_address
    operator bool() const noexceptevmc::addressinlineexplicit
    operator bytes_view() const noexceptevmc::addressinline
    +
    + + + + diff --git a/structevmc_1_1address.html b/structevmc_1_1address.html new file mode 100644 index 000000000..778464fcc --- /dev/null +++ b/structevmc_1_1address.html @@ -0,0 +1,274 @@ + + + + + + + +EVMC: evmc::address Struct Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    evmc::address Struct Reference
    +
    +
    + +

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

    + +

    #include <evmc.hpp>

    +
    +Inheritance diagram for evmc::address:
    +
    +
    + + +evmc_address + +
    + + + + + + + + + + + + + + +

    +Public Member Functions

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

    +Additional Inherited Members

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

    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 26 of file evmc.hpp.

    +

    Constructor & Destructor Documentation

    + +

    ◆ address() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    constexpr evmc::address::address (evmc_address init = {})
    +
    +inlineconstexprnoexcept
    +
    + +

    Default and converting constructor.

    +

    Initializes bytes to zeros if not other init value provided.

    + +

    Definition at line 31 of file evmc.hpp.

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

    ◆ address() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    constexpr evmc::address::address (uint64_t v)
    +
    +inlineexplicitconstexprnoexcept
    +
    + +

    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 37 of file evmc.hpp.

    +
    38 : evmc_address{{0,
    +
    39 0,
    +
    40 0,
    +
    41 0,
    +
    42 0,
    +
    43 0,
    +
    44 0,
    +
    45 0,
    +
    46 0,
    +
    47 0,
    +
    48 0,
    +
    49 0,
    +
    50 static_cast<uint8_t>(v >> 56),
    +
    51 static_cast<uint8_t>(v >> 48),
    +
    52 static_cast<uint8_t>(v >> 40),
    +
    53 static_cast<uint8_t>(v >> 32),
    +
    54 static_cast<uint8_t>(v >> 24),
    +
    55 static_cast<uint8_t>(v >> 16),
    +
    56 static_cast<uint8_t>(v >> 8),
    +
    57 static_cast<uint8_t>(v >> 0)}}
    +
    58 {}
    +
    +
    +
    +

    Member Function Documentation

    + +

    ◆ operator bool()

    + +
    +
    + + + + + +
    + + + + + + + +
    constexpr evmc::address::operator bool () const
    +
    +inlineexplicitconstexprnoexcept
    +
    + +

    Explicit operator converting to bool.

    + +

    Definition at line 263 of file evmc.hpp.

    +
    264{
    +
    265 return !is_zero(*this);
    +
    266}
    +
    constexpr bool is_zero(const address &a) noexcept
    Checks if the given address is the zero address.
    Definition: evmc.hpp:258
    +
    +
    +
    + +

    ◆ operator bytes_view()

    + +
    +
    + + + + + +
    + + + + + + + +
    constexpr evmc::address::operator bytes_view () const
    +
    +inlineconstexprnoexcept
    +
    + +

    Implicit operator converting to bytes_view.

    + +

    Definition at line 64 of file evmc.hpp.

    +
    64{ return {bytes, sizeof(bytes)}; }
    +
    uint8_t bytes[20]
    The 20 bytes of the hash.
    Definition: evmc.h:71
    +
    +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + diff --git a/structevmc_1_1address.js b/structevmc_1_1address.js new file mode 100644 index 000000000..6516759c7 --- /dev/null +++ b/structevmc_1_1address.js @@ -0,0 +1,7 @@ +var structevmc_1_1address = +[ + [ "address", "structevmc_1_1address.html#a4efaacdd8a0de3a347b845a5b134bd47", null ], + [ "address", "structevmc_1_1address.html#aa58c7cf24b9fd2419a287e0329d75af2", null ], + [ "operator bool", "structevmc_1_1address.html#a25c8ad356e94fd5ec048a0b37e3de0b0", null ], + [ "operator bytes_view", "structevmc_1_1address.html#a42d10538dc5da2dffa028b11105b7f2b", null ] +]; \ No newline at end of file diff --git a/structevmc_1_1address.png b/structevmc_1_1address.png new file mode 100644 index 000000000..609bce96a Binary files /dev/null and b/structevmc_1_1address.png differ diff --git a/structevmc_1_1byte__traits-members.html b/structevmc_1_1byte__traits-members.html new file mode 100644 index 000000000..eca85b972 --- /dev/null +++ b/structevmc_1_1byte__traits-members.html @@ -0,0 +1,87 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    evmc::byte_traits< T > Member List
    +
    +
    + +

    This is the complete list of members for evmc::byte_traits< T >, including all inherited members.

    + + + + + + + + + + + +
    assign(char_type &c1, const char_type &c2)evmc::byte_traits< T >inlinestatic
    assign(char_type *ptr, std::size_t count, char_type value)evmc::byte_traits< T >inlinestatic
    char_type typedefevmc::byte_traits< T >
    compare(const char_type *a, const char_type *b, std::size_t count)evmc::byte_traits< T >inlinestatic
    copy(char_type *dest, const char_type *src, std::size_t count)evmc::byte_traits< T >inlinestatic
    eq(char_type a, char_type b)evmc::byte_traits< T >inlinestatic
    find(const char_type *s, std::size_t count, const char_type &value)evmc::byte_traits< T >inlinestatic
    length(const char_type *s)evmc::byte_traits< T >inlinestatic
    lt(char_type a, char_type b)evmc::byte_traits< T >inlinestatic
    move(char_type *dest, const char_type *src, std::size_t count)evmc::byte_traits< T >inlinestatic
    +
    + + + + diff --git a/structevmc_1_1byte__traits.html b/structevmc_1_1byte__traits.html new file mode 100644 index 000000000..019f5aeaa --- /dev/null +++ b/structevmc_1_1byte__traits.html @@ -0,0 +1,593 @@ + + + + + + + +EVMC: evmc::byte_traits< T > Struct Template Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    evmc::byte_traits< T > Struct Template Reference
    +
    +
    + +

    The char traits for byte-like types. + More...

    + +

    #include <bytes.hpp>

    +
    +Inheritance diagram for evmc::byte_traits< T >:
    +
    +
    + +
    + + + + + +

    +Public Types

    using char_type = T
     The byte type.
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Static Public Member Functions

    static constexpr void assign (char_type &c1, const char_type &c2)
     Assigns c2 to c1.
     
    static constexpr char_typeassign (char_type *ptr, std::size_t count, char_type value)
     Assigns value to each byte in [ptr, ptr+count).
     
    static constexpr bool eq (char_type a, char_type b)
     Returns true if bytes are equal.
     
    static constexpr bool lt (char_type a, char_type b)
     Returns true if byte a is less than byte b.
     
    static constexpr char_typemove (char_type *dest, const char_type *src, std::size_t count)
     Copies count bytes from src to dest. Performs correctly even if ranges overlap.
     
    static constexpr char_typecopy (char_type *dest, const char_type *src, std::size_t count)
     Copies count bytes from src to dest. The ranges must not overlap.
     
    static constexpr int compare (const char_type *a, const char_type *b, std::size_t count)
     Compares lexicographically the bytes in two ranges of equal length.
     
    static std::size_t length (const char_type *s)
     Returns the length of a null-terminated byte string.
     
    static constexpr const char_typefind (const char_type *s, std::size_t count, const char_type &value)
     Finds the value in the range of bytes and returns the pointer to the first occurrence or nullptr if not found.
     
    +

    Detailed Description

    +
    template<typename T>
    +struct evmc::byte_traits< T >

    The char traits for byte-like types.

    +

    See: https://en.cppreference.com/w/cpp/string/char_traits.

    + +

    Definition at line 17 of file bytes.hpp.

    +

    Member Typedef Documentation

    + +

    ◆ char_type

    + +
    +
    +
    +template<typename T >
    + + + + +
    using evmc::byte_traits< T >::char_type = T
    +
    + +

    The byte type.

    + +

    Definition at line 21 of file bytes.hpp.

    + +
    +
    +

    Member Function Documentation

    + +

    ◆ assign() [1/2]

    + +
    +
    +
    +template<typename T >
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    static constexpr void evmc::byte_traits< T >::assign (char_typec1,
    const char_typec2 
    )
    +
    +inlinestaticconstexpr
    +
    + +

    Assigns c2 to c1.

    + +

    Definition at line 24 of file bytes.hpp.

    +
    24{ c1 = c2; }
    +
    +
    +
    + +

    ◆ assign() [2/2]

    + +
    +
    +
    +template<typename T >
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    static constexpr char_type * evmc::byte_traits< T >::assign (char_typeptr,
    std::size_t count,
    char_type value 
    )
    +
    +inlinestaticconstexpr
    +
    + +

    Assigns value to each byte in [ptr, ptr+count).

    + +

    Definition at line 27 of file bytes.hpp.

    +
    28 {
    +
    29 std::fill_n(ptr, count, value);
    +
    30 return ptr;
    +
    31 }
    +
    +
    +
    + +

    ◆ compare()

    + +
    +
    +
    +template<typename T >
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    static constexpr int evmc::byte_traits< T >::compare (const char_typea,
    const char_typeb,
    std::size_t count 
    )
    +
    +inlinestaticconstexpr
    +
    + +

    Compares lexicographically the bytes in two ranges of equal length.

    + +

    Definition at line 57 of file bytes.hpp.

    +
    58 {
    +
    59 for (; count != 0; --count, ++a, ++b)
    +
    60 {
    +
    61 if (lt(*a, *b))
    +
    62 return -1;
    +
    63 if (lt(*b, *a))
    +
    64 return 1;
    +
    65 }
    +
    66 return 0;
    +
    67 }
    +
    static constexpr bool lt(char_type a, char_type b)
    Returns true if byte a is less than byte b.
    Definition: bytes.hpp:37
    +
    +
    +
    + +

    ◆ copy()

    + +
    +
    +
    +template<typename T >
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    static constexpr char_type * evmc::byte_traits< T >::copy (char_typedest,
    const char_typesrc,
    std::size_t count 
    )
    +
    +inlinestaticconstexpr
    +
    + +

    Copies count bytes from src to dest. The ranges must not overlap.

    + +

    Definition at line 50 of file bytes.hpp.

    +
    51 {
    +
    52 std::copy_n(src, count, dest);
    +
    53 return dest;
    +
    54 }
    +
    +
    +
    + +

    ◆ eq()

    + +
    +
    +
    +template<typename T >
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    static constexpr bool evmc::byte_traits< T >::eq (char_type a,
    char_type b 
    )
    +
    +inlinestaticconstexpr
    +
    + +

    Returns true if bytes are equal.

    + +

    Definition at line 34 of file bytes.hpp.

    +
    34{ return a == b; }
    +
    +
    +
    + +

    ◆ find()

    + +
    +
    +
    +template<typename T >
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    static constexpr const char_type * evmc::byte_traits< T >::find (const char_types,
    std::size_t count,
    const char_typevalue 
    )
    +
    +inlinestaticconstexpr
    +
    + +

    Finds the value in the range of bytes and returns the pointer to the first occurrence or nullptr if not found.

    + +

    Definition at line 78 of file bytes.hpp.

    +
    81 {
    +
    82 const auto end = s + count;
    +
    83 const auto p = std::find(s, end, value);
    +
    84 return p != end ? p : nullptr;
    +
    85 }
    +
    +
    +
    + +

    ◆ length()

    + +
    +
    +
    +template<typename T >
    + + + + + +
    + + + + + + + + +
    static std::size_t evmc::byte_traits< T >::length (const char_types)
    +
    +inlinestatic
    +
    + +

    Returns the length of a null-terminated byte string.

    + +

    Definition at line 71 of file bytes.hpp.

    +
    72 {
    +
    73 return std::strlen(reinterpret_cast<const char*>(s));
    +
    74 }
    +
    +
    +
    + +

    ◆ lt()

    + +
    +
    +
    +template<typename T >
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    static constexpr bool evmc::byte_traits< T >::lt (char_type a,
    char_type b 
    )
    +
    +inlinestaticconstexpr
    +
    + +

    Returns true if byte a is less than byte b.

    + +

    Definition at line 37 of file bytes.hpp.

    +
    37{ return a < b; }
    +
    +
    +
    + +

    ◆ move()

    + +
    +
    +
    +template<typename T >
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    static constexpr char_type * evmc::byte_traits< T >::move (char_typedest,
    const char_typesrc,
    std::size_t count 
    )
    +
    +inlinestaticconstexpr
    +
    + +

    Copies count bytes from src to dest. Performs correctly even if ranges overlap.

    + +

    Definition at line 40 of file bytes.hpp.

    +
    41 {
    +
    42 if (dest < src)
    +
    43 std::copy_n(src, count, dest);
    +
    44 else if (src < dest)
    +
    45 std::copy_backward(src, src + count, dest + count);
    +
    46 return dest;
    +
    47 }
    +
    +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + diff --git a/structevmc_1_1byte__traits.js b/structevmc_1_1byte__traits.js new file mode 100644 index 000000000..600352c89 --- /dev/null +++ b/structevmc_1_1byte__traits.js @@ -0,0 +1,13 @@ +var structevmc_1_1byte__traits = +[ + [ "char_type", "structevmc_1_1byte__traits.html#aea3697899bef79a5c3289026c0ceecd0", null ], + [ "assign", "structevmc_1_1byte__traits.html#a2ca10f3e986b549a04991e18778eceeb", null ], + [ "assign", "structevmc_1_1byte__traits.html#afbddc66d27972118158ea5b865278b10", null ], + [ "compare", "structevmc_1_1byte__traits.html#aa4f4e54bd2575ccfc39036147e50a616", null ], + [ "copy", "structevmc_1_1byte__traits.html#a6efd4178361fd1411dfc15fe80d49ea2", null ], + [ "eq", "structevmc_1_1byte__traits.html#a874b746d0e9f63adf5a84db7284678dd", null ], + [ "find", "structevmc_1_1byte__traits.html#aa74db0e923ece6f00a9f275fae1189f7", null ], + [ "length", "structevmc_1_1byte__traits.html#a84eb9d5a6cfa3c981f09706b0c44d43d", null ], + [ "lt", "structevmc_1_1byte__traits.html#ad3501ed50531d79a1c93433e0b707c5b", null ], + [ "move", "structevmc_1_1byte__traits.html#a9d7ce6b833a14110ef17c36f7cb81b50", null ] +]; \ No newline at end of file diff --git a/structevmc_1_1byte__traits.png b/structevmc_1_1byte__traits.png new file mode 100644 index 000000000..eca3dc2db Binary files /dev/null and b/structevmc_1_1byte__traits.png differ diff --git a/structevmc_1_1bytes32-members.html b/structevmc_1_1bytes32-members.html new file mode 100644 index 000000000..8c61588ba --- /dev/null +++ b/structevmc_1_1bytes32-members.html @@ -0,0 +1,82 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    evmc::bytes32 Member List
    +
    +
    + +

    This is the complete list of members for evmc::bytes32, including all inherited members.

    + + + + + + +
    bytesevmc_bytes32
    bytes32(evmc_bytes32 init={}) noexceptevmc::bytes32inline
    bytes32(uint64_t v) noexceptevmc::bytes32inlineexplicit
    operator bool() const noexceptevmc::bytes32inlineexplicit
    operator bytes_view() const noexceptevmc::bytes32inline
    +
    + + + + diff --git a/structevmc_1_1bytes32.html b/structevmc_1_1bytes32.html new file mode 100644 index 000000000..248061bbd --- /dev/null +++ b/structevmc_1_1bytes32.html @@ -0,0 +1,286 @@ + + + + + + + +EVMC: evmc::bytes32 Struct Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    evmc::bytes32 Struct Reference
    +
    +
    + +

    The fixed size array of 32 bytes for storing 256-bit EVM values. + More...

    + +

    #include <evmc.hpp>

    +
    +Inheritance diagram for evmc::bytes32:
    +
    +
    + + +evmc_bytes32 + +
    + + + + + + + + + + + + + + +

    +Public Member Functions

    constexpr bytes32 (evmc_bytes32 init={}) noexcept
     Default and converting constructor.
     
    constexpr bytes32 (uint64_t v) noexcept
     Converting constructor from unsigned integer value.
     
    constexpr operator bool () const noexcept
     Explicit operator converting to bool.
     
    constexpr operator bytes_view () const noexcept
     Implicit operator converting to bytes_view.
     
    + + + + + +

    +Additional Inherited Members

    - Public Attributes inherited from evmc_bytes32
    uint8_t bytes [32]
     The 32 bytes.
     
    +

    Detailed Description

    +

    The fixed size array of 32 bytes for storing 256-bit EVM values.

    +

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

    + +

    Definition at line 70 of file evmc.hpp.

    +

    Constructor & Destructor Documentation

    + +

    ◆ bytes32() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    constexpr evmc::bytes32::bytes32 (evmc_bytes32 init = {})
    +
    +inlineconstexprnoexcept
    +
    + +

    Default and converting constructor.

    +

    Initializes bytes to zeros if not other init value provided.

    + +

    Definition at line 75 of file evmc.hpp.

    +
    75{}) noexcept : evmc_bytes32{init} {}
    +
    The fixed size array of 32 bytes.
    Definition: evmc.h:57
    +
    +
    +
    + +

    ◆ bytes32() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    constexpr evmc::bytes32::bytes32 (uint64_t v)
    +
    +inlineexplicitconstexprnoexcept
    +
    + +

    Converting constructor from unsigned integer value.

    +

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

    + +

    Definition at line 81 of file evmc.hpp.

    +
    82 : evmc_bytes32{{0,
    +
    83 0,
    +
    84 0,
    +
    85 0,
    +
    86 0,
    +
    87 0,
    +
    88 0,
    +
    89 0,
    +
    90 0,
    +
    91 0,
    +
    92 0,
    +
    93 0,
    +
    94 0,
    +
    95 0,
    +
    96 0,
    +
    97 0,
    +
    98 0,
    +
    99 0,
    +
    100 0,
    +
    101 0,
    +
    102 0,
    +
    103 0,
    +
    104 0,
    +
    105 0,
    +
    106 static_cast<uint8_t>(v >> 56),
    +
    107 static_cast<uint8_t>(v >> 48),
    +
    108 static_cast<uint8_t>(v >> 40),
    +
    109 static_cast<uint8_t>(v >> 32),
    +
    110 static_cast<uint8_t>(v >> 24),
    +
    111 static_cast<uint8_t>(v >> 16),
    +
    112 static_cast<uint8_t>(v >> 8),
    +
    113 static_cast<uint8_t>(v >> 0)}}
    +
    114 {}
    +
    +
    +
    +

    Member Function Documentation

    + +

    ◆ operator bool()

    + +
    +
    + + + + + +
    + + + + + + + +
    constexpr evmc::bytes32::operator bool () const
    +
    +inlineexplicitconstexprnoexcept
    +
    + +

    Explicit operator converting to bool.

    + +

    Definition at line 274 of file evmc.hpp.

    +
    275{
    +
    276 return !is_zero(*this);
    +
    277}
    +
    constexpr bool is_zero(const address &a) noexcept
    Checks if the given address is the zero address.
    Definition: evmc.hpp:258
    +
    +
    +
    + +

    ◆ operator bytes_view()

    + +
    +
    + + + + + +
    + + + + + + + +
    constexpr evmc::bytes32::operator bytes_view () const
    +
    +inlineconstexprnoexcept
    +
    + +

    Implicit operator converting to bytes_view.

    + +

    Definition at line 120 of file evmc.hpp.

    +
    120{ return {bytes, sizeof(bytes)}; }
    +
    uint8_t bytes[32]
    The 32 bytes.
    Definition: evmc.h:59
    +
    +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + diff --git a/structevmc_1_1bytes32.js b/structevmc_1_1bytes32.js new file mode 100644 index 000000000..5886ea28b --- /dev/null +++ b/structevmc_1_1bytes32.js @@ -0,0 +1,7 @@ +var structevmc_1_1bytes32 = +[ + [ "bytes32", "structevmc_1_1bytes32.html#a6403d03e29edb4f87fb272cdbde1cdc6", null ], + [ "bytes32", "structevmc_1_1bytes32.html#acf31b9ad2a8140d04eddc560fccf005b", null ], + [ "operator bool", "structevmc_1_1bytes32.html#a3b9c7873f62eec5ba22de9cdcf90587e", null ], + [ "operator bytes_view", "structevmc_1_1bytes32.html#ad70922f3af462e61ff15bd8bedba746e", null ] +]; \ No newline at end of file diff --git a/structevmc_1_1bytes32.png b/structevmc_1_1bytes32.png new file mode 100644 index 000000000..95f918cc0 Binary files /dev/null and b/structevmc_1_1bytes32.png differ diff --git a/structevmc_1_1filter__iterator-members.html b/structevmc_1_1filter__iterator-members.html new file mode 100644 index 000000000..c5df6b66d --- /dev/null +++ b/structevmc_1_1filter__iterator-members.html @@ -0,0 +1,87 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + + + + + + diff --git a/structevmc_1_1filter__iterator.html b/structevmc_1_1filter__iterator.html new file mode 100644 index 000000000..4a4792ccd --- /dev/null +++ b/structevmc_1_1filter__iterator.html @@ -0,0 +1,417 @@ + + + + + + + +EVMC: evmc::filter_iterator< BaseIterator, noexcept > Struct Template Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    evmc::filter_iterator< BaseIterator, noexcept > Struct Template Reference
    +
    +
    + +

    The filter iterator adaptor creates a view of an iterator range in which some elements of the range are skipped. + More...

    + +

    #include <filter_iterator.hpp>

    + + + + + + + + + + + + + + + + + +

    +Public Types

    using difference_type = typename std::iterator_traits< BaseIterator >::difference_type
     The iterator difference type.
     
    using value_type = typename std::iterator_traits< BaseIterator >::value_type
     The iterator value type.
     
    using pointer = typename std::iterator_traits< BaseIterator >::pointer
     The iterator pointer type.
     
    using reference = typename std::iterator_traits< BaseIterator >::reference
     The iterator reference type.
     
    using iterator_category = std::input_iterator_tag
     The iterator category.
     
    + + + + + + + + + + + + + + + + +

    +Public Member Functions

    constexpr filter_iterator (BaseIterator it, BaseIterator end) noexcept
     The constructor of the base iterator pair.
     
    constexpr auto operator* () noexcept
     The dereference operator.
     
    constexpr void operator++ () noexcept
     The increment operator.
     
    constexpr bool operator== (const filter_iterator &o) const noexcept
     The equality operator.
     
    constexpr bool operator!= (const filter_iterator &o) const noexcept
     The inequality operator.
     
    +

    Detailed Description

    +
    template<typename BaseIterator, bool predicate(typename std::iterator_traits< BaseIterator >::value_type) noexcept>
    +struct evmc::filter_iterator< BaseIterator, noexcept >

    The filter iterator adaptor creates a view of an iterator range in which some elements of the range are skipped.

    +

    A predicate function controls which elements are skipped. When the predicate is applied to an element, if it returns true then the element is retained and if it returns false then the element is skipped over. When skipping over elements, it is necessary for the filter adaptor to know when to stop so as to avoid going past the end of the underlying range. A filter iterator is therefore constructed with pair of iterators indicating the range of elements in the unfiltered sequence to be traversed.

    +

    Similar to boost::filter_iterator.

    + +

    Definition at line 34 of file filter_iterator.hpp.

    +

    Member Typedef Documentation

    + +

    ◆ difference_type

    + +
    +
    +
    +template<typename BaseIterator , bool predicate(typename std::iterator_traits< BaseIterator >::value_type) noexcept>
    + + + + +
    using evmc::filter_iterator< BaseIterator, noexcept >::difference_type = typename std::iterator_traits<BaseIterator>::difference_type
    +
    + +

    The iterator difference type.

    + +

    Definition at line 37 of file filter_iterator.hpp.

    + +
    +
    + +

    ◆ iterator_category

    + +
    +
    +
    +template<typename BaseIterator , bool predicate(typename std::iterator_traits< BaseIterator >::value_type) noexcept>
    + + + + +
    using evmc::filter_iterator< BaseIterator, noexcept >::iterator_category = std::input_iterator_tag
    +
    + +

    The iterator category.

    + +

    Definition at line 49 of file filter_iterator.hpp.

    + +
    +
    + +

    ◆ pointer

    + +
    +
    +
    +template<typename BaseIterator , bool predicate(typename std::iterator_traits< BaseIterator >::value_type) noexcept>
    + + + + +
    using evmc::filter_iterator< BaseIterator, noexcept >::pointer = typename std::iterator_traits<BaseIterator>::pointer
    +
    + +

    The iterator pointer type.

    + +

    Definition at line 43 of file filter_iterator.hpp.

    + +
    +
    + +

    ◆ reference

    + +
    +
    +
    +template<typename BaseIterator , bool predicate(typename std::iterator_traits< BaseIterator >::value_type) noexcept>
    + + + + +
    using evmc::filter_iterator< BaseIterator, noexcept >::reference = typename std::iterator_traits<BaseIterator>::reference
    +
    + +

    The iterator reference type.

    + +

    Definition at line 46 of file filter_iterator.hpp.

    + +
    +
    + +

    ◆ value_type

    + +
    +
    +
    +template<typename BaseIterator , bool predicate(typename std::iterator_traits< BaseIterator >::value_type) noexcept>
    + + + + +
    using evmc::filter_iterator< BaseIterator, noexcept >::value_type = typename std::iterator_traits<BaseIterator>::value_type
    +
    + +

    The iterator value type.

    + +

    Definition at line 40 of file filter_iterator.hpp.

    + +
    +
    +

    Constructor & Destructor Documentation

    + +

    ◆ filter_iterator()

    + +
    +
    +
    +template<typename BaseIterator , bool predicate(typename std::iterator_traits< BaseIterator >::value_type) noexcept>
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    constexpr evmc::filter_iterator< BaseIterator, noexcept >::filter_iterator (BaseIterator it,
    BaseIterator end 
    )
    +
    +inlineconstexprnoexcept
    +
    + +

    The constructor of the base iterator pair.

    + +

    Definition at line 68 of file filter_iterator.hpp.

    +
    68 : base{it}, base_end{end}
    +
    69 {
    +
    70 forward_to_next_value();
    +
    71 }
    +
    +
    +
    +

    Member Function Documentation

    + +

    ◆ operator!=()

    + +
    +
    +
    +template<typename BaseIterator , bool predicate(typename std::iterator_traits< BaseIterator >::value_type) noexcept>
    + + + + + +
    + + + + + + + + +
    constexpr bool evmc::filter_iterator< BaseIterator, noexcept >::operator!= (const filter_iterator< BaseIterator, noexcept > & o) const
    +
    +inlineconstexprnoexcept
    +
    + +

    The inequality operator.

    + +

    Definition at line 92 of file filter_iterator.hpp.

    +
    92{ return base != o.base; }
    +
    +
    +
    + +

    ◆ operator*()

    + +
    +
    +
    +template<typename BaseIterator , bool predicate(typename std::iterator_traits< BaseIterator >::value_type) noexcept>
    + + + + + +
    + + + + + + + +
    constexpr auto evmc::filter_iterator< BaseIterator, noexcept >::operator* ()
    +
    +inlineconstexprnoexcept
    +
    + +

    The dereference operator.

    + +

    Definition at line 74 of file filter_iterator.hpp.

    +
    75 {
    +
    76 // We should not read from an input base iterator twice. So the only read is in
    +
    77 // forward_to_next_value() and here we return the cached value.
    +
    78 return value;
    +
    79 }
    +
    +
    +
    + +

    ◆ operator++()

    + +
    +
    +
    +template<typename BaseIterator , bool predicate(typename std::iterator_traits< BaseIterator >::value_type) noexcept>
    + + + + + +
    + + + + + + + +
    constexpr void evmc::filter_iterator< BaseIterator, noexcept >::operator++ ()
    +
    +inlineconstexprnoexcept
    +
    + +

    The increment operator.

    + +

    Definition at line 82 of file filter_iterator.hpp.

    +
    83 {
    +
    84 ++base;
    +
    85 forward_to_next_value();
    +
    86 }
    +
    +
    +
    + +

    ◆ operator==()

    + +
    +
    +
    +template<typename BaseIterator , bool predicate(typename std::iterator_traits< BaseIterator >::value_type) noexcept>
    + + + + + +
    + + + + + + + + +
    constexpr bool evmc::filter_iterator< BaseIterator, noexcept >::operator== (const filter_iterator< BaseIterator, noexcept > & o) const
    +
    +inlineconstexprnoexcept
    +
    + +

    The equality operator.

    + +

    Definition at line 89 of file filter_iterator.hpp.

    +
    89{ return base == o.base; }
    +
    +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + diff --git a/structevmc_1_1filter__iterator.js b/structevmc_1_1filter__iterator.js new file mode 100644 index 000000000..c285086a5 --- /dev/null +++ b/structevmc_1_1filter__iterator.js @@ -0,0 +1,13 @@ +var structevmc_1_1filter__iterator = +[ + [ "difference_type", "structevmc_1_1filter__iterator.html#a520cd35a4a729fe6b0c2fd6942c00543", null ], + [ "iterator_category", "structevmc_1_1filter__iterator.html#ac619591ca250c144a5955722aa4cc5db", null ], + [ "pointer", "structevmc_1_1filter__iterator.html#a68edaff4f7a46bf7ec7804557c43fa8f", null ], + [ "reference", "structevmc_1_1filter__iterator.html#a4b992638fffe34bafe7a8a76a54f1d0d", null ], + [ "value_type", "structevmc_1_1filter__iterator.html#a5d861a64bd957fa7cb798712fcf65069", null ], + [ "filter_iterator", "structevmc_1_1filter__iterator.html#ab9da5fa889d5cc306a4567ecb33c2274", null ], + [ "operator!=", "structevmc_1_1filter__iterator.html#a36ea31ae857430b2b91bee4060cb5e9e", null ], + [ "operator*", "structevmc_1_1filter__iterator.html#a9fbc4aff58e3e6936a221a8791c4723a", null ], + [ "operator++", "structevmc_1_1filter__iterator.html#a2822ced67ab6ccd5dfea8bb71748604d", null ], + [ "operator==", "structevmc_1_1filter__iterator.html#af632f76d0453d8a234563127dce70963", null ] +]; \ No newline at end of file diff --git a/structevmc_1_1skip__space__iterator-members.html b/structevmc_1_1skip__space__iterator-members.html new file mode 100644 index 000000000..342ba0eaf --- /dev/null +++ b/structevmc_1_1skip__space__iterator-members.html @@ -0,0 +1,87 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + + + + + + diff --git a/structevmc_1_1skip__space__iterator.html b/structevmc_1_1skip__space__iterator.html new file mode 100644 index 000000000..bff69d3b9 --- /dev/null +++ b/structevmc_1_1skip__space__iterator.html @@ -0,0 +1,135 @@ + + + + + + + +EVMC: evmc::skip_space_iterator< BaseIterator > Struct Template Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    evmc::skip_space_iterator< BaseIterator > Struct Template Reference
    +
    +
    + +

    The input filter iterator which skips whitespace characters from the base input iterator. + More...

    + +

    #include <filter_iterator.hpp>

    +
    +Inheritance diagram for evmc::skip_space_iterator< BaseIterator >:
    +
    +
    + + +evmc::filter_iterator< BaseIterator, is_not_space > + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Additional Inherited Members

    - Public Types inherited from evmc::filter_iterator< BaseIterator, is_not_space >
    using difference_type = typename std::iterator_traits< BaseIterator >::difference_type
     The iterator difference type.
     
    using value_type = typename std::iterator_traits< BaseIterator >::value_type
     The iterator value type.
     
    using pointer = typename std::iterator_traits< BaseIterator >::pointer
     The iterator pointer type.
     
    using reference = typename std::iterator_traits< BaseIterator >::reference
     The iterator reference type.
     
    using iterator_category = std::input_iterator_tag
     The iterator category.
     
    - Public Member Functions inherited from evmc::filter_iterator< BaseIterator, is_not_space >
    constexpr filter_iterator (BaseIterator it, BaseIterator end) noexcept
     The constructor of the base iterator pair.
     
    constexpr auto operator* () noexcept
     The dereference operator.
     
    constexpr void operator++ () noexcept
     The increment operator.
     
    constexpr bool operator== (const filter_iterator &o) const noexcept
     The equality operator.
     
    constexpr bool operator!= (const filter_iterator &o) const noexcept
     The inequality operator.
     
    +

    Detailed Description

    +
    template<typename BaseIterator>
    +struct evmc::skip_space_iterator< BaseIterator >

    The input filter iterator which skips whitespace characters from the base input iterator.

    + +

    Definition at line 97 of file filter_iterator.hpp.

    +

    The documentation for this struct was generated from the following file: +
    +
    + + + + diff --git a/structevmc_1_1skip__space__iterator.png b/structevmc_1_1skip__space__iterator.png new file mode 100644 index 000000000..861393e08 Binary files /dev/null and b/structevmc_1_1skip__space__iterator.png differ diff --git a/structevmc__address-members.html b/structevmc__address-members.html new file mode 100644 index 000000000..0439befc0 --- /dev/null +++ b/structevmc__address-members.html @@ -0,0 +1,78 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    evmc_address Member List
    +
    +
    + +

    This is the complete list of members for evmc_address, including all inherited members.

    + + +
    bytesevmc_address
    +
    + + + + diff --git a/structevmc__address.html b/structevmc__address.html new file mode 100644 index 000000000..f215328b1 --- /dev/null +++ b/structevmc__address.html @@ -0,0 +1,125 @@ + + + + + + + +EVMC: evmc_address Struct Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    evmc_address Struct Reference
    +
    +
    + +

    Big-endian 160-bit hash suitable for keeping an Ethereum address. + More...

    + +

    #include <evmc.h>

    +
    +Inheritance diagram for evmc_address:
    +
    +
    + + +evmc::address + +
    + + + + + +

    +Public Attributes

    uint8_t bytes [20]
     The 20 bytes of the hash.
     
    +

    Detailed Description

    +

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

    + +

    Definition at line 68 of file evmc.h.

    +

    Member Data Documentation

    + +

    ◆ bytes

    + +
    +
    + + + + +
    uint8_t evmc_address::bytes[20]
    +
    + +

    The 20 bytes of the hash.

    + +

    Definition at line 71 of file evmc.h.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + diff --git a/structevmc__address.js b/structevmc__address.js new file mode 100644 index 000000000..ff0ab12e5 --- /dev/null +++ b/structevmc__address.js @@ -0,0 +1,4 @@ +var structevmc__address = +[ + [ "bytes", "structevmc__address.html#ab43a790ce0efb282b7ed7eafff8ed614", null ] +]; \ No newline at end of file diff --git a/structevmc__address.png b/structevmc__address.png new file mode 100644 index 000000000..4e4d0e51f Binary files /dev/null and b/structevmc__address.png differ diff --git a/structevmc__bytes32-members.html b/structevmc__bytes32-members.html new file mode 100644 index 000000000..531ec04d1 --- /dev/null +++ b/structevmc__bytes32-members.html @@ -0,0 +1,78 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    evmc_bytes32 Member List
    +
    +
    + +

    This is the complete list of members for evmc_bytes32, including all inherited members.

    + + +
    bytesevmc_bytes32
    +
    + + + + diff --git a/structevmc__bytes32.html b/structevmc__bytes32.html new file mode 100644 index 000000000..ad0109b71 --- /dev/null +++ b/structevmc__bytes32.html @@ -0,0 +1,126 @@ + + + + + + + +EVMC: evmc_bytes32 Struct Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    evmc_bytes32 Struct Reference
    +
    +
    + +

    The fixed size array of 32 bytes. + More...

    + +

    #include <evmc.h>

    +
    +Inheritance diagram for evmc_bytes32:
    +
    +
    + + +evmc::bytes32 + +
    + + + + + +

    +Public Attributes

    uint8_t bytes [32]
     The 32 bytes.
     
    +

    Detailed Description

    +

    The fixed size array of 32 bytes.

    +

    32 bytes of data capable of storing e.g. 256-bit hashes.

    + +

    Definition at line 56 of file evmc.h.

    +

    Member Data Documentation

    + +

    ◆ bytes

    + +
    +
    + + + + +
    uint8_t evmc_bytes32::bytes[32]
    +
    + +

    The 32 bytes.

    + +

    Definition at line 59 of file evmc.h.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + diff --git a/structevmc__bytes32.js b/structevmc__bytes32.js new file mode 100644 index 000000000..6edd84f5e --- /dev/null +++ b/structevmc__bytes32.js @@ -0,0 +1,4 @@ +var structevmc__bytes32 = +[ + [ "bytes", "structevmc__bytes32.html#a695eaf3c428daee54ce15c8252edc133", null ] +]; \ No newline at end of file diff --git a/structevmc__bytes32.png b/structevmc__bytes32.png new file mode 100644 index 000000000..0dd4cdab2 Binary files /dev/null and b/structevmc__bytes32.png differ diff --git a/structevmc__host__context.html b/structevmc__host__context.html new file mode 100644 index 000000000..7ff2ad742 --- /dev/null +++ b/structevmc__host__context.html @@ -0,0 +1,86 @@ + + + + + + + +EVMC: evmc_host_context Struct Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    evmc_host_context Struct Reference
    +
    +
    + +

    The opaque data type representing the Host execution context. + More...

    + +

    #include <evmc.h>

    +

    Detailed Description

    +

    The opaque data type representing the Host execution context.

    +
    See also
    evmc_execute_fn().
    +

    The documentation for this struct was generated from the following file: +
    +
    + + + + diff --git a/structevmc__host__interface-members.html b/structevmc__host__interface-members.html new file mode 100644 index 000000000..24f12d944 --- /dev/null +++ b/structevmc__host__interface-members.html @@ -0,0 +1,93 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + + + + + + diff --git a/structevmc__host__interface.html b/structevmc__host__interface.html new file mode 100644 index 000000000..c5f7329c9 --- /dev/null +++ b/structevmc__host__interface.html @@ -0,0 +1,432 @@ + + + + + + + +EVMC: evmc_host_interface Struct Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    evmc_host_interface Struct Reference
    +
    +
    + +

    The Host interface. + More...

    + +

    #include <evmc.h>

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Public Attributes

    evmc_account_exists_fn account_exists
     Check account existence callback function.
     
    evmc_get_storage_fn get_storage
     Get storage callback function.
     
    evmc_set_storage_fn set_storage
     Set storage callback function.
     
    evmc_get_balance_fn get_balance
     Get balance callback function.
     
    evmc_get_code_size_fn get_code_size
     Get code size callback function.
     
    evmc_get_code_hash_fn get_code_hash
     Get code hash callback function.
     
    evmc_copy_code_fn copy_code
     Copy code callback function.
     
    evmc_selfdestruct_fn selfdestruct
     Selfdestruct callback function.
     
    evmc_call_fn call
     Call callback function.
     
    evmc_get_tx_context_fn get_tx_context
     Get transaction context callback function.
     
    evmc_get_block_hash_fn get_block_hash
     Get block hash callback function.
     
    evmc_emit_log_fn emit_log
     Emit log callback function.
     
    evmc_access_account_fn access_account
     Access account callback function.
     
    evmc_access_storage_fn access_storage
     Access storage callback function.
     
    evmc_get_transient_storage_fn get_transient_storage
     Get transient storage callback function.
     
    evmc_set_transient_storage_fn set_transient_storage
     Set transient storage callback function.
     
    +

    Detailed Description

    +

    The Host interface.

    +

    The set of all callback functions expected by VM instances. This is C realisation of vtable for OOP interface (only virtual methods, no data). Host implementations SHOULD create constant singletons of this (similarly to vtables) to lower the maintenance and memory management cost.

    + +

    Definition at line 844 of file evmc.h.

    +

    Member Data Documentation

    + +

    ◆ access_account

    + +
    +
    + + + + +
    evmc_access_account_fn evmc_host_interface::access_account
    +
    + +

    Access account callback function.

    + +

    Definition at line 883 of file evmc.h.

    + +
    +
    + +

    ◆ access_storage

    + +
    +
    + + + + +
    evmc_access_storage_fn evmc_host_interface::access_storage
    +
    + +

    Access storage callback function.

    + +

    Definition at line 886 of file evmc.h.

    + +
    +
    + +

    ◆ account_exists

    + +
    +
    + + + + +
    evmc_account_exists_fn evmc_host_interface::account_exists
    +
    + +

    Check account existence callback function.

    + +

    Definition at line 847 of file evmc.h.

    + +
    +
    + +

    ◆ call

    + +
    +
    + + + + +
    evmc_call_fn evmc_host_interface::call
    +
    + +

    Call callback function.

    + +

    Definition at line 871 of file evmc.h.

    + +
    +
    + +

    ◆ copy_code

    + +
    +
    + + + + +
    evmc_copy_code_fn evmc_host_interface::copy_code
    +
    + +

    Copy code callback function.

    + +

    Definition at line 865 of file evmc.h.

    + +
    +
    + +

    ◆ emit_log

    + +
    +
    + + + + +
    evmc_emit_log_fn evmc_host_interface::emit_log
    +
    + +

    Emit log callback function.

    + +

    Definition at line 880 of file evmc.h.

    + +
    +
    + +

    ◆ get_balance

    + +
    +
    + + + + +
    evmc_get_balance_fn evmc_host_interface::get_balance
    +
    + +

    Get balance callback function.

    + +

    Definition at line 856 of file evmc.h.

    + +
    +
    + +

    ◆ get_block_hash

    + +
    +
    + + + + +
    evmc_get_block_hash_fn evmc_host_interface::get_block_hash
    +
    + +

    Get block hash callback function.

    + +

    Definition at line 877 of file evmc.h.

    + +
    +
    + +

    ◆ get_code_hash

    + +
    +
    + + + + +
    evmc_get_code_hash_fn evmc_host_interface::get_code_hash
    +
    + +

    Get code hash callback function.

    + +

    Definition at line 862 of file evmc.h.

    + +
    +
    + +

    ◆ get_code_size

    + +
    +
    + + + + +
    evmc_get_code_size_fn evmc_host_interface::get_code_size
    +
    + +

    Get code size callback function.

    + +

    Definition at line 859 of file evmc.h.

    + +
    +
    + +

    ◆ get_storage

    + +
    +
    + + + + +
    evmc_get_storage_fn evmc_host_interface::get_storage
    +
    + +

    Get storage callback function.

    + +

    Definition at line 850 of file evmc.h.

    + +
    +
    + +

    ◆ get_transient_storage

    + +
    +
    + + + + +
    evmc_get_transient_storage_fn evmc_host_interface::get_transient_storage
    +
    + +

    Get transient storage callback function.

    + +

    Definition at line 889 of file evmc.h.

    + +
    +
    + +

    ◆ get_tx_context

    + +
    +
    + + + + +
    evmc_get_tx_context_fn evmc_host_interface::get_tx_context
    +
    + +

    Get transaction context callback function.

    + +

    Definition at line 874 of file evmc.h.

    + +
    +
    + +

    ◆ selfdestruct

    + +
    +
    + + + + +
    evmc_selfdestruct_fn evmc_host_interface::selfdestruct
    +
    + +

    Selfdestruct callback function.

    + +

    Definition at line 868 of file evmc.h.

    + +
    +
    + +

    ◆ set_storage

    + +
    +
    + + + + +
    evmc_set_storage_fn evmc_host_interface::set_storage
    +
    + +

    Set storage callback function.

    + +

    Definition at line 853 of file evmc.h.

    + +
    +
    + +

    ◆ set_transient_storage

    + +
    +
    + + + + +
    evmc_set_transient_storage_fn evmc_host_interface::set_transient_storage
    +
    + +

    Set transient storage callback function.

    + +

    Definition at line 892 of file evmc.h.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + diff --git a/structevmc__host__interface.js b/structevmc__host__interface.js new file mode 100644 index 000000000..28432eaed --- /dev/null +++ b/structevmc__host__interface.js @@ -0,0 +1,19 @@ +var structevmc__host__interface = +[ + [ "access_account", "structevmc__host__interface.html#ac5e64cdd3216485a1e20e1f039e5c33a", null ], + [ "access_storage", "structevmc__host__interface.html#afd574060cfe3eebacbd2c3637e9a60d0", null ], + [ "account_exists", "structevmc__host__interface.html#ac3b71b9670621dd55e8bc047cd289e1a", null ], + [ "call", "structevmc__host__interface.html#a0acd6def9c08159acccfba9f9cbf9ca9", null ], + [ "copy_code", "structevmc__host__interface.html#a21b53f1aea01f97eeb29ff5d3b5910ea", null ], + [ "emit_log", "structevmc__host__interface.html#aaa3feda20b9b50381a359b2d4f591f0c", null ], + [ "get_balance", "structevmc__host__interface.html#acfb80d38a19c3c5a267a68520dae8020", null ], + [ "get_block_hash", "structevmc__host__interface.html#a9cdde67ef20f42f60d3b8949230e8852", null ], + [ "get_code_hash", "structevmc__host__interface.html#a058d2f129c4f4e840258127137801eaf", null ], + [ "get_code_size", "structevmc__host__interface.html#a35897228fa9270f59b7fca4bc373e860", null ], + [ "get_storage", "structevmc__host__interface.html#a1cfd339e26ceaba522aece2e1a06c6ef", null ], + [ "get_transient_storage", "structevmc__host__interface.html#a37136d6a49f044a6b3d5c3365bb092fa", null ], + [ "get_tx_context", "structevmc__host__interface.html#aecdea81d0643b6988e2dc6f57c936ffe", null ], + [ "selfdestruct", "structevmc__host__interface.html#a189b040cb7db22778e81d4eb19e87849", null ], + [ "set_storage", "structevmc__host__interface.html#ad24670503f09df720cc008e361a91277", null ], + [ "set_transient_storage", "structevmc__host__interface.html#a478e25757f277870c23e96cc5a4bee9a", null ] +]; \ No newline at end of file diff --git a/structevmc__instruction__metrics-members.html b/structevmc__instruction__metrics-members.html new file mode 100644 index 000000000..dfcec6212 --- /dev/null +++ b/structevmc__instruction__metrics-members.html @@ -0,0 +1,80 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    evmc_instruction_metrics Member List
    +
    + +
    + + + + diff --git a/structevmc__instruction__metrics.html b/structevmc__instruction__metrics.html new file mode 100644 index 000000000..ff80d5562 --- /dev/null +++ b/structevmc__instruction__metrics.html @@ -0,0 +1,160 @@ + + + + + + + +EVMC: evmc_instruction_metrics Struct Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    evmc_instruction_metrics Struct Reference
    +
    +
    + +

    Metrics for an EVM 1 instruction. + More...

    + +

    #include <instructions.h>

    + + + + + + + + + + + +

    +Public Attributes

    int16_t gas_cost
     The instruction gas cost.
     
    int8_t stack_height_required
     The minimum number of the EVM stack items required for the instruction.
     
    int8_t stack_height_change
     The EVM stack height change caused by the instruction execution, i.e.
     
    +

    Detailed Description

    +

    Metrics for an EVM 1 instruction.

    +

    Small integer types are used here to make the tables of metrics smaller.

    + +

    Definition at line 187 of file instructions.h.

    +

    Member Data Documentation

    + +

    ◆ gas_cost

    + +
    +
    + + + + +
    int16_t evmc_instruction_metrics::gas_cost
    +
    + +

    The instruction gas cost.

    + +

    Definition at line 190 of file instructions.h.

    + +
    +
    + +

    ◆ stack_height_change

    + +
    +
    + + + + +
    int8_t evmc_instruction_metrics::stack_height_change
    +
    + +

    The EVM stack height change caused by the instruction execution, i.e.

    +

    stack height after execution - stack height before execution.

    + +

    Definition at line 199 of file instructions.h.

    + +
    +
    + +

    ◆ stack_height_required

    + +
    +
    + + + + +
    int8_t evmc_instruction_metrics::stack_height_required
    +
    + +

    The minimum number of the EVM stack items required for the instruction.

    + +

    Definition at line 193 of file instructions.h.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + diff --git a/structevmc__instruction__metrics.js b/structevmc__instruction__metrics.js new file mode 100644 index 000000000..4c8f5ffc8 --- /dev/null +++ b/structevmc__instruction__metrics.js @@ -0,0 +1,6 @@ +var structevmc__instruction__metrics = +[ + [ "gas_cost", "structevmc__instruction__metrics.html#a44c39286accf5bf74d10e7491ed5b8dd", null ], + [ "stack_height_change", "structevmc__instruction__metrics.html#ae721712b3eb353747203bf18d1309e0b", null ], + [ "stack_height_required", "structevmc__instruction__metrics.html#a7cfaf4a8c004d69807e5c4a2b47dad6a", null ] +]; \ No newline at end of file diff --git a/structevmc__message-members.html b/structevmc__message-members.html new file mode 100644 index 000000000..2465cdbe2 --- /dev/null +++ b/structevmc__message-members.html @@ -0,0 +1,90 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + + + + + + diff --git a/structevmc__message.html b/structevmc__message.html new file mode 100644 index 000000000..772263b2c --- /dev/null +++ b/structevmc__message.html @@ -0,0 +1,383 @@ + + + + + + + +EVMC: evmc_message Struct Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    evmc_message Struct Reference
    +
    +
    + +

    The message describing an EVM call, including a zero-depth calls from a transaction origin. + More...

    + +

    #include <evmc.h>

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Public Attributes

    enum evmc_call_kind kind
     The kind of the call.
     
    uint32_t flags
     Additional flags modifying the call execution behavior.
     
    int32_t depth
     The present depth of the message call stack.
     
    int64_t gas
     The amount of gas available to the message execution.
     
    evmc_address recipient
     The recipient of the message.
     
    evmc_address sender
     The sender of the message.
     
    const uint8_t * input_data
     The message input data.
     
    size_t input_size
     The size of the message input data.
     
    evmc_uint256be value
     The amount of Ether transferred with the message.
     
    evmc_bytes32 create2_salt
     The optional value used in new contract address construction.
     
    evmc_address code_address
     The address of the code to be executed.
     
    const uint8_t * code
     The code to be executed.
     
    size_t code_size
     The length of the code to be executed.
     
    +

    Detailed Description

    +

    The message describing an EVM call, including a zero-depth calls from a transaction origin.

    +

    Most of the fields are modelled by the section 8. Message Call of the Ethereum Yellow Paper.

    + +

    Definition at line 97 of file evmc.h.

    +

    Member Data Documentation

    + +

    ◆ code

    + +
    +
    + + + + +
    const uint8_t* evmc_message::code
    +
    + +

    The code to be executed.

    + +

    Definition at line 196 of file evmc.h.

    + +
    +
    + +

    ◆ code_address

    + +
    +
    + + + + +
    evmc_address evmc_message::code_address
    +
    + +

    The address of the code to be executed.

    +

    For EVMC_CALLCODE or EVMC_DELEGATECALL this may be different from the evmc_message::recipient. Not required when invoking evmc_execute_fn(), only when invoking evmc_call_fn(). Ignored if kind is EVMC_CREATE, EVMC_CREATE2 or EVMC_EOFCREATE.

    +

    In case of EVMC_CAPABILITY_PRECOMPILES implementation, this fields should be inspected to identify the requested precompile.

    +

    Defined as c in the Yellow Paper.

    + +

    Definition at line 191 of file evmc.h.

    + +
    +
    + +

    ◆ code_size

    + +
    +
    + + + + +
    size_t evmc_message::code_size
    +
    + +

    The length of the code to be executed.

    + +

    Definition at line 201 of file evmc.h.

    + +
    +
    + +

    ◆ create2_salt

    + +
    +
    + + + + +
    evmc_bytes32 evmc_message::create2_salt
    +
    + +

    The optional value used in new contract address construction.

    +

    Needed only for a Host to calculate created address when kind is EVMC_CREATE2 or EVMC_EOFCREATE. Ignored in evmc_execute_fn().

    + +

    Definition at line 176 of file evmc.h.

    + +
    +
    + +

    ◆ depth

    + +
    +
    + + + + +
    int32_t evmc_message::depth
    +
    + +

    The present depth of the message call stack.

    +

    Defined as e in the Yellow Paper.

    + +

    Definition at line 113 of file evmc.h.

    + +
    +
    + +

    ◆ flags

    + +
    +
    + + + + +
    uint32_t evmc_message::flags
    +
    + +

    Additional flags modifying the call execution behavior.

    +

    In the current version the only valid values are EVMC_STATIC or 0.

    + +

    Definition at line 106 of file evmc.h.

    + +
    +
    + +

    ◆ gas

    + +
    +
    + + + + +
    int64_t evmc_message::gas
    +
    + +

    The amount of gas available to the message execution.

    +

    Defined as g in the Yellow Paper.

    + +

    Definition at line 120 of file evmc.h.

    + +
    +
    + +

    ◆ input_data

    + +
    +
    + + + + +
    const uint8_t* evmc_message::input_data
    +
    + +

    The message input data.

    +

    The arbitrary length byte array of the input data of the call, defined as d in the Yellow Paper. This MAY be NULL.

    + +

    Definition at line 152 of file evmc.h.

    + +
    +
    + +

    ◆ input_size

    + +
    +
    + + + + +
    size_t evmc_message::input_size
    +
    + +

    The size of the message input data.

    +

    If input_data is NULL this MUST be 0.

    + +

    Definition at line 159 of file evmc.h.

    + +
    +
    + +

    ◆ kind

    + +
    +
    + + + + +
    enum evmc_call_kind evmc_message::kind
    +
    + +

    The kind of the call.

    +

    For zero-depth calls EVMC_CALL SHOULD be used.

    + +

    Definition at line 100 of file evmc.h.

    + +
    +
    + +

    ◆ recipient

    + +
    +
    + + + + +
    evmc_address evmc_message::recipient
    +
    + +

    The recipient of the message.

    +

    This is the address of the account which storage/balance/nonce is going to be modified by the message execution. In case of EVMC_CALL, this is also the account where the message value evmc_message::value is going to be transferred. For EVMC_CALLCODE or EVMC_DELEGATECALL, this may be different from the evmc_message::code_address.

    +

    Defined as r in the Yellow Paper.

    + +

    Definition at line 133 of file evmc.h.

    + +
    +
    + +

    ◆ sender

    + +
    +
    + + + + +
    evmc_address evmc_message::sender
    +
    + +

    The sender of the message.

    +

    The address of the sender of a message call defined as s in the Yellow Paper. This must be the message recipient of the message at the previous (lower) depth, except for the EVMC_DELEGATECALL where recipient is the 2 levels above the present depth. At the depth 0 this must be the transaction origin.

    + +

    Definition at line 143 of file evmc.h.

    + +
    +
    + +

    ◆ value

    + +
    +
    + + + + +
    evmc_uint256be evmc_message::value
    +
    + +

    The amount of Ether transferred with the message.

    +

    This is transferred value for EVMC_CALL or apparent value for EVMC_DELEGATECALL. Defined as v or v~ in the Yellow Paper.

    + +

    Definition at line 167 of file evmc.h.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + diff --git a/structevmc__message.js b/structevmc__message.js new file mode 100644 index 000000000..949b8e1e9 --- /dev/null +++ b/structevmc__message.js @@ -0,0 +1,16 @@ +var structevmc__message = +[ + [ "code", "structevmc__message.html#a2a7aede3f59fcab4f41734b6a671819c", null ], + [ "code_address", "structevmc__message.html#ac8cfdd4bc5d70de4deb0dacae4a6b536", null ], + [ "code_size", "structevmc__message.html#ad9ccd96006f71080e0c772cf80928a4e", null ], + [ "create2_salt", "structevmc__message.html#a20cb5b3664de79d11159e4099b80747f", null ], + [ "depth", "structevmc__message.html#a75ea15f85573ea3638e8625bbba54d3a", null ], + [ "flags", "structevmc__message.html#aae59f288163f3d3b2da2b5fdeb29512a", null ], + [ "gas", "structevmc__message.html#ae8deff46588584fa27890e74c82db5e7", null ], + [ "input_data", "structevmc__message.html#a1adee3454b105eb29cd659ee0cf65c77", null ], + [ "input_size", "structevmc__message.html#a2cf1deebd0dbbb20f25ecdfa299f4b5d", null ], + [ "kind", "structevmc__message.html#a691cb93e81d6dfd4fd7e2fa3d06a6bfa", null ], + [ "recipient", "structevmc__message.html#a63643daa5f3a30df28d42360a20e39e2", null ], + [ "sender", "structevmc__message.html#ae7f64ab994f49d9a5f028d56e80fd468", null ], + [ "value", "structevmc__message.html#adc7e2442cb362417931524ee904ecb33", null ] +]; \ No newline at end of file diff --git a/structevmc__result-members.html b/structevmc__result-members.html new file mode 100644 index 000000000..4a2de325b --- /dev/null +++ b/structevmc__result-members.html @@ -0,0 +1,85 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    evmc_result Member List
    +
    + +
    + + + + diff --git a/structevmc__result.html b/structevmc__result.html new file mode 100644 index 000000000..0c09126d4 --- /dev/null +++ b/structevmc__result.html @@ -0,0 +1,289 @@ + + + + + + + +EVMC: evmc_result Struct Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    evmc_result Struct Reference
    +
    +
    + +

    The EVM code execution result. + More...

    + +

    #include <evmc.h>

    +
    +Inheritance diagram for evmc_result:
    +
    +
    + + +evmc::Result + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Public Attributes

    enum evmc_status_code status_code
     The execution status code.
     
    int64_t gas_left
     The amount of gas left after the execution.
     
    int64_t gas_refund
     The refunded gas accumulated from this execution and its sub-calls.
     
    const uint8_t * output_data
     The reference to output data.
     
    size_t output_size
     The size of the output data.
     
    evmc_release_result_fn release
     The method releasing all resources associated with the result object.
     
    evmc_address create_address
     The address of the possibly created contract.
     
    uint8_t padding [4]
     Reserved data that MAY be used by a evmc_result object creator.
     
    +

    Detailed Description

    +

    The EVM code execution result.

    + +

    Definition at line 415 of file evmc.h.

    +

    Member Data Documentation

    + +

    ◆ create_address

    + +
    +
    + + + + +
    evmc_address evmc_result::create_address
    +
    + +

    The address of the possibly created contract.

    +

    The create address may be provided even though the contract creation has failed (evmc_result::status_code is not EVMC_SUCCESS). This is useful in situations when the address is observable, e.g. access to it remains warm. In all other cases the address MUST be null bytes.

    + +

    Definition at line 486 of file evmc.h.

    + +
    +
    + +

    ◆ gas_left

    + +
    +
    + + + + +
    int64_t evmc_result::gas_left
    +
    + +

    The amount of gas left after the execution.

    +

    If evmc_result::status_code is neither EVMC_SUCCESS nor EVMC_REVERT the value MUST be 0.

    + +

    Definition at line 426 of file evmc.h.

    + +
    +
    + +

    ◆ gas_refund

    + +
    +
    + + + + +
    int64_t evmc_result::gas_refund
    +
    + +

    The refunded gas accumulated from this execution and its sub-calls.

    +

    The transaction gas refund limit is not applied. If evmc_result::status_code is other than EVMC_SUCCESS the value MUST be 0.

    + +

    Definition at line 434 of file evmc.h.

    + +
    +
    + +

    ◆ output_data

    + +
    +
    + + + + +
    const uint8_t* evmc_result::output_data
    +
    + +

    The reference to output data.

    +

    The output contains data coming from RETURN opcode (iff evmc_result::code field is EVMC_SUCCESS) or from REVERT opcode.

    +

    The memory containing the output data is owned by EVM and has to be freed with evmc_result::release().

    +

    This pointer MAY be NULL. If evmc_result::output_size is 0 this pointer MUST NOT be dereferenced.

    + +

    Definition at line 448 of file evmc.h.

    + +
    +
    + +

    ◆ output_size

    + +
    +
    + + + + +
    size_t evmc_result::output_size
    +
    + +

    The size of the output data.

    +

    If evmc_result::output_data is NULL this MUST be 0.

    + +

    Definition at line 455 of file evmc.h.

    + +
    +
    + +

    ◆ padding

    + +
    +
    + + + + +
    uint8_t evmc_result::padding[4]
    +
    + +

    Reserved data that MAY be used by a evmc_result object creator.

    +

    This reserved 4 bytes together with 20 bytes from create_address form 24 bytes of memory called "optional data" within evmc_result struct to be optionally used by the evmc_result object creator.

    +
    See also
    evmc_result_optional_data, evmc_get_optional_data().
    +

    Also extends the size of the evmc_result to 64 bytes (full cache line).

    + +

    Definition at line 499 of file evmc.h.

    + +
    +
    + +

    ◆ release

    + +
    +
    + + + + +
    evmc_release_result_fn evmc_result::release
    +
    + +

    The method releasing all resources associated with the result object.

    +

    This method (function pointer) is optional (MAY be NULL) and MAY be set by the VM implementation. If set it MUST be called by the user once to release memory and other resources associated with the result object. Once the resources are released the result object MUST NOT be used again.

    +

    The suggested code pattern for releasing execution results:

    struct evmc_result result = ...;
    +
    if (result.release)
    +
    result.release(&result);
    +
    The EVM code execution result.
    Definition: evmc.h:416
    +
    evmc_release_result_fn release
    The method releasing all resources associated with the result object.
    Definition: evmc.h:476
    +
    Note
    It works similarly to C++ virtual destructor. Attaching the release function to the result itself allows VM composition.
    + +

    Definition at line 476 of file evmc.h.

    + +
    +
    + +

    ◆ status_code

    + +
    +
    + + + + +
    enum evmc_status_code evmc_result::status_code
    +
    + +

    The execution status code.

    + +

    Definition at line 418 of file evmc.h.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + diff --git a/structevmc__result.js b/structevmc__result.js new file mode 100644 index 000000000..00c26d0eb --- /dev/null +++ b/structevmc__result.js @@ -0,0 +1,11 @@ +var structevmc__result = +[ + [ "create_address", "structevmc__result.html#ae7f37ff7c9cfa3b58af2c89f4d610522", null ], + [ "gas_left", "structevmc__result.html#af8478c93dbcc3cb2876037c5a5afd4c0", null ], + [ "gas_refund", "structevmc__result.html#a8b68e61d8fbbeb59f8bc0770aaf94e9d", null ], + [ "output_data", "structevmc__result.html#a61978e85f9d795a7b9695b9cbf1748d6", null ], + [ "output_size", "structevmc__result.html#a93bb7419aff492cdef754421c6d74e26", null ], + [ "padding", "structevmc__result.html#aa321f15701e9df26a9f58d60dcbd0ef9", null ], + [ "release", "structevmc__result.html#a8727ff83d372ab0067bcf6656d30b0ed", null ], + [ "status_code", "structevmc__result.html#a759c4aaa4a1c002f5a8be09ccb0b6a1c", null ] +]; \ No newline at end of file diff --git a/structevmc__result.png b/structevmc__result.png new file mode 100644 index 000000000..0005fb6a5 Binary files /dev/null and b/structevmc__result.png differ diff --git a/structevmc__tx__context-members.html b/structevmc__tx__context-members.html new file mode 100644 index 000000000..7cb352d5e --- /dev/null +++ b/structevmc__tx__context-members.html @@ -0,0 +1,91 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + + + + + + diff --git a/structevmc__tx__context.html b/structevmc__tx__context.html new file mode 100644 index 000000000..bb28caee4 --- /dev/null +++ b/structevmc__tx__context.html @@ -0,0 +1,389 @@ + + + + + + + +EVMC: evmc_tx_context Struct Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    evmc_tx_context Struct Reference
    +
    +
    + +

    The transaction and block data for execution. + More...

    + +

    #include <evmc.h>

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Public Attributes

    evmc_uint256be tx_gas_price
     The transaction gas price.
     
    evmc_address tx_origin
     The transaction origin account.
     
    evmc_address block_coinbase
     The miner of the block.
     
    int64_t block_number
     The block number.
     
    int64_t block_timestamp
     The block timestamp.
     
    int64_t block_gas_limit
     The block gas limit.
     
    evmc_uint256be block_prev_randao
     The block previous RANDAO (EIP-4399).
     
    evmc_uint256be chain_id
     The blockchain's ChainID.
     
    evmc_uint256be block_base_fee
     The block base fee per gas (EIP-1559, EIP-3198).
     
    evmc_uint256be blob_base_fee
     The blob base fee (EIP-7516).
     
    const evmc_bytes32blob_hashes
     The array of blob hashes (EIP-4844).
     
    size_t blob_hashes_count
     The number of blob hashes (EIP-4844).
     
    const evmc_tx_initcodeinitcodes
     The array of transaction initcodes (TXCREATE).
     
    size_t initcodes_count
     The number of transaction initcodes (TXCREATE).
     
    +

    Detailed Description

    +

    The transaction and block data for execution.

    + +

    Definition at line 213 of file evmc.h.

    +

    Member Data Documentation

    + +

    ◆ blob_base_fee

    + +
    +
    + + + + +
    evmc_uint256be evmc_tx_context::blob_base_fee
    +
    + +

    The blob base fee (EIP-7516).

    + +

    Definition at line 224 of file evmc.h.

    + +
    +
    + +

    ◆ blob_hashes

    + +
    +
    + + + + +
    const evmc_bytes32* evmc_tx_context::blob_hashes
    +
    + +

    The array of blob hashes (EIP-4844).

    + +

    Definition at line 225 of file evmc.h.

    + +
    +
    + +

    ◆ blob_hashes_count

    + +
    +
    + + + + +
    size_t evmc_tx_context::blob_hashes_count
    +
    + +

    The number of blob hashes (EIP-4844).

    + +

    Definition at line 226 of file evmc.h.

    + +
    +
    + +

    ◆ block_base_fee

    + +
    +
    + + + + +
    evmc_uint256be evmc_tx_context::block_base_fee
    +
    + +

    The block base fee per gas (EIP-1559, EIP-3198).

    + +

    Definition at line 223 of file evmc.h.

    + +
    +
    + +

    ◆ block_coinbase

    + +
    +
    + + + + +
    evmc_address evmc_tx_context::block_coinbase
    +
    + +

    The miner of the block.

    + +

    Definition at line 217 of file evmc.h.

    + +
    +
    + +

    ◆ block_gas_limit

    + +
    +
    + + + + +
    int64_t evmc_tx_context::block_gas_limit
    +
    + +

    The block gas limit.

    + +

    Definition at line 220 of file evmc.h.

    + +
    +
    + +

    ◆ block_number

    + +
    +
    + + + + +
    int64_t evmc_tx_context::block_number
    +
    + +

    The block number.

    + +

    Definition at line 218 of file evmc.h.

    + +
    +
    + +

    ◆ block_prev_randao

    + +
    +
    + + + + +
    evmc_uint256be evmc_tx_context::block_prev_randao
    +
    + +

    The block previous RANDAO (EIP-4399).

    + +

    Definition at line 221 of file evmc.h.

    + +
    +
    + +

    ◆ block_timestamp

    + +
    +
    + + + + +
    int64_t evmc_tx_context::block_timestamp
    +
    + +

    The block timestamp.

    + +

    Definition at line 219 of file evmc.h.

    + +
    +
    + +

    ◆ chain_id

    + +
    +
    + + + + +
    evmc_uint256be evmc_tx_context::chain_id
    +
    + +

    The blockchain's ChainID.

    + +

    Definition at line 222 of file evmc.h.

    + +
    +
    + +

    ◆ initcodes

    + +
    +
    + + + + +
    const evmc_tx_initcode* evmc_tx_context::initcodes
    +
    + +

    The array of transaction initcodes (TXCREATE).

    + +

    Definition at line 227 of file evmc.h.

    + +
    +
    + +

    ◆ initcodes_count

    + +
    +
    + + + + +
    size_t evmc_tx_context::initcodes_count
    +
    + +

    The number of transaction initcodes (TXCREATE).

    + +

    Definition at line 228 of file evmc.h.

    + +
    +
    + +

    ◆ tx_gas_price

    + +
    +
    + + + + +
    evmc_uint256be evmc_tx_context::tx_gas_price
    +
    + +

    The transaction gas price.

    + +

    Definition at line 215 of file evmc.h.

    + +
    +
    + +

    ◆ tx_origin

    + +
    +
    + + + + +
    evmc_address evmc_tx_context::tx_origin
    +
    + +

    The transaction origin account.

    + +

    Definition at line 216 of file evmc.h.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + diff --git a/structevmc__tx__context.js b/structevmc__tx__context.js new file mode 100644 index 000000000..04b0ea46f --- /dev/null +++ b/structevmc__tx__context.js @@ -0,0 +1,17 @@ +var structevmc__tx__context = +[ + [ "blob_base_fee", "structevmc__tx__context.html#acff0bcc4345f5fc05c67aa2124394916", null ], + [ "blob_hashes", "structevmc__tx__context.html#a42ddac518fcd70897b6ea22563649b6b", null ], + [ "blob_hashes_count", "structevmc__tx__context.html#a6d6ac0d62f0401f2865ca1507cd345a2", null ], + [ "block_base_fee", "structevmc__tx__context.html#a172648b09b3ee20040466392a2a5f1d5", null ], + [ "block_coinbase", "structevmc__tx__context.html#acdb1c3a579bcf1578bff68d1f88f18a4", null ], + [ "block_gas_limit", "structevmc__tx__context.html#af51d0246df23060d5e958ada3f25a676", null ], + [ "block_number", "structevmc__tx__context.html#a1c3c0552db49b91358256c25643ba44a", null ], + [ "block_prev_randao", "structevmc__tx__context.html#acbfaa2901ab617c369fe1ceff4d14d0b", null ], + [ "block_timestamp", "structevmc__tx__context.html#a2391863eab970821d67a08341d9d3440", null ], + [ "chain_id", "structevmc__tx__context.html#ac68b370866987a1a1785751e4c76702a", null ], + [ "initcodes", "structevmc__tx__context.html#a5e82682b6691861d0e304c9ae7624df7", null ], + [ "initcodes_count", "structevmc__tx__context.html#a06162db38e158301f7ff9a642a5e6637", null ], + [ "tx_gas_price", "structevmc__tx__context.html#a4858c73d21efbd267ca4c2b084c9e8c0", null ], + [ "tx_origin", "structevmc__tx__context.html#a13072643da6e167daa209a305cd996db", null ] +]; \ No newline at end of file diff --git a/structevmc__tx__initcode-members.html b/structevmc__tx__initcode-members.html new file mode 100644 index 000000000..4d3a1cee6 --- /dev/null +++ b/structevmc__tx__initcode-members.html @@ -0,0 +1,80 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    evmc_tx_initcode Member List
    +
    +
    + +

    This is the complete list of members for evmc_tx_initcode, including all inherited members.

    + + + + +
    codeevmc_tx_initcode
    code_sizeevmc_tx_initcode
    hashevmc_tx_initcode
    +
    + + + + diff --git a/structevmc__tx__initcode.html b/structevmc__tx__initcode.html new file mode 100644 index 000000000..3ff522f50 --- /dev/null +++ b/structevmc__tx__initcode.html @@ -0,0 +1,158 @@ + + + + + + + +EVMC: evmc_tx_initcode Struct Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    evmc_tx_initcode Struct Reference
    +
    +
    + +

    The hashed initcode used for TXCREATE instruction. + More...

    + +

    #include <evmc.h>

    + + + + + + + + + + + +

    +Public Attributes

    evmc_bytes32 hash
     The initcode hash.
     
    const uint8_t * code
     The code.
     
    size_t code_size
     The length of the code.
     
    +

    Detailed Description

    +

    The hashed initcode used for TXCREATE instruction.

    + +

    Definition at line 205 of file evmc.h.

    +

    Member Data Documentation

    + +

    ◆ code

    + +
    +
    + + + + +
    const uint8_t* evmc_tx_initcode::code
    +
    + +

    The code.

    + +

    Definition at line 208 of file evmc.h.

    + +
    +
    + +

    ◆ code_size

    + +
    +
    + + + + +
    size_t evmc_tx_initcode::code_size
    +
    + +

    The length of the code.

    + +

    Definition at line 209 of file evmc.h.

    + +
    +
    + +

    ◆ hash

    + +
    +
    + + + + +
    evmc_bytes32 evmc_tx_initcode::hash
    +
    + +

    The initcode hash.

    + +

    Definition at line 207 of file evmc.h.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + diff --git a/structevmc__tx__initcode.js b/structevmc__tx__initcode.js new file mode 100644 index 000000000..1fd9eca66 --- /dev/null +++ b/structevmc__tx__initcode.js @@ -0,0 +1,6 @@ +var structevmc__tx__initcode = +[ + [ "code", "structevmc__tx__initcode.html#a874a12b6e701a54f302d48f3def187d3", null ], + [ "code_size", "structevmc__tx__initcode.html#a3bfdde67f0ec9606353fcf8139696d04", null ], + [ "hash", "structevmc__tx__initcode.html#a524671bd24cb0bbd7e3335f84f9f0d6f", null ] +]; \ No newline at end of file diff --git a/structevmc__vm-members.html b/structevmc__vm-members.html new file mode 100644 index 000000000..3d949dd22 --- /dev/null +++ b/structevmc__vm-members.html @@ -0,0 +1,84 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    evmc_vm Member List
    +
    +
    + +

    This is the complete list of members for evmc_vm, including all inherited members.

    + + + + + + + + +
    abi_versionevmc_vm
    destroyevmc_vm
    executeevmc_vm
    get_capabilitiesevmc_vm
    nameevmc_vm
    set_optionevmc_vm
    versionevmc_vm
    +
    + + + + diff --git a/structevmc__vm.html b/structevmc__vm.html new file mode 100644 index 000000000..023c2ea77 --- /dev/null +++ b/structevmc__vm.html @@ -0,0 +1,253 @@ + + + + + + + +EVMC: evmc_vm Struct Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    evmc_vm Struct Reference
    +
    +
    + +

    The VM instance. + More...

    + +

    #include <evmc.h>

    + + + + + + + + + + + + + + + + + + + + + + + +

    +Public Attributes

    const int abi_version
     EVMC ABI version implemented by the VM instance.
     
    const char * name
     The name of the EVMC VM implementation.
     
    const char * version
     The version of the EVMC VM implementation, e.g.
     
    evmc_destroy_fn destroy
     Pointer to function destroying the VM instance.
     
    evmc_execute_fn execute
     Pointer to function executing a code by the VM instance.
     
    evmc_get_capabilities_fn get_capabilities
     A method returning capabilities supported by the VM instance.
     
    evmc_set_option_fn set_option
     Optional pointer to function modifying VM's options.
     
    +

    Detailed Description

    +

    The VM instance.

    +

    Defines the base struct of the VM implementation.

    + +

    Definition at line 1139 of file evmc.h.

    +

    Member Data Documentation

    + +

    ◆ abi_version

    + +
    +
    + + + + +
    const int evmc_vm::abi_version
    +
    + +

    EVMC ABI version implemented by the VM instance.

    +

    Can be used to detect ABI incompatibilities. The EVMC ABI version represented by this file is in EVMC_ABI_VERSION.

    + +

    Definition at line 1147 of file evmc.h.

    + +
    +
    + +

    ◆ destroy

    + +
    +
    + + + + +
    evmc_destroy_fn evmc_vm::destroy
    +
    + +

    Pointer to function destroying the VM instance.

    +

    This is a mandatory method and MUST NOT be set to NULL.

    + +

    Definition at line 1170 of file evmc.h.

    + +
    +
    + +

    ◆ execute

    + +
    +
    + + + + +
    evmc_execute_fn evmc_vm::execute
    +
    + +

    Pointer to function executing a code by the VM instance.

    +

    This is a mandatory method and MUST NOT be set to NULL.

    + +

    Definition at line 1177 of file evmc.h.

    + +
    +
    + +

    ◆ get_capabilities

    + +
    +
    + + + + +
    evmc_get_capabilities_fn evmc_vm::get_capabilities
    +
    + +

    A method returning capabilities supported by the VM instance.

    +

    The value returned MAY change when different options are set via the set_option() method.

    +

    A Client SHOULD only rely on the value returned if it has queried it after it has called the set_option().

    +

    This is a mandatory method and MUST NOT be set to NULL.

    + +

    Definition at line 1189 of file evmc.h.

    + +
    +
    + +

    ◆ name

    + +
    +
    + + + + +
    const char* evmc_vm::name
    +
    + +

    The name of the EVMC VM implementation.

    +

    It MUST be a NULL-terminated not empty string. The content MUST be UTF-8 encoded (this implies ASCII encoding is also allowed).

    + +

    Definition at line 1155 of file evmc.h.

    + +
    +
    + +

    ◆ set_option

    + +
    +
    + + + + +
    evmc_set_option_fn evmc_vm::set_option
    +
    + +

    Optional pointer to function modifying VM's options.

    +

    If the VM does not support this feature the pointer can be NULL.

    + +

    Definition at line 1196 of file evmc.h.

    + +
    +
    + +

    ◆ version

    + +
    +
    + + + + +
    const char* evmc_vm::version
    +
    + +

    The version of the EVMC VM implementation, e.g.

    +

    "1.2.3b4".

    +

    It MUST be a NULL-terminated not empty string. The content MUST be UTF-8 encoded (this implies ASCII encoding is also allowed).

    + +

    Definition at line 1163 of file evmc.h.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + diff --git a/structevmc__vm.js b/structevmc__vm.js new file mode 100644 index 000000000..83cc66ace --- /dev/null +++ b/structevmc__vm.js @@ -0,0 +1,10 @@ +var structevmc__vm = +[ + [ "abi_version", "structevmc__vm.html#acccbdf95110faffb4dc85624bb1d99b6", null ], + [ "destroy", "structevmc__vm.html#ac78933134b4e14ca3dd4139ee061cc6b", null ], + [ "execute", "structevmc__vm.html#a8384d28338f2287a9f9e1508699c53f0", null ], + [ "get_capabilities", "structevmc__vm.html#a505d4e584a858c2eea7a026f3a94188b", null ], + [ "name", "structevmc__vm.html#ac29ccc98e89c8cab3ffc5bd51a2afaa8", null ], + [ "set_option", "structevmc__vm.html#a20fd85c822ba5f3296206fc8fe3e90b2", null ], + [ "version", "structevmc__vm.html#af98936c214ed16f5da05ba3d6a619faa", null ] +]; \ No newline at end of file diff --git a/sync_off.png b/sync_off.png new file mode 100644 index 000000000..3b443fc62 Binary files /dev/null and b/sync_off.png differ diff --git a/sync_on.png b/sync_on.png new file mode 100644 index 000000000..e08320fb6 Binary files /dev/null and b/sync_on.png differ diff --git a/tab_a.png b/tab_a.png new file mode 100644 index 000000000..3b725c41c Binary files /dev/null and b/tab_a.png differ diff --git a/tab_ad.png b/tab_ad.png new file mode 100644 index 000000000..e34850acf Binary files /dev/null and b/tab_ad.png differ diff --git a/tab_b.png b/tab_b.png new file mode 100644 index 000000000..e2b4a8638 Binary files /dev/null and b/tab_b.png differ diff --git a/tab_bd.png b/tab_bd.png new file mode 100644 index 000000000..91c252498 Binary files /dev/null and b/tab_bd.png differ diff --git a/tab_h.png b/tab_h.png new file mode 100644 index 000000000..fd5cb7054 Binary files /dev/null and b/tab_h.png differ diff --git a/tab_hd.png b/tab_hd.png new file mode 100644 index 000000000..2489273d4 Binary files /dev/null and b/tab_hd.png differ diff --git a/tab_s.png b/tab_s.png new file mode 100644 index 000000000..ab478c95b Binary files /dev/null and b/tab_s.png differ diff --git a/tab_sd.png b/tab_sd.png new file mode 100644 index 000000000..757a565ce Binary files /dev/null and b/tab_sd.png differ diff --git a/tabs.css b/tabs.css new file mode 100644 index 000000000..71c8a4704 --- /dev/null +++ b/tabs.css @@ -0,0 +1 @@ +.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.main-menu-btn{position:relative;display:inline-block;width:36px;height:36px;text-indent:36px;margin-left:8px;white-space:nowrap;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.main-menu-btn-icon,.main-menu-btn-icon:before,.main-menu-btn-icon:after{position:absolute;top:50%;left:2px;height:2px;width:24px;background:var(--nav-menu-button-color);-webkit-transition:all .25s;transition:all .25s}.main-menu-btn-icon:before{content:'';top:-7px;left:0}.main-menu-btn-icon:after{content:'';top:7px;left:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon{height:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:before{top:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:after{top:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}#main-menu-state{position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(1px,1px,1px,1px)}#main-menu-state:not(:checked) ~ #main-menu{display:none}#main-menu-state:checked ~ #main-menu{display:block}@media(min-width:768px){.main-menu-btn{position:absolute;top:-99999px}#main-menu-state:not(:checked) ~ #main-menu{display:block}}.sm-dox{background-image:var(--nav-gradient-image)}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:var(--font-family-nav);font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:var(--nav-text-normal-shadow);color:var(--nav-text-normal-color);outline:0}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:var(--nav-menu-toggle-color);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a span.sub-arrow:before{display:block;content:'+'}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:var(--nav-menu-background-color)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:var(--nav-menu-background-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:var(--nav-gradient-image);line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:var(--nav-text-normal-color) transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:var(--nav-separator-image);background-repeat:no-repeat;background-position:right;-moz-border-radius:0 !important;-webkit-border-radius:0;border-radius:0 !important}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a:hover span.sub-arrow{border-color:var(--nav-text-hover-color) transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent var(--nav-menu-background-color) transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:var(--nav-menu-background-color);-moz-border-radius:5px !important;-webkit-border-radius:5px;border-radius:5px !important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent var(--nav-menu-foreground-color);border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:var(--nav-menu-foreground-color);background-image:none;border:0 !important;color:var(--nav-menu-foreground-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent var(--nav-text-hover-color)}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:var(--nav-menu-background-color);height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent var(--nav-menu-foreground-color) transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:var(--nav-menu-foreground-color) transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:var(--nav-gradient-image)}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:var(--nav-menu-background-color)}} \ No newline at end of file diff --git a/tooling_8hpp_source.html b/tooling_8hpp_source.html new file mode 100644 index 000000000..5b1a97134 --- /dev/null +++ b/tooling_8hpp_source.html @@ -0,0 +1,97 @@ + + + + + + + +EVMC: include/evmc/tooling.hpp Source File + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    tooling.hpp
    +
    +
    +
    1// EVMC: Ethereum Client-VM Connector API.
    +
    2// Copyright 2020 The EVMC Authors.
    +
    3// Licensed under the Apache License, Version 2.0.
    +
    4
    +
    5#include <evmc/evmc.hpp>
    +
    6#include <iosfwd>
    +
    7#include <string>
    +
    8
    +
    9namespace evmc::tooling
    +
    10{
    +
    11int run(VM& vm,
    +
    12 evmc_revision rev,
    +
    13 int64_t gas,
    +
    14 bytes_view code,
    +
    15 bytes_view input,
    +
    16 bool create,
    +
    17 bool bench,
    +
    18 std::ostream& out);
    +
    19} // namespace evmc::tooling
    + +
    evmc_revision
    EVM revision.
    Definition: evmc.h:941
    +
    std::basic_string_view< unsigned char, byte_traits< unsigned char > > bytes_view
    String view of unsigned chars representing bytes.
    Definition: bytes.hpp:92
    +
    +
    + + + + diff --git a/unionevmc__result__optional__storage-members.html b/unionevmc__result__optional__storage-members.html new file mode 100644 index 000000000..e95624e35 --- /dev/null +++ b/unionevmc__result__optional__storage-members.html @@ -0,0 +1,79 @@ + + + + + + + +EVMC: Member List + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    evmc_result_optional_storage Member List
    +
    +
    + +

    This is the complete list of members for evmc_result_optional_storage, including all inherited members.

    + + + +
    bytesevmc_result_optional_storage
    pointerevmc_result_optional_storage
    +
    + + + + diff --git a/unionevmc__result__optional__storage.html b/unionevmc__result__optional__storage.html new file mode 100644 index 000000000..4550ea960 --- /dev/null +++ b/unionevmc__result__optional__storage.html @@ -0,0 +1,140 @@ + + + + + + + +EVMC: evmc_result_optional_storage Union Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    evmc_result_optional_storage Union Reference
    +
    +
    + +

    The union representing evmc_result "optional storage". + More...

    + +

    #include <helpers.h>

    + + + + + + + + +

    +Public Attributes

    uint8_t bytes [24]
     24 bytes of optional storage.
     
    void * pointer
     Optional pointer.
     
    +

    Detailed Description

    +

    The union representing evmc_result "optional storage".

    +

    The evmc_result struct contains 24 bytes of optional storage that can be reused by the object creator if the object does not contain evmc_result::create_address.

    +

    A VM implementation MAY use this memory to keep additional data when returning result from evmc_execute_fn(). The host application MAY use this memory to keep additional data when returning result of performed calls from evmc_call_fn().

    +
    See also
    evmc_get_optional_storage(), evmc_get_const_optional_storage().
    + +

    Definition at line 198 of file helpers.h.

    +

    Member Data Documentation

    + +

    ◆ bytes

    + +
    +
    + + + + +
    uint8_t evmc_result_optional_storage::bytes[24]
    +
    + +

    24 bytes of optional storage.

    + +

    Definition at line 200 of file helpers.h.

    + +
    +
    + +

    ◆ pointer

    + +
    +
    + + + + +
    void* evmc_result_optional_storage::pointer
    +
    + +

    Optional pointer.

    + +

    Definition at line 201 of file helpers.h.

    + +
    +
    +
    The documentation for this union was generated from the following file: +
    +
    + + + + diff --git a/unionevmc__result__optional__storage.js b/unionevmc__result__optional__storage.js new file mode 100644 index 000000000..ae3c4bd9a --- /dev/null +++ b/unionevmc__result__optional__storage.js @@ -0,0 +1,5 @@ +var unionevmc__result__optional__storage = +[ + [ "bytes", "unionevmc__result__optional__storage.html#ac98bd272f9b63a17b2c1a10deff80716", null ], + [ "pointer", "unionevmc__result__optional__storage.html#a98839fa102a6c892a735804160ca34c7", null ] +]; \ No newline at end of file diff --git a/utils_8h.html b/utils_8h.html new file mode 100644 index 000000000..e8d3c092c --- /dev/null +++ b/utils_8h.html @@ -0,0 +1,96 @@ + + + + + + + +EVMC: include/evmc/utils.h File Reference + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    utils.h File Reference
    +
    +
    + +

    A collection of helper macros to handle some non-portable features of C/C++ compilers. +More...

    + +

    Go to the source code of this file.

    + + + + + + + + +

    +Macros

    #define EVMC_EXPORT   __attribute__((visibility("default")))
     Marks a function to be exported from a shared library.
     
    #define EVMC_NOEXCEPT
     Safe way of marking a function with noexcept C++ specifier.
     
    +

    Detailed Description

    +

    A collection of helper macros to handle some non-portable features of C/C++ compilers.

    + +

    Definition in file utils.h.

    +
    +
    + + + + diff --git a/utils_8h.js b/utils_8h.js new file mode 100644 index 000000000..6c10c3e76 --- /dev/null +++ b/utils_8h.js @@ -0,0 +1,5 @@ +var utils_8h = +[ + [ "EVMC_EXPORT", "group__helpers.html#gaad1a8fca9b52410cdc8f73739883cb93", null ], + [ "EVMC_NOEXCEPT", "group__helpers.html#ga73d425fddf1083ef70d1ffd9a29522d4", null ] +]; \ No newline at end of file diff --git a/utils_8h_source.html b/utils_8h_source.html new file mode 100644 index 000000000..e04acfef0 --- /dev/null +++ b/utils_8h_source.html @@ -0,0 +1,93 @@ + + + + + + + +EVMC: include/evmc/utils.h Source File + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    utils.h
    +
    +
    +Go to the documentation of this file.
    1// EVMC: Ethereum Client-VM Connector API.
    +
    2// Copyright 2018 The EVMC Authors.
    +
    3// Licensed under the Apache License, Version 2.0.
    +
    4
    +
    5#pragma once
    +
    6
    +
    19#if defined _MSC_VER || defined __MINGW32__
    +
    20#define EVMC_EXPORT __declspec(dllexport)
    +
    21#else
    +
    22#define EVMC_EXPORT __attribute__((visibility("default")))
    +
    23#endif
    +
    24
    +
    29#ifdef __cplusplus
    +
    30#define EVMC_NOEXCEPT noexcept
    +
    31#else
    +
    32#define EVMC_NOEXCEPT
    +
    33#endif
    +
    34
    +
    +
    + + + + diff --git a/vmguide.html b/vmguide.html new file mode 100644 index 000000000..7014cd143 --- /dev/null +++ b/vmguide.html @@ -0,0 +1,98 @@ + + + + + + + +EVMC: EVMC VM Implementation Guide + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    EVMC VM Implementation Guide
    +
    +
    +

    +

    ‍How to add EVMC interface to Your Ethereum VM implementation.

    +
    +

    +An example

    +

    You can start with the example implementation of EVMC VM interface in C++.

    +

    +VM instance

    +

    The VM instance is described by the evmc_vm struct. It contains the basic static information about the VM like name and version. The struct also includes the VM methods (in form of function pointers) to allow the Host to interact with the VM.

    +

    Some methods are optional. The VM must implement at least all mandatory ones.

    +

    The instance struct must also include the EVMC ABI version (EVMC_ABI_VERSION) it was build with. This allows the Host to check the ABI compatibility when loading VMs dynamically.

    +

    The VM instance is created and returned as a pointer from a special "create" function. The EVMC recommends to name the function by the VM codename, e.g. evmc_create_example_vm().

    +

    +VM methods implementation

    +

    Each VM methods takes the pointer to the evmc_vm as the first argument. The VM implementation can extend the evmc_vm struct for storing internal data. This allow implementing the VM in object-oriented manner.

    +

    The most important method is evmc_vm::execute() because it executes EVM code. Remember that the Host is allowed to invoke the execute method concurrently so do not store data related to a particular execution context in the VM instance.

    +

    Before a client can actually execute a VM, it is important to implement the three basic fields for querying name (evmc_vm::name), version (evmc_vm::version) and capabilities (evmc_vm::get_capabilities()) as well as the evmc_vm::destroy() method to wind the VM down.

    +

    Other methods are optional.

    +

    +Resource management

    +

    All additional resources allocated when the VM instance is created must be freed when the destroy method is invoked.

    +

    The VM implementation can also attach additional resources to the evmc_result of an execution. These resource must be freed when the evmc_result::release() method is invoked.

    +

    Have fun!

    +
    +
    +
    + + + + diff --git a/vmtester.html b/vmtester.html new file mode 100644 index 000000000..65d0cc158 --- /dev/null +++ b/vmtester.html @@ -0,0 +1,81 @@ + + + + + + + +EVMC: EVMC VM Tester + + + + + + + + + + +
    +
    + + + + + + +
    +
    EVMC +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    EVMC VM Tester
    +
    +
    +

    The EVMC project contains a EVMC-compatibility testing tool for VM implementations.

    +

    The tool is called evmc-vmtester and to include it in the EVMC build add -DEVMC_TESTING=ON CMake option to the project configuration step.

    +

    Usage is simple as

    +
    evmc-vmtester [vm]
    +

    where [vm] is a path to a shared library with VM implementation.

    +

    For more information check evmc-vmtester --help.

    +
    +
    +
    + + + +