Fabcoin Core  0.16.2
P2P Digital Currency
Classes | Typedefs | Enumerations | Functions
evm.h File Reference
#include <stdint.h>
#include <stddef.h>
Include dependency graph for evm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  evm_uint256be
 Big-endian 256-bit integer. More...
 
struct  evm_uint160be
 Big-endian 160-bit hash suitable for keeping an Ethereum address. More...
 
struct  evm_result
 The EVM code execution result. More...
 
union  evm_variant
 Variant type to represent possible types of values used in EVM. More...
 
struct  evm_instance
 The EVM instance. More...
 
struct  evm_factory
 The EVM instance factory. More...
 

Typedefs

typedef void(* evm_release_result_fn) (struct evm_result const *result)
 Forward declaration. More...
 
typedef void(* evm_query_fn) (union evm_variant *result, struct evm_env *env, enum evm_query_key key, const union evm_variant *arg)
 Query callback function. More...
 
typedef void(* evm_update_fn) (struct evm_env *env, enum evm_update_key key, const union evm_variant *arg1, const union evm_variant *arg2)
 Update callback function. More...
 
typedef int64_t(* evm_call_fn) (struct evm_env *env, enum evm_call_kind kind, int64_t gas, const struct evm_uint160be *address, const struct evm_uint256be *value, uint8_t const *input, size_t input_size, uint8_t *output, size_t output_size)
 Pointer to the callback function supporting EVM calls. More...
 
typedef struct evm_instance *(* evm_create_fn) (evm_query_fn query_fn, evm_update_fn update_fn, evm_call_fn call_fn)
 Forward declaration. More...
 
typedef void(* evm_destroy_fn) (struct evm_instance *evm)
 Destroys the EVM instance. More...
 
typedef int(* evm_set_option_fn) (struct evm_instance *evm, char const *name, char const *value)
 Configures the EVM instance. More...
 
typedef struct evm_result(* evm_execute_fn) (struct evm_instance *instance, struct evm_env *env, enum evm_mode mode, struct evm_uint256be code_hash, uint8_t const *code, size_t code_size, int64_t gas, uint8_t const *input, size_t input_size, struct evm_uint256be value)
 Generates and executes machine code for given EVM bytecode. More...
 
typedef enum evm_code_status(* evm_get_code_status_fn) (struct evm_instance *instance, enum evm_mode mode, struct evm_uint256be code_hash)
 Get information the status of the code in the VM. More...
 
typedef void(* evm_prepare_code_fn) (struct evm_instance *instance, enum evm_mode mode, struct evm_uint256be code_hash, uint8_t const *code, size_t code_size)
 Request preparation of the code for faster execution. More...
 

Enumerations

enum  { EVM_ABI_VERSION = 0 }
 The EVM-C ABI version number matching the interface declared in this file. More...
 
enum  evm_result_code {
  EVM_SUCCESS = 0, EVM_FAILURE = 1, EVM_OUT_OF_GAS = 2, EVM_BAD_INSTRUCTION = 3,
  EVM_BAD_JUMP_DESTINATION = 4, EVM_STACK_OVERFLOW = 5, EVM_STACK_UNDERFLOW = 6
}
 The execution result code. More...
 
enum  evm_query_key {
  EVM_SLOAD = 0, EVM_ADDRESS = 1, EVM_CALLER = 2, EVM_ORIGIN = 3,
  EVM_GAS_PRICE = 4, EVM_COINBASE = 5, EVM_DIFFICULTY = 6, EVM_GAS_LIMIT = 7,
  EVM_NUMBER = 8, EVM_TIMESTAMP = 9, EVM_CODE_BY_ADDRESS = 10, EVM_CODE_SIZE = 11,
  EVM_BALANCE = 12, EVM_BLOCKHASH = 13, EVM_ACCOUNT_EXISTS = 14, EVM_CALL_DEPTH = 15
}
 The query callback key. More...
 
enum  evm_update_key { EVM_SSTORE = 0, EVM_LOG = 1, EVM_SELFDESTRUCT = 2 }
 The update callback key. More...
 
enum  evm_call_kind { EVM_CALL = 0, EVM_DELEGATECALL = 1, EVM_CALLCODE = 2, EVM_CREATE = 3 }
 The kind of call-like instruction. More...
 
enum  evm_mode { EVM_FRONTIER = 0, EVM_HOMESTEAD = 1, EVM_ANTI_DOS = 2, EVM_CLEARING = 3 }
 EVM compatibility mode aka chain mode. More...
 
enum  evm_code_status { EVM_UNKNOWN, EVM_READY, EVM_CACHED }
 Status of a code in VM. Useful for JIT-like implementations. More...
 

Functions

struct evm_factory examplevm_get_factory (void)
 Example of a function creating uninitialized instance of an example VM. More...